xref: /openbmc/u-boot/common/Makefile (revision d754254f)
1#
2# (C) Copyright 2004-2006
3# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
4#
5# SPDX-License-Identifier:	GPL-2.0+
6#
7
8# core
9ifndef CONFIG_SPL_BUILD
10obj-y += init/
11obj-y += main.o
12obj-y += exports.o
13obj-$(CONFIG_HASH) += hash.o
14obj-$(CONFIG_HUSH_PARSER) += cli_hush.o
15obj-$(CONFIG_AUTOBOOT) += autoboot.o
16
17# This option is not just y/n - it can have a numeric value
18ifdef CONFIG_BOOT_RETRY_TIME
19obj-y += bootretry.o
20endif
21
22# boards
23obj-y += board_f.o
24obj-y += board_r.o
25obj-$(CONFIG_DISPLAY_BOARDINFO) += board_info.o
26obj-$(CONFIG_DISPLAY_BOARDINFO_LATE) += board_info.o
27
28obj-$(CONFIG_CMD_BOOTM) += bootm.o bootm_os.o
29obj-$(CONFIG_CMD_BOOTZ) += bootm.o bootm_os.o
30obj-$(CONFIG_CMD_BOOTI) += bootm.o bootm_os.o
31
32# environment
33obj-y += env_attr.o
34obj-y += env_callback.o
35obj-y += env_flags.o
36obj-$(CONFIG_ENV_IS_IN_DATAFLASH) += env_dataflash.o
37obj-$(CONFIG_ENV_IS_IN_EEPROM) += env_eeprom.o
38extra-$(CONFIG_ENV_IS_EMBEDDED) += env_embedded.o
39obj-$(CONFIG_ENV_IS_IN_EEPROM) += env_embedded.o
40extra-$(CONFIG_ENV_IS_IN_FLASH) += env_embedded.o
41obj-$(CONFIG_ENV_IS_IN_NVRAM) += env_embedded.o
42obj-$(CONFIG_ENV_IS_IN_FLASH) += env_flash.o
43obj-$(CONFIG_ENV_IS_IN_MMC) += env_mmc.o
44obj-$(CONFIG_ENV_IS_IN_FAT) += env_fat.o
45obj-$(CONFIG_ENV_IS_IN_EXT4) += env_ext4.o
46obj-$(CONFIG_ENV_IS_IN_NAND) += env_nand.o
47obj-$(CONFIG_ENV_IS_IN_NVRAM) += env_nvram.o
48obj-$(CONFIG_ENV_IS_IN_ONENAND) += env_onenand.o
49obj-$(CONFIG_ENV_IS_IN_SATA) += env_sata.o
50obj-$(CONFIG_ENV_IS_IN_SPI_FLASH) += env_sf.o
51obj-$(CONFIG_ENV_IS_IN_REMOTE) += env_remote.o
52obj-$(CONFIG_ENV_IS_IN_UBI) += env_ubi.o
53obj-$(CONFIG_ENV_IS_NOWHERE) += env_nowhere.o
54
55obj-$(CONFIG_CMD_BEDBUG) += bedbug.o
56obj-$(CONFIG_$(SPL_)OF_LIBFDT) += fdt_support.o
57
58obj-$(CONFIG_MII) += miiphyutil.o
59obj-$(CONFIG_CMD_MII) += miiphyutil.o
60obj-$(CONFIG_PHYLIB) += miiphyutil.o
61
62ifdef CONFIG_CMD_USB
63obj-y += usb.o usb_hub.o
64obj-$(CONFIG_USB_STORAGE) += usb_storage.o
65endif
66
67# others
68obj-$(CONFIG_CONSOLE_MUX) += iomux.o
69obj-$(CONFIG_MTD_NOR_FLASH) += flash.o
70obj-$(CONFIG_CMD_KGDB) += kgdb.o kgdb_stubs.o
71obj-$(CONFIG_I2C_EDID) += edid.o
72obj-$(CONFIG_KALLSYMS) += kallsyms.o
73obj-y += splash.o
74obj-$(CONFIG_SPLASH_SOURCE) += splash_source.o
75ifndef CONFIG_DM_VIDEO
76obj-$(CONFIG_LCD) += lcd.o lcd_console.o
77endif
78obj-$(CONFIG_LCD_ROTATION) += lcd_console_rotation.o
79obj-$(CONFIG_LCD_DT_SIMPLEFB) += lcd_simplefb.o
80obj-$(CONFIG_LYNXKDI) += lynxkdi.o
81obj-$(CONFIG_MENU) += menu.o
82obj-$(CONFIG_CMD_SATA) += sata.o
83obj-$(CONFIG_SCSI) += scsi.o
84obj-$(CONFIG_UPDATE_TFTP) += update.o
85obj-$(CONFIG_DFU_TFTP) += update.o
86obj-$(CONFIG_USB_KEYBOARD) += usb_kbd.o
87obj-$(CONFIG_CMDLINE) += cli_readline.o cli_simple.o
88
89endif # !CONFIG_SPL_BUILD
90
91obj-$(CONFIG_$(SPL_)BOOTSTAGE) += bootstage.o
92
93ifdef CONFIG_SPL_BUILD
94obj-$(CONFIG_SPL_DFU_SUPPORT) += dfu.o
95obj-$(CONFIG_SPL_DFU_SUPPORT) += cli_hush.o
96obj-$(CONFIG_SPL_HASH_SUPPORT) += hash.o
97obj-$(CONFIG_ENV_IS_IN_FLASH) += env_flash.o
98obj-$(CONFIG_SPL_YMODEM_SUPPORT) += xyzModem.o
99obj-$(CONFIG_SPL_LOAD_FIT) += common_fit.o
100obj-$(CONFIG_SPL_NET_SUPPORT) += miiphyutil.o
101obj-$(CONFIG_SPL_OF_LIBFDT) += fdt_support.o
102ifdef CONFIG_SPL_USB_HOST_SUPPORT
103obj-$(CONFIG_SPL_USB_SUPPORT) += usb.o usb_hub.o
104obj-$(CONFIG_USB_STORAGE) += usb_storage.o
105endif
106# environment
107ifdef CONFIG_TPL_BUILD
108obj-$(CONFIG_TPL_ENV_SUPPORT) += env_attr.o
109obj-$(CONFIG_TPL_ENV_SUPPORT) += env_flags.o
110obj-$(CONFIG_TPL_ENV_SUPPORT) += env_callback.o
111else
112obj-$(CONFIG_SPL_ENV_SUPPORT) += env_attr.o
113obj-$(CONFIG_SPL_ENV_SUPPORT) += env_flags.o
114obj-$(CONFIG_SPL_ENV_SUPPORT) += env_callback.o
115endif
116ifneq ($(CONFIG_TPL_ENV_SUPPORT)$(CONFIG_SPL_ENV_SUPPORT),)
117obj-$(CONFIG_ENV_IS_NOWHERE) += env_nowhere.o
118obj-$(CONFIG_ENV_IS_IN_MMC) += env_mmc.o
119obj-$(CONFIG_ENV_IS_IN_FAT) += env_fat.o
120obj-$(CONFIG_ENV_IS_IN_EXT4) += env_ext4.o
121obj-$(CONFIG_ENV_IS_IN_NAND) += env_nand.o
122obj-$(CONFIG_ENV_IS_IN_SPI_FLASH) += env_sf.o
123obj-$(CONFIG_ENV_IS_IN_FLASH) += env_flash.o
124endif
125ifdef CONFIG_SPL_SATA_SUPPORT
126obj-$(CONFIG_SCSI) += scsi.o
127endif
128endif
129#environment
130obj-y += env_common.o
131#others
132obj-$(CONFIG_DDR_SPD) += ddr_spd.o
133obj-$(CONFIG_SPD_EEPROM) += ddr_spd.o
134obj-$(CONFIG_HWCONFIG) += hwconfig.o
135obj-$(CONFIG_BOUNCE_BUFFER) += bouncebuf.o
136ifdef CONFIG_SPL_BUILD
137ifdef CONFIG_TPL_BUILD
138obj-$(CONFIG_TPL_SERIAL_SUPPORT) += console.o
139else
140obj-$(CONFIG_SPL_SERIAL_SUPPORT) += console.o
141endif
142else
143obj-y += console.o
144endif
145obj-$(CONFIG_CROS_EC) += cros_ec.o
146obj-y += dlmalloc.o
147ifdef CONFIG_SYS_MALLOC_F_LEN
148obj-y += malloc_simple.o
149endif
150obj-y += image.o
151obj-$(CONFIG_ANDROID_BOOT_IMAGE) += image-android.o
152obj-$(CONFIG_$(SPL_)OF_LIBFDT) += image-fdt.o
153obj-$(CONFIG_$(SPL_)FIT) += image-fit.o
154obj-$(CONFIG_FIT_EMBED) += boot_fit.o common_fit.o
155obj-$(CONFIG_$(SPL_)FIT_SIGNATURE) += image-sig.o
156obj-$(CONFIG_IO_TRACE) += iotrace.o
157obj-y += memsize.o
158obj-y += stdio.o
159
160# This option is not just y/n - it can have a numeric value
161ifdef CONFIG_FASTBOOT_FLASH
162obj-y += image-sparse.o
163ifdef CONFIG_FASTBOOT_FLASH_MMC_DEV
164obj-y += fb_mmc.o
165endif
166ifdef CONFIG_FASTBOOT_FLASH_NAND_DEV
167obj-y += fb_nand.o
168endif
169endif
170
171ifdef CONFIG_CMD_EEPROM_LAYOUT
172obj-y += eeprom/eeprom_field.o eeprom/eeprom_layout.o
173endif
174
175obj-y += cli.o
176obj-$(CONFIG_FSL_DDR_INTERACTIVE) += cli_simple.o cli_readline.o
177obj-$(CONFIG_CMD_DFU) += dfu.o
178obj-y += command.o
179obj-y += s_record.o
180obj-y += xyzModem.o
181
182CFLAGS_env_embedded.o := -Wa,--no-warn -DENV_CRC=$(shell tools/envcrc 2>/dev/null)
183