summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Tyser <ptyser@xes-inc.com>2009-06-22 18:01:39 -0500
committerWolfgang Denk <wd@denx.de>2009-07-11 00:30:25 +0200
commit117d0ab5e6f3b3dd48fc346df4919555a78afd39 (patch)
tree70d56bb2ca1c2143f5db98448ef1bbf5056f46ec
parent644cb38108b8dc22e0ef3cf5f404fe310d1995f8 (diff)
downloadu-boot-imx-117d0ab5e6f3b3dd48fc346df4919555a78afd39.zip
u-boot-imx-117d0ab5e6f3b3dd48fc346df4919555a78afd39.tar.gz
u-boot-imx-117d0ab5e6f3b3dd48fc346df4919555a78afd39.tar.bz2
api_examples/Makefile: Combine ELF and BIN targets
Combining the two rules cleans up the Makefile a bit Signed-off-by: Peter Tyser <ptyser@xes-inc.com> Acked-by: Rafal Jaworowski <raj@semihalf.com>
-rw-r--r--api_examples/Makefile21
1 files changed, 8 insertions, 13 deletions
diff --git a/api_examples/Makefile b/api_examples/Makefile
index be0b462..98506a0 100644
--- a/api_examples/Makefile
+++ b/api_examples/Makefile
@@ -29,18 +29,18 @@ endif
include $(TOPDIR)/config.mk
-ELF-$(CONFIG_API) += demo
-BIN-$(CONFIG_API) += demo.bin
-ELF := $(ELF-y)
-BIN := $(BIN-y)
+# Resulting ELF and binary exectuables will be named demo and demo.bin
+OUTPUT-$(CONFIG_API) = $(obj)demo
#CFLAGS += -v
-COBJS-$(CONFIG_API) += $(ELF:=.o)
SOBJS-$(CONFIG_API) += crt0.o
+COBJS-$(CONFIG_API) += demo.o
ifeq ($(ARCH),ppc)
SOBJS-$(CONFIG_API) += ppcstring.o
endif
+
+OUTPUT := $(OUTPUT-y)
COBJS := $(COBJS-y)
SOBJS := $(SOBJS-y)
@@ -60,28 +60,23 @@ SRCS += $(COBJS:.o=.c)
SRCS += $(LIBCOBJS:.o=.c)
SRCS += $(SOBJS:.o=.S)
OBJS := $(addprefix $(obj),$(COBJS))
-ELF := $(addprefix $(obj),$(ELF))
-BIN := $(addprefix $(obj),$(BIN))
gcclibdir := $(shell dirname `$(CC) -print-libgcc-file-name`)
CPPFLAGS += -I..
-all: $(obj).depend $(OBJS) $(LIB) $(ELF) $(BIN)
+all: $(obj).depend $(OBJS) $(LIB) $(OUTPUT)
#########################################################################
$(LIB): $(obj).depend $(LIBOBJS)
$(AR) $(ARFLAGS) $@ $(LIBOBJS)
-$(ELF):
+$(OUTPUT):
$(obj)%: $(obj)%.o $(LIB)
$(LD) $(obj)crt0.o -Ttext $(LOAD_ADDR) \
-o $@ $< $(LIB) \
-L$(gcclibdir) -lgcc
-
-$(BIN):
-$(obj)%.bin: $(obj)%
- $(OBJCOPY) -O binary $< $@ 2>/dev/null
+ $(OBJCOPY) -O binary $@ $(OUTPUT).bin 2>/dev/null
$(obj)crc32.c:
@rm -f $(obj)crc32.c