]>
Commit | Line | Data |
---|---|---|
0c8959d6 | 1 | # |
f9328639 | 2 | # (C) Copyright 2000-2006 |
0c8959d6 WD |
3 | # Wolfgang Denk, DENX Software Engineering, wd@denx.de. |
4 | # | |
1a459660 | 5 | # SPDX-License-Identifier: GPL-2.0+ |
0c8959d6 WD |
6 | # |
7 | ||
8 | include $(TOPDIR)/config.mk | |
9 | ||
01baa056 KM |
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 | ||
6d8962e8 | 23 | LIB = $(obj)lib$(ARCH).o |
0c8959d6 | 24 | |
4b919725 SW |
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 | |
06f60ae3 SW |
34 | COBJS-y += cache.o time.o |
35 | SOBJS-y += ticks.o | |
4b919725 SW |
36 | else |
37 | ||
823afe7c | 38 | SOBJS-y += ppcstring.o |
4b919725 SW |
39 | |
40 | SOBJS-y += ppccache.o | |
823afe7c | 41 | SOBJS-y += ticks.o |
fc4e1887 | 42 | SOBJS-y += reloc.o |
823afe7c | 43 | |
4bbfd3e2 | 44 | COBJS-$(CONFIG_BAT_RW) += bat_rw.o |
083f2e08 | 45 | ifndef CONFIG_SPL_BUILD |
660c60c4 | 46 | ifndef CONFIG_SYS_GENERIC_BOARD |
823afe7c | 47 | COBJS-y += board.o |
083f2e08 | 48 | endif |
660c60c4 | 49 | endif |
b8eee435 | 50 | COBJS-$(CONFIG_CMD_BOOTM) += bootm.o |
823afe7c MB |
51 | COBJS-y += cache.o |
52 | COBJS-y += extable.o | |
53 | COBJS-y += interrupts.o | |
425d3b66 | 54 | COBJS-$(CONFIG_CMD_KGDB) += kgdb.o |
8d1165e1 | 55 | COBJS-${CONFIG_CMD_IDE} += ide.o |
823afe7c MB |
56 | COBJS-y += time.o |
57 | ||
083f2e08 SR |
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 | |
4ccd5510 WD |
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 | |
460c2ce3 WD |
69 | ifdef CONFIG_MPC5200 |
70 | $(obj)ppcstring.o: AFLAGS += -Dmemcpy=__memcpy | |
4ccd5510 | 71 | COBJS-y += memcpy_mpc5200.o |
460c2ce3 | 72 | endif |
083f2e08 | 73 | endif |
460c2ce3 | 74 | |
4b919725 SW |
75 | endif # not minimal |
76 | ||
ea8256f0 SR |
77 | ifdef CONFIG_SPL_BUILD |
78 | COBJS-$(CONFIG_SPL_FRAMEWORK) += spl.o | |
79 | endif | |
80 | ||
4ccd5510 WD |
81 | COBJS += $(sort $(COBJS-y)) |
82 | ||
01baa056 KM |
83 | SRCS := $(GLSOBJS:.o=.S) $(GLCOBJS:.o=.c) \ |
84 | $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c) | |
4ccd5510 WD |
85 | OBJS := $(addprefix $(obj),$(SOBJS-y) $(COBJS-y)) |
86 | ||
01baa056 KM |
87 | TARGETS += $(LIB) |
88 | ||
89 | all: $(TARGETS) | |
90 | ||
f9328639 | 91 | $(LIB): $(obj).depend $(OBJS) |
6d8962e8 | 92 | $(call cmd_link_o_target, $(OBJS)) |
0c8959d6 | 93 | |
01baa056 KM |
94 | $(LIBGCC): $(obj).depend $(LGOBJS) |
95 | $(call cmd_link_o_target, $(LGOBJS)) | |
96 | ||
0c8959d6 WD |
97 | ######################################################################### |
98 | ||
f9328639 MB |
99 | # defines $(obj).depend target |
100 | include $(SRCTREE)/rules.mk | |
0c8959d6 | 101 | |
f9328639 | 102 | sinclude $(obj).depend |
0c8959d6 WD |
103 | |
104 | ######################################################################### |