From 4a20df395d9b6961a4877852e911cbbadd019d40 Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Tue, 4 Feb 2014 17:24:12 +0900 Subject: examples: Use scripts/Makefile.build Signed-off-by: Masahiro Yamada --- examples/api/Makefile | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) (limited to 'examples/api') diff --git a/examples/api/Makefile b/examples/api/Makefile index cad10a3ecb..f770859361 100644 --- a/examples/api/Makefile +++ b/examples/api/Makefile @@ -11,10 +11,8 @@ ifeq ($(ARCH),arm) LOAD_ADDR = 0x1000000 endif -include $(TOPDIR)/config.mk - # Resulting ELF and binary exectuables will be named demo and demo.bin -OUTPUT = $(obj)demo +extra-y = demo # Source files located in the examples/api directory SOBJ_FILES-y += crt0.o @@ -43,13 +41,13 @@ OBJS += $(addprefix $(obj),$(COBJ_FILES-y)) OBJS += $(addprefix $(obj),$(notdir $(EXT_COBJ_FILES-y))) OBJS += $(addprefix $(obj),$(notdir $(EXT_SOBJ_FILES-y))) -all: $(obj).depend $(OUTPUT) - ######################################################################### -$(OUTPUT): $(OBJS) +$(obj)demo: $(OBJS) $(LD) --gc-sections -Ttext $(LOAD_ADDR) -o $@ $^ $(PLATFORM_LIBS) - $(OBJCOPY) -O binary $@ $(OUTPUT).bin 2>/dev/null + +$(obj)demo.bin: $(obj)demo + $(OBJCOPY) -O binary $< $@ 2>/dev/null # Rule to build generic library C files $(obj)%.o: $(SRCTREE)/lib/%.c @@ -58,12 +56,3 @@ $(obj)%.o: $(SRCTREE)/lib/%.c # Rule to build architecture-specific library assembly files $(obj)%.o: $(SRCTREE)/arch/$(ARCH)/lib/%.S $(CC) -g $(CFLAGS) -c -o $@ $< - -######################################################################### - -# defines $(obj).depend target -include $(SRCTREE)/rules.mk - -sinclude $(obj).depend - -######################################################################### -- cgit v1.2.3