]> git.sur5r.net Git - u-boot/blobdiff - api_examples/Makefile
Merge branch 'master' of git+ssh://10.10.0.7/home/wd/git/u-boot/master
[u-boot] / api_examples / Makefile
index 5812bcd3370cfa3c85afbbc1716a87e33787d3c3..5666f489b939176f07310679915bd41520f9adb7 100644 (file)
@@ -30,19 +30,25 @@ endif
 
 include $(TOPDIR)/config.mk
 
-ELF    += demo
-BIN    += demo.bin
+ELF-$(CONFIG_API) += demo
+BIN-$(CONFIG_API) += demo.bin
+ELF    := $(ELF-y)
+BIN    := $(BIN-y)
 
 #CFLAGS += -v
 
-COBJS  := $(ELF:=.o)
-SOBJS  := crt0.o
+COBJS-$(CONFIG_API) += $(ELF:=.o)
+SOBJS-$(CONFIG_API) += crt0.o
 ifeq ($(ARCH),ppc)
-SOBJS  += ppcstring.o
+SOBJS-$(CONFIG_API) += ppcstring.o
 endif
+COBJS  := $(COBJS-y)
+SOBJS  := $(SOBJS-y)
 
 LIB    = $(obj)libglue.a
-LIBCOBJS= glue.o crc32.o ctype.o string.o vsprintf.o libgenwrap.o
+LIBCOBJS-$(CONFIG_API) += glue.o crc32.o ctype.o string.o vsprintf.o \
+                               libgenwrap.o
+LIBCOBJS := $(LIBCOBJS-y)
 
 LIBOBJS        = $(addprefix $(obj),$(SOBJS) $(LIBCOBJS))
 
@@ -55,7 +61,7 @@ gcclibdir := $(shell dirname `$(CC) -print-libgcc-file-name`)
 
 CPPFLAGS += -I..
 
-all:   $(obj).depend $(OBJS) $(LIB) $(BIN) $(ELF)
+all:   $(obj).depend $(OBJS) $(LIB) $(ELF) $(BIN)
 
 #########################################################################
 $(LIB):        $(obj).depend $(LIBOBJS)
@@ -71,7 +77,7 @@ $(BIN):
 $(obj)%.bin:   $(obj)%
                $(OBJCOPY) -O binary $< $@ 2>/dev/null
 
-$(obj)crc32.c: 
+$(obj)crc32.c:
        @rm -f $(obj)crc32.c
        ln -s $(src)../lib_generic/crc32.c $(obj)crc32.c