vsprintf.c: add GUID printing
[oweals/u-boot.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 ifeq ($(ARCH),mips)
14 ifdef CONFIG_64BIT
15 LOAD_ADDR = 0xffffffff80200000
16 else
17 LOAD_ADDR = 0x80200000
18 endif
19 endif
20
21 # Resulting ELF and binary exectuables will be named demo and demo.bin
22 extra-y = demo
23
24 # Source files located in the examples/api directory
25 OBJ-y += crt0.o
26 OBJ-y += demo.o
27 OBJ-y += glue.o
28 OBJ-y += libgenwrap.o
29
30 # Source files which exist outside the examples/api directory
31 EXT_COBJ-y += lib/crc32.o
32 EXT_COBJ-y += lib/ctype.o
33 EXT_COBJ-y += lib/div64.o
34 EXT_COBJ-y += lib/string.o
35 EXT_COBJ-y += lib/time.o
36 EXT_COBJ-y += lib/vsprintf.o
37 EXT_COBJ-y += lib/charset.o
38 EXT_COBJ-$(CONFIG_LIB_UUID) += lib/uuid.o
39 EXT_SOBJ-$(CONFIG_PPC) += arch/powerpc/lib/ppcstring.o
40 ifeq ($(ARCH),arm)
41 EXT_SOBJ-$(CONFIG_USE_ARCH_MEMSET) += arch/arm/lib/memset.o
42 endif
43
44 # Create a list of object files to be compiled
45 OBJS := $(OBJ-y) $(notdir $(EXT_COBJ-y) $(EXT_SOBJ-y))
46 targets += $(OBJS)
47 OBJS := $(addprefix $(obj)/,$(OBJS))
48
49 #########################################################################
50
51 quiet_cmd_link_demo = LD      $@
52 cmd_link_demo = $(LD) --gc-sections -Ttext $(LOAD_ADDR) -o $@ $(filter-out $(PHONY), $^) $(PLATFORM_LIBS)
53
54 $(obj)/demo: $(OBJS) FORCE
55         $(call if_changed,link_demo)
56
57 # demo.bin is never genrated. Is this necessary?
58 OBJCOPYFLAGS_demo.bin := -O binary
59 $(obj)/demo.bin: $(obj)/demo FORCE
60         $(call if_changed,objcopy)
61
62 # Rule to build generic library C files
63 $(addprefix $(obj)/,$(notdir $(EXT_COBJ-y))): $(obj)/%.o: lib/%.c FORCE
64         $(call cmd,force_checksrc)
65         $(call if_changed_rule,cc_o_c)
66
67 # Rule to build architecture-specific library assembly files
68 $(addprefix $(obj)/,$(notdir $(EXT_SOBJ-y))): $(obj)/%.o: arch/$(ARCH)/lib/%.S FORCE
69         $(call if_changed_dep,as_o_S)