]> git.kernelconcepts.de Git - karo-tx-uboot.git/blob - arch/powerpc/lib/Makefile
Merge branch 'master' of git://git.denx.de/u-boot-i2c
[karo-tx-uboot.git] / arch / powerpc / lib / Makefile
1 #
2 # (C) Copyright 2000-2006
3 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
4 #
5 # SPDX-License-Identifier:      GPL-2.0+
6 #
7
8 include $(TOPDIR)/config.mk
9
10 ## Build a couple of necessary functions into a private libgcc
11 LIBGCC  = $(obj)libgcc.o
12 GLSOBJS += _ashldi3.o
13 GLSOBJS += _ashrdi3.o
14 GLSOBJS += _lshrdi3.o
15 LGOBJS  := $(addprefix $(obj),$(GLSOBJS)) \
16            $(addprefix $(obj),$(GLCOBJS))
17
18 ## But only build it if the user asked for it
19 ifdef USE_PRIVATE_LIBGCC
20 TARGETS += $(LIBGCC)
21 endif
22
23 LIB     = $(obj)lib$(ARCH).o
24
25 MINIMAL=
26
27 ifdef CONFIG_SPL_BUILD
28 ifdef CONFIG_SPL_INIT_MINIMAL
29 MINIMAL=y
30 endif
31 endif
32
33 ifdef MINIMAL
34 COBJS-y += cache.o time.o
35 SOBJS-y += ticks.o
36 else
37
38 SOBJS-y += ppcstring.o
39
40 SOBJS-y += ppccache.o
41 SOBJS-y += ticks.o
42 SOBJS-y += reloc.o
43
44 COBJS-$(CONFIG_BAT_RW) += bat_rw.o
45 ifndef CONFIG_SPL_BUILD
46 ifndef CONFIG_SYS_GENERIC_BOARD
47 COBJS-y += board.o
48 endif
49 endif
50 COBJS-$(CONFIG_CMD_BOOTM) += bootm.o
51 COBJS-y += cache.o
52 COBJS-y += extable.o
53 COBJS-y += interrupts.o
54 COBJS-$(CONFIG_CMD_KGDB) += kgdb.o
55 COBJS-${CONFIG_CMD_IDE} += ide.o
56 COBJS-y += time.o
57
58 # Don't include the MPC5xxx special memcpy into the
59 # SPL U-Boot image. memcpy is used in the SPL NOR
60 # flash driver. And we need the real, fast memcpy
61 # here. We have no problems with unaligned access.
62 ifndef CONFIG_SPL_BUILD
63 # Workaround for local bus unaligned access problems
64 # on MPC512x and MPC5200
65 ifdef CONFIG_MPC512X
66 $(obj)ppcstring.o: AFLAGS += -Dmemcpy=__memcpy
67 COBJS-y += memcpy_mpc5200.o
68 endif
69 ifdef CONFIG_MPC5200
70 $(obj)ppcstring.o: AFLAGS += -Dmemcpy=__memcpy
71 COBJS-y += memcpy_mpc5200.o
72 endif
73 endif
74
75 endif # not minimal
76
77 ifdef CONFIG_SPL_BUILD
78 COBJS-$(CONFIG_SPL_FRAMEWORK) += spl.o
79 endif
80
81 COBJS   += $(sort $(COBJS-y))
82
83 SRCS    := $(GLSOBJS:.o=.S) $(GLCOBJS:.o=.c) \
84            $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c)
85 OBJS    := $(addprefix $(obj),$(SOBJS-y) $(COBJS-y))
86
87 TARGETS += $(LIB)
88
89 all: $(TARGETS)
90
91 $(LIB): $(obj).depend $(OBJS)
92         $(call cmd_link_o_target, $(OBJS))
93
94 $(LIBGCC): $(obj).depend $(LGOBJS)
95         $(call cmd_link_o_target, $(LGOBJS))
96
97 #########################################################################
98
99 # defines $(obj).depend target
100 include $(SRCTREE)/rules.mk
101
102 sinclude $(obj).depend
103
104 #########################################################################