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