Martin Roth | adaab4a | 2022-10-28 22:38:44 -0600 | [diff] [blame] | 1 | ## SPDX-License-Identifier: GPL-2.0-only |
Patrick Georgi | c88d16b | 2017-01-11 15:26:58 +0100 | [diff] [blame] | 2 | compressionobj := |
| 3 | compressionobj += compress.o |
| 4 | # LZ4 |
| 5 | compressionobj += lz4.o |
| 6 | compressionobj += lz4hc.o |
| 7 | compressionobj += lz4frame.o |
| 8 | compressionobj += xxhash.o |
| 9 | compressionobj += lz4_wrapper.o |
| 10 | # LZMA |
| 11 | compressionobj += lzma.o |
| 12 | compressionobj += LzFind.o |
| 13 | compressionobj += LzmaDec.o |
| 14 | compressionobj += LzmaEnc.o |
| 15 | |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 16 | cbfsobj := |
Stefan Reinauer | 2e200cd | 2012-10-30 14:02:45 -0700 | [diff] [blame] | 17 | cbfsobj += cbfstool.o |
Patrick Georgi | b7b56dd8 | 2009-09-14 13:29:27 +0000 | [diff] [blame] | 18 | cbfsobj += common.o |
Hung-Te Lin | eab2c81 | 2013-01-29 01:56:17 +0800 | [diff] [blame] | 19 | cbfsobj += cbfs_image.o |
Patrick Georgi | b7b56dd8 | 2009-09-14 13:29:27 +0000 | [diff] [blame] | 20 | cbfsobj += cbfs-mkstage.o |
| 21 | cbfsobj += cbfs-mkpayload.o |
Ronald G. Minnich | a8a133d | 2013-12-30 13:16:18 -0800 | [diff] [blame] | 22 | cbfsobj += elfheaders.o |
Aaron Durbin | 4be1674 | 2015-09-15 17:00:23 -0500 | [diff] [blame] | 23 | cbfsobj += rmodule.o |
Ronald G. Minnich | aa2f739 | 2013-12-03 11:13:35 -0800 | [diff] [blame] | 24 | cbfsobj += xdr.o |
Sol Boucher | e3260a0 | 2015-03-25 13:40:08 -0700 | [diff] [blame] | 25 | cbfsobj += partitioned_file.o |
Julius Werner | 76dab5f | 2020-03-19 21:09:35 -0700 | [diff] [blame] | 26 | cbfsobj += platform_fixups.o |
Julius Werner | 09f2921 | 2015-09-29 13:51:35 -0700 | [diff] [blame] | 27 | # COMMONLIB |
Julius Werner | 4bfbabd | 2020-05-06 17:27:02 -0700 | [diff] [blame] | 28 | cbfsobj += cbfs_private.o |
Furquan Shaikh | b0c2fe0 | 2016-05-09 12:23:01 -0700 | [diff] [blame] | 29 | cbfsobj += fsp_relocate.o |
Sol Boucher | e3260a0 | 2015-03-25 13:40:08 -0700 | [diff] [blame] | 30 | # FMAP |
| 31 | cbfsobj += fmap.o |
| 32 | cbfsobj += kv_pair.o |
| 33 | cbfsobj += valstr.o |
Patrick Georgi | de36d33 | 2013-08-27 20:22:21 +0200 | [diff] [blame] | 34 | # linux as payload |
| 35 | cbfsobj += linux_trampoline.o |
| 36 | cbfsobj += cbfs-payload-linux.o |
Patrick Georgi | c88d16b | 2017-01-11 15:26:58 +0100 | [diff] [blame] | 37 | # compression algorithms |
| 38 | cbfsobj += $(compressionobj) |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 39 | |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 40 | fmapobj := |
| 41 | fmapobj += fmaptool.o |
Sol Boucher | 023e829 | 2015-03-18 10:13:48 -0700 | [diff] [blame] | 42 | fmapobj += cbfs_sections.o |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 43 | fmapobj += fmap_from_fmd.o |
| 44 | fmapobj += fmd.o |
| 45 | fmapobj += fmd_parser.o |
| 46 | fmapobj += fmd_scanner.o |
| 47 | # FMAP |
| 48 | fmapobj += fmap.o |
| 49 | fmapobj += kv_pair.o |
| 50 | fmapobj += valstr.o |
| 51 | |
Sol Boucher | 0e53931 | 2015-03-05 15:38:03 -0800 | [diff] [blame] | 52 | rmodobj := |
Aaron Durbin | 4fde5a6 | 2014-03-07 15:11:53 -0600 | [diff] [blame] | 53 | rmodobj += rmodtool.o |
| 54 | rmodobj += rmodule.o |
| 55 | rmodobj += common.o |
| 56 | rmodobj += elfheaders.o |
| 57 | rmodobj += xdr.o |
| 58 | |
Furquan Shaikh | 233f1b6 | 2016-05-19 16:12:16 -0700 | [diff] [blame] | 59 | ifwiobj := |
| 60 | ifwiobj += ifwitool.o |
| 61 | ifwiobj += common.o |
| 62 | |
Philipp Deppenwiese | 5ada002 | 2018-11-20 13:54:49 +0100 | [diff] [blame] | 63 | ifitobj := |
| 64 | ifitobj += ifittool.o |
| 65 | ifitobj += common.o |
| 66 | ifitobj += fit.o |
| 67 | ifitobj += cbfs_image.o |
| 68 | # Make it link .... |
| 69 | ifitobj += xdr.o |
| 70 | ifitobj += elfheaders.o |
| 71 | ifitobj += partitioned_file.o |
| 72 | ifitobj += cbfs-mkstage.o |
| 73 | ifitobj += cbfs-mkpayload.o |
| 74 | ifitobj += rmodule.o |
Philipp Deppenwiese | 5ada002 | 2018-11-20 13:54:49 +0100 | [diff] [blame] | 75 | # FMAP |
| 76 | ifitobj += fmap.o |
| 77 | ifitobj += kv_pair.o |
| 78 | ifitobj += valstr.o |
| 79 | # compression algorithms |
| 80 | ifitobj += $(compressionobj) |
| 81 | |
| 82 | |
Patrick Georgi | c88d16b | 2017-01-11 15:26:58 +0100 | [diff] [blame] | 83 | cbfscompobj := |
| 84 | cbfscompobj += $(compressionobj) |
| 85 | cbfscompobj += cbfscomptool.o |
| 86 | |
Marshall Dawson | 30cf155 | 2019-03-19 14:48:33 -0600 | [diff] [blame] | 87 | amdcompobj := |
| 88 | amdcompobj += amdcompress.o |
| 89 | amdcompobj += elfheaders.o |
| 90 | amdcompobj += common.o |
| 91 | amdcompobj += xdr.o |
| 92 | |
Ricardo Quesada | c2cf394 | 2021-07-16 16:49:04 -0700 | [diff] [blame] | 93 | elogobj := |
| 94 | elogobj := elogtool.o |
| 95 | elogobj += eventlog.o |
| 96 | elogobj += valstr.o |
| 97 | elogobj += elog.o |
| 98 | elogobj += common.o |
Edward O'Callaghan | 774dcff | 2022-06-06 20:01:04 +1000 | [diff] [blame] | 99 | elogobj += flashrom.o |
Ricardo Quesada | c2cf394 | 2021-07-16 16:49:04 -0700 | [diff] [blame] | 100 | |
Furquan Shaikh | 796aeeb | 2021-09-16 22:02:01 -0700 | [diff] [blame] | 101 | include $(top)/util/cbfstool/fpt_formats/Makefile.inc |
| 102 | cse_fpt_obj := |
| 103 | cse_fpt_obj += cse_fpt.o |
| 104 | cse_fpt_obj += common.o |
Furquan Shaikh | 555f040 | 2021-10-08 15:18:33 -0700 | [diff] [blame] | 105 | cse_fpt_obj += cse_helpers.o |
Furquan Shaikh | 796aeeb | 2021-09-16 22:02:01 -0700 | [diff] [blame] | 106 | cse_fpt_obj += $(foreach var, $(fpt_formats_obj), $(var)) |
| 107 | |
Furquan Shaikh | d7fb6a9 | 2021-09-16 22:04:11 -0700 | [diff] [blame] | 108 | include $(top)/util/cbfstool/bpdt_formats/Makefile.inc |
| 109 | cse_serger_obj := |
| 110 | cse_serger_obj += cse_serger.o |
| 111 | cse_serger_obj += common.o |
Furquan Shaikh | 555f040 | 2021-10-08 15:18:33 -0700 | [diff] [blame] | 112 | cse_serger_obj += cse_helpers.o |
Furquan Shaikh | d7fb6a9 | 2021-09-16 22:04:11 -0700 | [diff] [blame] | 113 | cse_serger_obj += $(foreach var, $(bpdt_formats_obj), $(var)) |
| 114 | |
Martin Roth | 92f447a | 2021-02-14 14:57:06 -0700 | [diff] [blame] | 115 | TOOLCFLAGS ?= -Werror -Wall -Wextra -Wshadow |
Sol Boucher | 0e53931 | 2015-03-05 15:38:03 -0800 | [diff] [blame] | 116 | TOOLCFLAGS += -Wcast-qual -Wmissing-prototypes -Wredundant-decls -Wshadow |
| 117 | TOOLCFLAGS += -Wstrict-prototypes -Wwrite-strings |
Patrick Georgi | 8474e7d | 2017-01-11 17:17:18 +0100 | [diff] [blame] | 118 | TOOLCFLAGS += -O2 |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 119 | TOOLCPPFLAGS ?= -D_DEFAULT_SOURCE # memccpy() from string.h |
Julius Werner | d6900a9 | 2020-01-29 11:34:44 -0800 | [diff] [blame] | 120 | TOOLCPPFLAGS += -D_BSD_SOURCE -D_SVID_SOURCE # _DEFAULT_SOURCE for older glibc |
Julius Werner | 4bfbabd | 2020-05-06 17:27:02 -0700 | [diff] [blame] | 121 | TOOLCPPFLAGS += -D_GNU_SOURCE # memmem() from string.h |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 122 | TOOLCPPFLAGS += -I$(top)/util/cbfstool/flashmap |
Patrick Georgi | 7b32145 | 2015-05-19 16:43:05 +0200 | [diff] [blame] | 123 | TOOLCPPFLAGS += -I$(top)/util/cbfstool |
| 124 | TOOLCPPFLAGS += -I$(objutil)/cbfstool |
Julius Werner | 98eeb96 | 2019-12-11 15:47:42 -0800 | [diff] [blame] | 125 | TOOLCPPFLAGS += -I$(top)/src/commonlib/include -I$(top)/src/commonlib/bsd/include |
| 126 | TOOLCPPFLAGS += -include $(top)/src/commonlib/bsd/include/commonlib/bsd/compiler.h |
Paul Kocialkowski | 61486b5 | 2016-07-24 12:14:38 +0200 | [diff] [blame] | 127 | TOOLCPPFLAGS += -I$(VBOOT_SOURCE)/firmware/include |
| 128 | TOOLCPPFLAGS += -I$(VBOOT_SOURCE)/firmware/2lib/include |
Julius Werner | d477565 | 2020-03-13 16:43:34 -0700 | [diff] [blame] | 129 | TOOLCPPFLAGS += -I$(VBOOT_SOURCE)/host/include |
Ricardo Quesada | c2cf394 | 2021-07-16 16:49:04 -0700 | [diff] [blame] | 130 | TOOLCPPFLAGS += -I$(VBOOT_SOURCE)/host/lib/include |
Aaron Durbin | 8a414a0 | 2015-10-01 17:02:45 -0500 | [diff] [blame] | 131 | # UEFI header file support. It's not pretty, but that's what we currently |
| 132 | # have right now. |
| 133 | TOOLCPPFLAGS += -I$(top)/src |
| 134 | TOOLCPPFLAGS += -I$(top)/src/vendorcode/intel/edk2/uefi_2.4/MdePkg/Include |
| 135 | |
Paul Menzel | 6548ae9 | 2015-05-03 09:35:32 +0200 | [diff] [blame] | 136 | TOOLLDFLAGS ?= |
Sol Boucher | 0e53931 | 2015-03-05 15:38:03 -0800 | [diff] [blame] | 137 | |
Zheng Bao | c31cdd8 | 2012-10-22 16:39:24 +0800 | [diff] [blame] | 138 | ifeq ($(shell uname -s | cut -c-7 2>/dev/null), MINGW32) |
Patrick Georgi | 3d295a9 | 2023-10-27 21:25:35 +0200 | [diff] [blame] | 139 | HOSTCFLAGS += -fms-extensions |
Patrick Georgi | cdeb1c4 | 2015-09-16 16:19:26 +0200 | [diff] [blame] | 140 | TOOLCFLAGS += -mno-ms-bitfields |
Zheng Bao | c31cdd8 | 2012-10-22 16:39:24 +0800 | [diff] [blame] | 141 | endif |
Stefan Reinauer | 354c11d | 2015-09-15 17:41:07 -0700 | [diff] [blame] | 142 | ifeq ($(shell uname -o 2>/dev/null), Cygwin) |
Julius Werner | 3833f0f | 2019-12-11 22:01:32 -0800 | [diff] [blame] | 143 | TOOLCFLAGS+=-std=gnu11 |
Stefan Reinauer | 354c11d | 2015-09-15 17:41:07 -0700 | [diff] [blame] | 144 | TOOLCPPFLAGS+=-D_GNU_SOURCE |
| 145 | else |
Julius Werner | 3833f0f | 2019-12-11 22:01:32 -0800 | [diff] [blame] | 146 | TOOLCFLAGS+=-std=c11 |
Stefan Reinauer | 354c11d | 2015-09-15 17:41:07 -0700 | [diff] [blame] | 147 | endif |
Zheng Bao | c31cdd8 | 2012-10-22 16:39:24 +0800 | [diff] [blame] | 148 | |
Manoj Gupta | dfb8d80 | 2022-04-27 20:23:11 -0700 | [diff] [blame] | 149 | LZ4CFLAGS ?= -Wno-strict-prototypes |
| 150 | |
Yu-Ping Wu | 0beddb5 | 2020-03-09 10:58:37 +0800 | [diff] [blame] | 151 | VBOOT_HOSTLIB = $(VBOOT_HOST_BUILD)/libvboot_host.a |
| 152 | |
| 153 | $(VBOOT_HOSTLIB): |
| 154 | printf " MAKE $(subst $(objutil)/,,$(@))\n" |
| 155 | unset CFLAGS LDFLAGS; $(MAKE) -C $(VBOOT_SOURCE) \ |
| 156 | BUILD=$(VBOOT_HOST_BUILD) \ |
| 157 | CC="$(HOSTCC)" \ |
Patrick Georgi | c6dd443 | 2020-06-29 21:01:44 +0200 | [diff] [blame] | 158 | PKG_CONFIG="true" \ |
Angel Pons | bb58c1e | 2022-06-18 12:00:33 +0200 | [diff] [blame] | 159 | USE_FLASHROM=0 \ |
Yu-Ping Wu | 0beddb5 | 2020-03-09 10:58:37 +0800 | [diff] [blame] | 160 | V=$(V) \ |
Nico Huber | 6cd4d32 | 2021-06-22 14:31:20 +0000 | [diff] [blame] | 161 | DEBUG= \ |
Yu-Ping Wu | 0beddb5 | 2020-03-09 10:58:37 +0800 | [diff] [blame] | 162 | hostlib |
| 163 | |
Patrick Georgi | 7b32145 | 2015-05-19 16:43:05 +0200 | [diff] [blame] | 164 | $(objutil)/cbfstool/%.o: $(objutil)/cbfstool/%.c |
| 165 | printf " HOSTCC $(subst $(objutil)/,,$(@))\n" |
| 166 | $(HOSTCC) $(TOOLCPPFLAGS) $(TOOLCFLAGS) $(HOSTCFLAGS) -c -o $@ $< |
| 167 | |
Patrick Georgi | a2acbc7 | 2010-04-16 22:48:57 +0000 | [diff] [blame] | 168 | $(objutil)/cbfstool/%.o: $(top)/util/cbfstool/%.c |
| 169 | printf " HOSTCC $(subst $(objutil)/,,$(@))\n" |
Sol Boucher | 0e53931 | 2015-03-05 15:38:03 -0800 | [diff] [blame] | 170 | $(HOSTCC) $(TOOLCPPFLAGS) $(TOOLCFLAGS) $(HOSTCFLAGS) -c -o $@ $< |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 171 | |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 172 | $(objutil)/cbfstool/%.o: $(top)/util/cbfstool/flashmap/%.c |
| 173 | printf " HOSTCC $(subst $(objutil)/,,$(@))\n" |
| 174 | $(HOSTCC) $(TOOLCPPFLAGS) $(TOOLCFLAGS) $(HOSTCFLAGS) -c -o $@ $< |
| 175 | |
Stefan Reinauer | aa3f7ba | 2013-03-28 16:51:45 -0700 | [diff] [blame] | 176 | $(objutil)/cbfstool/%.o: $(top)/util/cbfstool/lzma/%.c |
| 177 | printf " HOSTCC $(subst $(objutil)/,,$(@))\n" |
Sol Boucher | 0e53931 | 2015-03-05 15:38:03 -0800 | [diff] [blame] | 178 | $(HOSTCC) $(TOOLCPPFLAGS) $(TOOLCFLAGS) $(HOSTCFLAGS) -c -o $@ $< |
Patrick Georgi | b7b56dd8 | 2009-09-14 13:29:27 +0000 | [diff] [blame] | 179 | |
Stefan Reinauer | 2e200cd | 2012-10-30 14:02:45 -0700 | [diff] [blame] | 180 | $(objutil)/cbfstool/%.o: $(top)/util/cbfstool/lzma/C/%.c |
Zheng Bao | a182cbd | 2012-12-14 15:44:59 +0800 | [diff] [blame] | 181 | printf " HOSTCC $(subst $(objutil)/,,$(@))\n" |
Sol Boucher | 0e53931 | 2015-03-05 15:38:03 -0800 | [diff] [blame] | 182 | $(HOSTCC) $(TOOLCPPFLAGS) $(TOOLCFLAGS) $(HOSTCFLAGS) -c -o $@ $< |
Patrick Georgi | b7b56dd8 | 2009-09-14 13:29:27 +0000 | [diff] [blame] | 183 | |
Aaron Durbin | 8a414a0 | 2015-10-01 17:02:45 -0500 | [diff] [blame] | 184 | $(objutil)/cbfstool/%.o: $(top)/src/commonlib/%.c |
| 185 | printf " HOSTCC $(subst $(objutil)/,,$(@))\n" |
| 186 | $(HOSTCC) $(TOOLCPPFLAGS) $(TOOLCFLAGS) $(HOSTCFLAGS) -c -o $@ $< |
| 187 | |
Julius Werner | 98eeb96 | 2019-12-11 15:47:42 -0800 | [diff] [blame] | 188 | $(objutil)/cbfstool/%.o: $(top)/src/commonlib/bsd/%.c |
| 189 | printf " HOSTCC $(subst $(objutil)/,,$(@))\n" |
| 190 | $(HOSTCC) $(TOOLCPPFLAGS) $(TOOLCFLAGS) $(HOSTCFLAGS) -c -o $@ $< |
| 191 | |
Julius Werner | 09f2921 | 2015-09-29 13:51:35 -0700 | [diff] [blame] | 192 | $(objutil)/cbfstool/%.o: $(top)/util/cbfstool/lz4/lib/%.c |
| 193 | printf " HOSTCC $(subst $(objutil)/,,$(@))\n" |
Manoj Gupta | dfb8d80 | 2022-04-27 20:23:11 -0700 | [diff] [blame] | 194 | $(HOSTCC) $(TOOLCPPFLAGS) $(TOOLCFLAGS) $(HOSTCFLAGS) $(LZ4CFLAGS) -c -o $@ $< |
Julius Werner | 09f2921 | 2015-09-29 13:51:35 -0700 | [diff] [blame] | 195 | |
Furquan Shaikh | 796aeeb | 2021-09-16 22:02:01 -0700 | [diff] [blame] | 196 | $(objutil)/cbfstool/%.o: $(top)/util/cbfstool/fpt_formats/%.c |
| 197 | printf " HOSTCC $(subst $(objutil)/,,$(@))\n" |
| 198 | $(HOSTCC) $(TOOLCPPFLAGS) $(TOOLCFLAGS) $(HOSTCFLAGS) -c -o $@ $< |
| 199 | |
Furquan Shaikh | d7fb6a9 | 2021-09-16 22:04:11 -0700 | [diff] [blame] | 200 | $(objutil)/cbfstool/%.o: $(top)/util/cbfstool/bpdt_formats/%.c |
| 201 | printf " HOSTCC $(subst $(objutil)/,,$(@))\n" |
| 202 | $(HOSTCC) $(TOOLCPPFLAGS) $(TOOLCFLAGS) $(HOSTCFLAGS) -c -o $@ $< |
| 203 | |
Yu-Ping Wu | 0beddb5 | 2020-03-09 10:58:37 +0800 | [diff] [blame] | 204 | $(objutil)/cbfstool/cbfstool: $(addprefix $(objutil)/cbfstool/,$(cbfsobj)) $(VBOOT_HOSTLIB) |
Stefan Reinauer | aa3f7ba | 2013-03-28 16:51:45 -0700 | [diff] [blame] | 205 | printf " HOSTCC $(subst $(objutil)/,,$(@)) (link)\n" |
Yu-Ping Wu | 0beddb5 | 2020-03-09 10:58:37 +0800 | [diff] [blame] | 206 | $(HOSTCC) -v $(TOOLLDFLAGS) -o $@ $(addprefix $(objutil)/cbfstool/,$(cbfsobj)) $(VBOOT_HOSTLIB) |
Aaron Durbin | 4fde5a6 | 2014-03-07 15:11:53 -0600 | [diff] [blame] | 207 | |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 208 | $(objutil)/cbfstool/fmaptool: $(addprefix $(objutil)/cbfstool/,$(fmapobj)) |
| 209 | printf " HOSTCC $(subst $(objutil)/,,$(@)) (link)\n" |
| 210 | $(HOSTCC) $(TOOLLDFLAGS) -o $@ $(addprefix $(objutil)/cbfstool/,$(fmapobj)) |
| 211 | |
Patrick Georgi | 913e171 | 2014-07-15 12:28:12 +0200 | [diff] [blame] | 212 | $(objutil)/cbfstool/rmodtool: $(addprefix $(objutil)/cbfstool/,$(rmodobj)) |
Aaron Durbin | 4fde5a6 | 2014-03-07 15:11:53 -0600 | [diff] [blame] | 213 | printf " HOSTCC $(subst $(objutil)/,,$(@)) (link)\n" |
Paul Menzel | 6548ae9 | 2015-05-03 09:35:32 +0200 | [diff] [blame] | 214 | $(HOSTCC) $(TOOLLDFLAGS) -o $@ $(addprefix $(objutil)/cbfstool/,$(rmodobj)) |
Sol Boucher | 0e53931 | 2015-03-05 15:38:03 -0800 | [diff] [blame] | 215 | |
Furquan Shaikh | 233f1b6 | 2016-05-19 16:12:16 -0700 | [diff] [blame] | 216 | $(objutil)/cbfstool/ifwitool: $(addprefix $(objutil)/cbfstool/,$(ifwiobj)) |
| 217 | printf " HOSTCC $(subst $(objutil)/,,$(@)) (link)\n" |
| 218 | $(HOSTCC) $(TOOLLDFLAGS) -o $@ $(addprefix $(objutil)/cbfstool/,$(ifwiobj)) |
| 219 | |
Yu-Ping Wu | 0beddb5 | 2020-03-09 10:58:37 +0800 | [diff] [blame] | 220 | $(objutil)/cbfstool/ifittool: $(addprefix $(objutil)/cbfstool/,$(ifitobj)) $(VBOOT_HOSTLIB) |
Philipp Deppenwiese | 5ada002 | 2018-11-20 13:54:49 +0100 | [diff] [blame] | 221 | printf " HOSTCC $(subst $(objutil)/,,$(@)) (link)\n" |
Yu-Ping Wu | 0beddb5 | 2020-03-09 10:58:37 +0800 | [diff] [blame] | 222 | $(HOSTCC) $(TOOLLDFLAGS) -o $@ $(addprefix $(objutil)/cbfstool/,$(ifitobj)) $(VBOOT_HOSTLIB) |
Philipp Deppenwiese | 5ada002 | 2018-11-20 13:54:49 +0100 | [diff] [blame] | 223 | |
Patrick Georgi | c88d16b | 2017-01-11 15:26:58 +0100 | [diff] [blame] | 224 | $(objutil)/cbfstool/cbfs-compression-tool: $(addprefix $(objutil)/cbfstool/,$(cbfscompobj)) |
| 225 | printf " HOSTCC $(subst $(objutil)/,,$(@)) (link)\n" |
| 226 | $(HOSTCC) $(TOOLLDFLAGS) -o $@ $(addprefix $(objutil)/cbfstool/,$(cbfscompobj)) |
| 227 | |
Marshall Dawson | 30cf155 | 2019-03-19 14:48:33 -0600 | [diff] [blame] | 228 | $(objutil)/cbfstool/amdcompress: $(addprefix $(objutil)/cbfstool/,$(amdcompobj)) |
| 229 | printf " HOSTCC $(subst $(objutil)/,,$(@)) (link)\n" |
| 230 | $(HOSTCC) $(TOOLLDFLAGS) -o $@ $(addprefix $(objutil)/cbfstool/,$(amdcompobj)) -lz |
| 231 | |
Martin Roth | e3e965b | 2022-02-25 17:28:04 -0700 | [diff] [blame] | 232 | $(objutil)/cbfstool/elogtool: $(addprefix $(objutil)/cbfstool/,$(elogobj)) $(VBOOT_HOSTLIB) |
Ricardo Quesada | c2cf394 | 2021-07-16 16:49:04 -0700 | [diff] [blame] | 233 | printf " HOSTCC $(subst $(objutil)/,,$(@)) (link)\n" |
Martin Roth | e3e965b | 2022-02-25 17:28:04 -0700 | [diff] [blame] | 234 | $(HOSTCC) $(TOOLLDFLAGS) -o $@ $(addprefix $(objutil)/cbfstool/,$(elogobj)) $(VBOOT_HOSTLIB) |
Ricardo Quesada | c2cf394 | 2021-07-16 16:49:04 -0700 | [diff] [blame] | 235 | |
Furquan Shaikh | 796aeeb | 2021-09-16 22:02:01 -0700 | [diff] [blame] | 236 | $(objutil)/cbfstool/cse_fpt: $(addprefix $(objutil)/cbfstool/,$(cse_fpt_obj)) |
| 237 | printf " HOSTCC $(subst $(objutil)/,,$(@)) (link)\n" |
| 238 | $(HOSTCC) $(TOOLLDFLAGS) -o $@ $(addprefix $(objutil)/cbfstool/,$(cse_fpt_obj)) |
| 239 | |
Furquan Shaikh | d7fb6a9 | 2021-09-16 22:04:11 -0700 | [diff] [blame] | 240 | $(objutil)/cbfstool/cse_serger: $(addprefix $(objutil)/cbfstool/,$(cse_serger_obj)) |
| 241 | printf " HOSTCC $(subst $(objutil)/,,$(@)) (link)\n" |
| 242 | $(HOSTCC) $(TOOLLDFLAGS) -o $@ $(addprefix $(objutil)/cbfstool/,$(cse_serger_obj)) |
| 243 | |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 244 | # Yacc source is superset of header |
Kyösti Mälkki | c877149 | 2015-05-09 08:06:02 +0300 | [diff] [blame] | 245 | $(objutil)/cbfstool/fmd.o: TOOLCFLAGS += -Wno-redundant-decls |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 246 | $(objutil)/cbfstool/fmd_parser.o: TOOLCFLAGS += -Wno-redundant-decls |
Kyösti Mälkki | c877149 | 2015-05-09 08:06:02 +0300 | [diff] [blame] | 247 | # Lex generates unneeded functions and declarations |
| 248 | $(objutil)/cbfstool/fmd_scanner.o: TOOLCFLAGS += -Wno-redundant-decls |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 249 | $(objutil)/cbfstool/fmd_scanner.o: TOOLCFLAGS += -Wno-unused-function |
Sol Boucher | 0e53931 | 2015-03-05 15:38:03 -0800 | [diff] [blame] | 250 | # Tolerate lzma sdk warnings |
| 251 | $(objutil)/cbfstool/LzmaEnc.o: TOOLCFLAGS += -Wno-sign-compare -Wno-cast-qual |
Julius Werner | 4bfbabd | 2020-05-06 17:27:02 -0700 | [diff] [blame] | 252 | # Tolerate commonlib warnings |
| 253 | $(objutil)/cbfstool/cbfs_private.o: TOOLCFLAGS += -Wno-sign-compare |
Julius Werner | 09f2921 | 2015-09-29 13:51:35 -0700 | [diff] [blame] | 254 | # Tolerate lz4 warnings |
| 255 | $(objutil)/cbfstool/lz4.o: TOOLCFLAGS += -Wno-missing-prototypes |
Nico Huber | 591dbfe | 2019-12-14 20:44:47 +0100 | [diff] [blame] | 256 | $(objutil)/cbfstool/lz4_wrapper.o: TOOLCFLAGS += -Wno-attributes |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 257 | |
Patrick Georgi | 7b32145 | 2015-05-19 16:43:05 +0200 | [diff] [blame] | 258 | $(objutil)/cbfstool/fmd.o: $(objutil)/cbfstool/fmd_parser.h |
| 259 | $(objutil)/cbfstool/fmd.o: $(objutil)/cbfstool/fmd_scanner.h |
Kyösti Mälkki | d32b273 | 2015-05-15 09:27:34 +0300 | [diff] [blame] | 260 | $(objutil)/cbfstool/fmd_parser.o: $(objutil)/cbfstool/fmd.o |
| 261 | $(objutil)/cbfstool/fmd_scanner.o: $(objutil)/cbfstool/fmd.o |
Patrick Georgi | 2b80734 | 2016-06-28 20:45:34 +0200 | [diff] [blame] | 262 | $(objutil)/cbfstool/fmd_scanner.o: TOOLCFLAGS += -Wno-sign-compare |
Kyösti Mälkki | d32b273 | 2015-05-15 09:27:34 +0300 | [diff] [blame] | 263 | |
Patrick Georgi | 7b32145 | 2015-05-19 16:43:05 +0200 | [diff] [blame] | 264 | $(objutil)/cbfstool/%: $(top)/util/cbfstool/%_shipped |
Kyösti Mälkki | d32b273 | 2015-05-15 09:27:34 +0300 | [diff] [blame] | 265 | mkdir -p $(dir $@) |
| 266 | cp $< $@ |
| 267 | |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 268 | ifeq ($(CONFIG_FMD_GENPARSER),y) |
| 269 | TOOLLEX := lex |
Hung-Te Lin | 8cb45aa | 2023-06-15 15:26:40 +0800 | [diff] [blame] | 270 | TOOLYACC := bison |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 271 | |
Kyösti Mälkki | d32b273 | 2015-05-15 09:27:34 +0300 | [diff] [blame] | 272 | # the .c rule also creates .h |
| 273 | $(top)/util/cbfstool/fmd_scanner.h_shipped: $(top)/util/cbfstool/fmd_scanner.c_shipped |
| 274 | $(top)/util/cbfstool/fmd_scanner.c_shipped: $(top)/util/cbfstool/fmd_scanner.l |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 275 | echo " LEX util/cbfstool/fmd_scanner.[ch]" |
Hung-Te Lin | 8cb45aa | 2023-06-15 15:26:40 +0800 | [diff] [blame] | 276 | $(TOOLLEX) -L -o $@ --header-file=$(patsubst %.c_shipped,%.h_shipped,$@) $< |
Kyösti Mälkki | d32b273 | 2015-05-15 09:27:34 +0300 | [diff] [blame] | 277 | |
| 278 | # the .c rule also creates .h |
| 279 | $(top)/util/cbfstool/fmd_parser.h_shipped: $(top)/util/cbfstool/fmd_parser.c_shipped |
| 280 | $(top)/util/cbfstool/fmd_parser.c_shipped: $(top)/util/cbfstool/fmd_parser.y |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 281 | echo " YACC util/cbfstool/fmd_parser.[ch]" |
Hung-Te Lin | 8cb45aa | 2023-06-15 15:26:40 +0800 | [diff] [blame] | 282 | $(TOOLYACC) -l -o $@ --defines=$(patsubst %.c_shipped,%.h_shipped,$@) $< |
Kyösti Mälkki | d32b273 | 2015-05-15 09:27:34 +0300 | [diff] [blame] | 283 | |
| 284 | endif # CONFIG_FMD_GENPARSER |