xref: /openbmc/u-boot/lib/Makefile (revision 224f7452)
1# SPDX-License-Identifier: GPL-2.0+
2#
3# (C) Copyright 2000-2006
4# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
5
6ifndef CONFIG_SPL_BUILD
7
8obj-$(CONFIG_EFI) += efi/
9obj-$(CONFIG_EFI_LOADER) += efi_driver/
10obj-$(CONFIG_EFI_LOADER) += efi_loader/
11obj-$(CONFIG_CMD_BOOTEFI_SELFTEST) += efi_selftest/
12obj-$(CONFIG_LZMA) += lzma/
13obj-$(CONFIG_BZIP2) += bzip2/
14obj-$(CONFIG_TIZEN) += tizen/
15obj-$(CONFIG_FIT) += libfdt/
16obj-$(CONFIG_OF_LIVE) += of_live.o
17obj-$(CONFIG_CMD_DHRYSTONE) += dhry/
18obj-$(CONFIG_ARCH_AT91) += at91/
19obj-$(CONFIG_OPTEE) += optee/
20
21obj-$(CONFIG_AES) += aes.o
22
23ifndef API_BUILD
24ifneq ($(CONFIG_UT_UNICODE)$(CONFIG_EFI_LOADER),)
25obj-y += charset.o
26endif
27endif
28obj-$(CONFIG_USB_TTY) += circbuf.o
29obj-y += crc7.o
30obj-y += crc8.o
31obj-y += crc16.o
32obj-$(CONFIG_ERRNO_STR) += errno_str.o
33obj-$(CONFIG_FIT) += fdtdec_common.o
34obj-$(CONFIG_TEST_FDTDEC) += fdtdec_test.o
35obj-$(CONFIG_GZIP_COMPRESSED) += gzip.o
36obj-$(CONFIG_GENERATE_SMBIOS_TABLE) += smbios.o
37obj-$(CONFIG_IMAGE_SPARSE) += image-sparse.o
38obj-y += initcall.o
39obj-$(CONFIG_LMB) += lmb.o
40obj-y += ldiv.o
41obj-$(CONFIG_MD5) += md5.o
42obj-y += net_utils.o
43obj-$(CONFIG_PHYSMEM) += physmem.o
44obj-y += qsort.o
45obj-y += rc4.o
46obj-$(CONFIG_SUPPORT_EMMC_RPMB) += sha256.o
47obj-$(CONFIG_RBTREE)	+= rbtree.o
48obj-$(CONFIG_BITREVERSE) += bitrev.o
49obj-y += list_sort.o
50endif
51
52obj-$(CONFIG_$(SPL_TPL_)TPM) += tpm-common.o
53ifeq ($(CONFIG_$(SPL_TPL_)TPM),y)
54obj-y += crc8.o
55obj-$(CONFIG_TPM_V1) += tpm-v1.o
56obj-$(CONFIG_TPM_V2) += tpm-v2.o
57endif
58
59obj-$(CONFIG_RSA) += rsa/
60obj-$(CONFIG_SHA1) += sha1.o
61obj-$(CONFIG_SHA256) += sha256.o
62
63obj-$(CONFIG_$(SPL_)ZLIB) += zlib/
64obj-$(CONFIG_$(SPL_)GZIP) += gunzip.o
65obj-$(CONFIG_$(SPL_)LZO) += lzo/
66obj-$(CONFIG_$(SPL_)LZ4) += lz4_wrapper.o
67
68obj-$(CONFIG_LIBAVB) += libavb/
69
70obj-$(CONFIG_$(SPL_TPL_)SAVEENV) += qsort.o
71obj-$(CONFIG_$(SPL_TPL_)OF_LIBFDT) += libfdt/
72ifneq ($(CONFIG_$(SPL_TPL_)BUILD)$(CONFIG_$(SPL_TPL_)OF_PLATDATA),yy)
73obj-$(CONFIG_$(SPL_TPL_)OF_CONTROL) += fdtdec_common.o
74obj-$(CONFIG_$(SPL_TPL_)OF_CONTROL) += fdtdec.o
75endif
76
77ifdef CONFIG_SPL_BUILD
78obj-$(CONFIG_SPL_YMODEM_SUPPORT) += crc16.o
79obj-$(CONFIG_$(SPL_TPL_)HASH_SUPPORT) += crc16.o
80obj-$(CONFIG_SPL_NET_SUPPORT) += net_utils.o
81endif
82obj-$(CONFIG_ADDR_MAP) += addr_map.o
83obj-y += hashtable.o
84obj-y += errno.o
85obj-y += display_options.o
86CFLAGS_display_options.o := $(if $(BUILD_TAG),-DBUILD_TAG='"$(BUILD_TAG)"')
87obj-$(CONFIG_BCH) += bch.o
88obj-y += crc32.o
89obj-$(CONFIG_CRC32C) += crc32c.o
90obj-y += ctype.o
91obj-y += div64.o
92obj-y += hang.o
93obj-y += linux_compat.o
94obj-y += linux_string.o
95obj-y += membuff.o
96obj-$(CONFIG_REGEX) += slre.o
97obj-y += string.o
98obj-y += tables_csum.o
99obj-y += time.o
100obj-y += hexdump.o
101obj-$(CONFIG_TRACE) += trace.o
102obj-$(CONFIG_LIB_UUID) += uuid.o
103obj-$(CONFIG_LIB_RAND) += rand.o
104obj-y += panic.o
105
106ifeq ($(CONFIG_$(SPL_TPL_)BUILD),y)
107# SPL U-Boot may use full-printf, tiny-printf or none at all
108ifdef CONFIG_USE_TINY_PRINTF
109obj-$(CONFIG_$(SPL_TPL_)SPRINTF) += tiny-printf.o
110else
111obj-$(CONFIG_$(SPL_TPL_)SPRINTF) += vsprintf.o strmhz.o
112endif
113obj-$(CONFIG_$(SPL_TPL_)STRTO) += strto.o
114else
115# Main U-Boot always uses the full printf support
116obj-y += vsprintf.o strto.o strmhz.o
117endif
118
119subdir-ccflags-$(CONFIG_CC_OPTIMIZE_LIBS_FOR_SPEED) += -O2
120