2 # (C) Copyright 2000-2006
3 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
5 # SPDX-License-Identifier: GPL-2.0+
8 include $(TOPDIR
)/config.mk
12 ELF-
$(CONFIG_SMC91111
) += smc91111_eeprom
13 ELF-
$(CONFIG_SMC911X
) += smc911x_eeprom
14 ELF-
$(CONFIG_SPI_FLASH_ATMEL
) += atmel_df_pow2
16 # - Fix the warning of 82559_eeprom.c and uncomment the following
18 # - Delete 82559_eeprom.c and the following line
19 #ELF-$(CONFIG_X86) += 82559_eeprom
20 ELF-
$(CONFIG_MPC5xxx
) += interrupt
21 ELF-
$(CONFIG_8xx
) += test_burst timer
22 ELF-
$(CONFIG_8260
) += mem_to_mem_idma2intr
23 ELF-
$(CONFIG_PPC
) += sched
26 # Some versions of make do not handle trailing white spaces properly;
27 # leading to build failures. The problem was found with GNU Make 3.80.
28 # Using 'strip' as a workaround for the problem.
30 ELF
:= $(strip $(ELF-y
))
32 SREC
:= $(addsuffix .srec
,$(ELF
))
33 BIN
:= $(addsuffix .bin
,$(ELF
))
37 LIB
= $(obj
)libstubs.o
39 LIBAOBJS-
$(CONFIG_PPC
) += ppc_longjmp.o ppc_setjmp.o
40 LIBAOBJS-
$(CONFIG_8xx
) += test_burst_lib.o
41 LIBAOBJS
:= $(LIBAOBJS-y
)
45 LIBOBJS
= $(addprefix $(obj
),$(LIBAOBJS
) $(LIBCOBJS
))
47 SRCS
:= $(COBJS
:.o
=.c
) $(LIBCOBJS
:.o
=.c
) $(LIBAOBJS
:.o
=.S
)
48 OBJS
:= $(addprefix $(obj
),$(COBJS
))
49 ELF
:= $(addprefix $(obj
),$(ELF
))
50 BIN
:= $(addprefix $(obj
),$(BIN
))
51 SREC
:= $(addprefix $(obj
),$(SREC
))
53 gcclibdir
:= $(shell dirname
`$(CC) -print-libgcc-file-name`)
55 # For PowerPC there's no need to compile standalone applications as a
56 # relocatable executable. The relocation data is not needed, and
57 # also causes the entry point of the standalone application to be
59 ifeq ($(ARCH
),powerpc
)
60 AFLAGS
:= $(filter-out $(RELFLAGS
),$(AFLAGS
))
61 CFLAGS
:= $(filter-out $(RELFLAGS
),$(CFLAGS
))
62 CPPFLAGS
:= $(filter-out $(RELFLAGS
),$(CPPFLAGS
))
65 # We don't want gcc reordering functions if possible. This ensures that an
66 # application's entry point will be the first function in the application's
68 CFLAGS_NTR
:= $(call cc-option
,-fno-toplevel-reorder
)
69 CFLAGS
+= $(CFLAGS_NTR
)
71 all: $(obj
).depend
$(OBJS
) $(LIB
) $(SREC
) $(BIN
) $(ELF
)
73 #########################################################################
74 $(LIB
): $(obj
).depend
$(LIBOBJS
)
75 $(call cmd_link_o_target
, $(LIBOBJS
))
78 $(obj
)%: $(obj
)%.o
$(LIB
)
79 $(LD
) $(LDFLAGS
) -g
-Ttext
$(CONFIG_STANDALONE_LOAD_ADDR
) \
80 -o
$@
-e
$(SYM_PREFIX
)$(notdir $(<:.o
=)) $< $(LIB
) \
85 $(OBJCOPY
) -O srec
$< $@
2>/dev
/null
89 $(OBJCOPY
) -O binary
$< $@
2>/dev
/null
91 #########################################################################
93 # defines $(obj).depend target
94 include $(SRCTREE
)/rules.mk
96 sinclude
$(obj
).depend
98 #########################################################################