]> git.kernelconcepts.de Git - karo-tx-uboot.git/blob - examples/api/Makefile
kbuild: use shorten logs for misc targets
[karo-tx-uboot.git] / examples / api / Makefile
1 #
2 # (C) Copyright 2007 Semihalf
3 #
4 # SPDX-License-Identifier:      GPL-2.0+
5 #
6
7 ifeq ($(ARCH),powerpc)
8 LOAD_ADDR = 0x40000
9 endif
10 ifeq ($(ARCH),arm)
11 LOAD_ADDR = 0x1000000
12 endif
13
14 # Resulting ELF and binary exectuables will be named demo and demo.bin
15 extra-y = demo
16
17 # Source files located in the examples/api directory
18 OBJ-y += crt0.o
19 OBJ-y += demo.o
20 OBJ-y += glue.o
21 OBJ-y += libgenwrap.o
22
23 # Source files which exist outside the examples/api directory
24 EXT_COBJ-y += lib/crc32.o
25 EXT_COBJ-y += lib/ctype.o
26 EXT_COBJ-y += lib/div64.o
27 EXT_COBJ-y += lib/string.o
28 EXT_COBJ-y += lib/time.o
29 EXT_COBJ-y += lib/vsprintf.o
30 EXT_SOBJ-$(CONFIG_PPC) += arch/powerpc/lib/ppcstring.o
31
32 # Create a list of object files to be compiled
33 OBJS := $(OBJ-y) $(notdir $(EXT_COBJ-y) $(EXT_SOBJ-y))
34 targets += $(OBJS)
35 OBJS := $(addprefix $(obj)/,$(OBJS))
36
37 #########################################################################
38
39 quiet_cmd_link_demo = LD      $@
40 cmd_link_demo = $(LD) --gc-sections -Ttext $(LOAD_ADDR) -o $@ $(filter-out $(PHONY), $^) $(PLATFORM_LIBS)
41
42 $(obj)/demo: $(OBJS) FORCE
43         $(call if_changed,link_demo)
44
45 # demo.bin is never genrated. Is this necessary?
46 OBJCOPYFLAGS_demo.bin := -O binary
47 $(obj)/demo.bin: $(obj)/demo FORCE
48         $(call if_changed,objcopy)
49
50 # Rule to build generic library C files
51 $(addprefix $(obj)/,$(notdir $(EXT_COBJ-y))): $(obj)/%.o: lib/%.c FORCE
52         $(call cmd,force_checksrc)
53         $(call if_changed_rule,cc_o_c)
54
55 # Rule to build architecture-specific library assembly files
56 $(addprefix $(obj)/,$(notdir $(EXT_SOBJ-y))): $(obj)/%.o: arch/powerpc/lib/%.S FORCE
57         $(call if_changed_dep,as_o_S)