]> git.ipfire.org Git - people/ms/u-boot.git/blame - examples/api/Makefile
vsprintf.c: add GUID printing
[people/ms/u-boot.git] / examples / api / Makefile
CommitLineData
500856eb
RJ
1#
2# (C) Copyright 2007 Semihalf
3#
1a459660 4# SPDX-License-Identifier: GPL-2.0+
500856eb
RJ
5#
6
a47a12be 7ifeq ($(ARCH),powerpc)
500856eb
RJ
8LOAD_ADDR = 0x40000
9endif
7fb6c4f9
RJ
10ifeq ($(ARCH),arm)
11LOAD_ADDR = 0x1000000
12endif
7c604231 13ifeq ($(ARCH),mips)
78757d52
SG
14ifdef CONFIG_64BIT
15LOAD_ADDR = 0xffffffff80200000
16else
7c604231
SG
17LOAD_ADDR = 0x80200000
18endif
78757d52 19endif
500856eb 20
117d0ab5 21# Resulting ELF and binary exectuables will be named demo and demo.bin
4a20df39 22extra-y = demo
876b3cef 23
d4abc757 24# Source files located in the examples/api directory
04a34c96
MY
25OBJ-y += crt0.o
26OBJ-y += demo.o
27OBJ-y += glue.o
28OBJ-y += libgenwrap.o
876b3cef 29
d4abc757 30# Source files which exist outside the examples/api directory
04a34c96
MY
31EXT_COBJ-y += lib/crc32.o
32EXT_COBJ-y += lib/ctype.o
33EXT_COBJ-y += lib/div64.o
34EXT_COBJ-y += lib/string.o
35EXT_COBJ-y += lib/time.o
36EXT_COBJ-y += lib/vsprintf.o
274325c5 37EXT_COBJ-y += lib/charset.o
22ada0c8 38EXT_COBJ-$(CONFIG_LIB_UUID) += lib/uuid.o
04a34c96 39EXT_SOBJ-$(CONFIG_PPC) += arch/powerpc/lib/ppcstring.o
40d5534c
TR
40ifeq ($(ARCH),arm)
41EXT_SOBJ-$(CONFIG_USE_ARCH_MEMSET) += arch/arm/lib/memset.o
42endif
117d0ab5 43
876b3cef 44# Create a list of object files to be compiled
04a34c96
MY
45OBJS := $(OBJ-y) $(notdir $(EXT_COBJ-y) $(EXT_SOBJ-y))
46targets += $(OBJS)
47OBJS := $(addprefix $(obj)/,$(OBJS))
500856eb 48
500856eb 49#########################################################################
522f6f02 50
04a34c96
MY
51quiet_cmd_link_demo = LD $@
52cmd_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)
4a20df39 56
f9c235fd
MY
57# demo.bin is never genrated. Is this necessary?
58OBJCOPYFLAGS_demo.bin := -O binary
59$(obj)/demo.bin: $(obj)/demo FORCE
60 $(call if_changed,objcopy)
500856eb 61
876b3cef 62# Rule to build generic library C files
04a34c96 63$(addprefix $(obj)/,$(notdir $(EXT_COBJ-y))): $(obj)/%.o: lib/%.c FORCE
6825a95b
MY
64 $(call cmd,force_checksrc)
65 $(call if_changed_rule,cc_o_c)
500856eb 66
876b3cef 67# Rule to build architecture-specific library assembly files
40d5534c 68$(addprefix $(obj)/,$(notdir $(EXT_SOBJ-y))): $(obj)/%.o: arch/$(ARCH)/lib/%.S FORCE
6825a95b 69 $(call if_changed_dep,as_o_S)