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 | 09f2921 | 2015-09-29 13:51:35 -0700 | [diff] [blame] | 25 | # COMMONLIB |
| 26 | cbfsobj += cbfs.o |
Furquan Shaikh | b0c2fe0 | 2016-05-09 12:23:01 -0700 | [diff] [blame] | 27 | cbfsobj += fsp_relocate.o |
Julius Werner | 09f2921 | 2015-09-29 13:51:35 -0700 | [diff] [blame] | 28 | cbfsobj += mem_pool.o |
| 29 | cbfsobj += region.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 |
| 75 | # COMMONLIB |
| 76 | ifitobj += cbfs.o |
| 77 | ifitobj += mem_pool.o |
| 78 | ifitobj += region.o |
Philipp Deppenwiese | 5ada002 | 2018-11-20 13:54:49 +0100 | [diff] [blame] | 79 | # FMAP |
| 80 | ifitobj += fmap.o |
| 81 | ifitobj += kv_pair.o |
| 82 | ifitobj += valstr.o |
| 83 | # compression algorithms |
| 84 | ifitobj += $(compressionobj) |
| 85 | |
| 86 | |
Patrick Georgi | c88d16b | 2017-01-11 15:26:58 +0100 | [diff] [blame] | 87 | cbfscompobj := |
| 88 | cbfscompobj += $(compressionobj) |
| 89 | cbfscompobj += cbfscomptool.o |
| 90 | |
Marshall Dawson | 30cf155 | 2019-03-19 14:48:33 -0600 | [diff] [blame] | 91 | amdcompobj := |
| 92 | amdcompobj += amdcompress.o |
| 93 | amdcompobj += elfheaders.o |
| 94 | amdcompobj += common.o |
| 95 | amdcompobj += xdr.o |
| 96 | |
Stefan Reinauer | 354c11d | 2015-09-15 17:41:07 -0700 | [diff] [blame] | 97 | TOOLCFLAGS ?= -Werror -Wall -Wextra |
Sol Boucher | 0e53931 | 2015-03-05 15:38:03 -0800 | [diff] [blame] | 98 | TOOLCFLAGS += -Wcast-qual -Wmissing-prototypes -Wredundant-decls -Wshadow |
| 99 | TOOLCFLAGS += -Wstrict-prototypes -Wwrite-strings |
Patrick Georgi | 8474e7d | 2017-01-11 17:17:18 +0100 | [diff] [blame] | 100 | TOOLCFLAGS += -O2 |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 101 | TOOLCPPFLAGS ?= -D_DEFAULT_SOURCE # memccpy() from string.h |
Julius Werner | d6900a9 | 2020-01-29 11:34:44 -0800 | [diff] [blame] | 102 | TOOLCPPFLAGS += -D_BSD_SOURCE -D_SVID_SOURCE # _DEFAULT_SOURCE for older glibc |
Jonathan A. Kollasch | 9d6a17b | 2015-07-06 08:29:00 -0500 | [diff] [blame] | 103 | TOOLCPPFLAGS += -D_XOPEN_SOURCE=700 # strdup() from string.h |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 104 | TOOLCPPFLAGS += -I$(top)/util/cbfstool/flashmap |
Patrick Georgi | 7b32145 | 2015-05-19 16:43:05 +0200 | [diff] [blame] | 105 | TOOLCPPFLAGS += -I$(top)/util/cbfstool |
| 106 | TOOLCPPFLAGS += -I$(objutil)/cbfstool |
Julius Werner | 98eeb96 | 2019-12-11 15:47:42 -0800 | [diff] [blame] | 107 | TOOLCPPFLAGS += -I$(top)/src/commonlib/include -I$(top)/src/commonlib/bsd/include |
| 108 | TOOLCPPFLAGS += -include $(top)/src/commonlib/bsd/include/commonlib/bsd/compiler.h |
Paul Kocialkowski | 61486b5 | 2016-07-24 12:14:38 +0200 | [diff] [blame] | 109 | TOOLCPPFLAGS += -I$(VBOOT_SOURCE)/firmware/include |
| 110 | TOOLCPPFLAGS += -I$(VBOOT_SOURCE)/firmware/2lib/include |
Aaron Durbin | 8a414a0 | 2015-10-01 17:02:45 -0500 | [diff] [blame] | 111 | # UEFI header file support. It's not pretty, but that's what we currently |
| 112 | # have right now. |
| 113 | TOOLCPPFLAGS += -I$(top)/src |
| 114 | TOOLCPPFLAGS += -I$(top)/src/vendorcode/intel/edk2/uefi_2.4/MdePkg/Include |
| 115 | |
Paul Menzel | 6548ae9 | 2015-05-03 09:35:32 +0200 | [diff] [blame] | 116 | TOOLLDFLAGS ?= |
Werner Zeh | 8c3780a | 2015-10-02 09:56:32 +0200 | [diff] [blame] | 117 | HOSTCFLAGS += -fms-extensions |
Sol Boucher | 0e53931 | 2015-03-05 15:38:03 -0800 | [diff] [blame] | 118 | |
Zheng Bao | c31cdd8 | 2012-10-22 16:39:24 +0800 | [diff] [blame] | 119 | ifeq ($(shell uname -s | cut -c-7 2>/dev/null), MINGW32) |
Patrick Georgi | cdeb1c4 | 2015-09-16 16:19:26 +0200 | [diff] [blame] | 120 | TOOLCFLAGS += -mno-ms-bitfields |
Zheng Bao | c31cdd8 | 2012-10-22 16:39:24 +0800 | [diff] [blame] | 121 | endif |
Stefan Reinauer | 354c11d | 2015-09-15 17:41:07 -0700 | [diff] [blame] | 122 | ifeq ($(shell uname -o 2>/dev/null), Cygwin) |
Julius Werner | 3833f0f | 2019-12-11 22:01:32 -0800 | [diff] [blame] | 123 | TOOLCFLAGS+=-std=gnu11 |
Stefan Reinauer | 354c11d | 2015-09-15 17:41:07 -0700 | [diff] [blame] | 124 | TOOLCPPFLAGS+=-D_GNU_SOURCE |
| 125 | else |
Julius Werner | 3833f0f | 2019-12-11 22:01:32 -0800 | [diff] [blame] | 126 | TOOLCFLAGS+=-std=c11 |
Stefan Reinauer | 354c11d | 2015-09-15 17:41:07 -0700 | [diff] [blame] | 127 | endif |
Zheng Bao | c31cdd8 | 2012-10-22 16:39:24 +0800 | [diff] [blame] | 128 | |
Yu-Ping Wu | 0beddb5 | 2020-03-09 10:58:37 +0800 | [diff] [blame] | 129 | VBOOT_HOSTLIB = $(VBOOT_HOST_BUILD)/libvboot_host.a |
| 130 | |
| 131 | $(VBOOT_HOSTLIB): |
| 132 | printf " MAKE $(subst $(objutil)/,,$(@))\n" |
| 133 | unset CFLAGS LDFLAGS; $(MAKE) -C $(VBOOT_SOURCE) \ |
| 134 | BUILD=$(VBOOT_HOST_BUILD) \ |
| 135 | CC="$(HOSTCC)" \ |
| 136 | $(if $(HOSTPKGCONFIG), PKG_CONFIG="$(HOSTPKGCONFIG)") \ |
| 137 | V=$(V) \ |
| 138 | hostlib |
| 139 | |
Patrick Georgi | 7b32145 | 2015-05-19 16:43:05 +0200 | [diff] [blame] | 140 | $(objutil)/cbfstool/%.o: $(objutil)/cbfstool/%.c |
| 141 | printf " HOSTCC $(subst $(objutil)/,,$(@))\n" |
| 142 | $(HOSTCC) $(TOOLCPPFLAGS) $(TOOLCFLAGS) $(HOSTCFLAGS) -c -o $@ $< |
| 143 | |
Patrick Georgi | a2acbc7 | 2010-04-16 22:48:57 +0000 | [diff] [blame] | 144 | $(objutil)/cbfstool/%.o: $(top)/util/cbfstool/%.c |
| 145 | printf " HOSTCC $(subst $(objutil)/,,$(@))\n" |
Sol Boucher | 0e53931 | 2015-03-05 15:38:03 -0800 | [diff] [blame] | 146 | $(HOSTCC) $(TOOLCPPFLAGS) $(TOOLCFLAGS) $(HOSTCFLAGS) -c -o $@ $< |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 147 | |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 148 | $(objutil)/cbfstool/%.o: $(top)/util/cbfstool/flashmap/%.c |
| 149 | printf " HOSTCC $(subst $(objutil)/,,$(@))\n" |
| 150 | $(HOSTCC) $(TOOLCPPFLAGS) $(TOOLCFLAGS) $(HOSTCFLAGS) -c -o $@ $< |
| 151 | |
Stefan Reinauer | aa3f7ba | 2013-03-28 16:51:45 -0700 | [diff] [blame] | 152 | $(objutil)/cbfstool/%.o: $(top)/util/cbfstool/lzma/%.c |
| 153 | printf " HOSTCC $(subst $(objutil)/,,$(@))\n" |
Sol Boucher | 0e53931 | 2015-03-05 15:38:03 -0800 | [diff] [blame] | 154 | $(HOSTCC) $(TOOLCPPFLAGS) $(TOOLCFLAGS) $(HOSTCFLAGS) -c -o $@ $< |
Patrick Georgi | b7b56dd8 | 2009-09-14 13:29:27 +0000 | [diff] [blame] | 155 | |
Stefan Reinauer | 2e200cd | 2012-10-30 14:02:45 -0700 | [diff] [blame] | 156 | $(objutil)/cbfstool/%.o: $(top)/util/cbfstool/lzma/C/%.c |
Zheng Bao | a182cbd | 2012-12-14 15:44:59 +0800 | [diff] [blame] | 157 | printf " HOSTCC $(subst $(objutil)/,,$(@))\n" |
Sol Boucher | 0e53931 | 2015-03-05 15:38:03 -0800 | [diff] [blame] | 158 | $(HOSTCC) $(TOOLCPPFLAGS) $(TOOLCFLAGS) $(HOSTCFLAGS) -c -o $@ $< |
Patrick Georgi | b7b56dd8 | 2009-09-14 13:29:27 +0000 | [diff] [blame] | 159 | |
Aaron Durbin | 8a414a0 | 2015-10-01 17:02:45 -0500 | [diff] [blame] | 160 | $(objutil)/cbfstool/%.o: $(top)/src/commonlib/%.c |
| 161 | printf " HOSTCC $(subst $(objutil)/,,$(@))\n" |
| 162 | $(HOSTCC) $(TOOLCPPFLAGS) $(TOOLCFLAGS) $(HOSTCFLAGS) -c -o $@ $< |
| 163 | |
Julius Werner | 98eeb96 | 2019-12-11 15:47:42 -0800 | [diff] [blame] | 164 | $(objutil)/cbfstool/%.o: $(top)/src/commonlib/bsd/%.c |
| 165 | printf " HOSTCC $(subst $(objutil)/,,$(@))\n" |
| 166 | $(HOSTCC) $(TOOLCPPFLAGS) $(TOOLCFLAGS) $(HOSTCFLAGS) -c -o $@ $< |
| 167 | |
Julius Werner | 09f2921 | 2015-09-29 13:51:35 -0700 | [diff] [blame] | 168 | $(objutil)/cbfstool/%.o: $(top)/util/cbfstool/lz4/lib/%.c |
| 169 | printf " HOSTCC $(subst $(objutil)/,,$(@))\n" |
Nico Huber | d44221f | 2018-10-04 23:42:42 +0200 | [diff] [blame] | 170 | $(HOSTCC) $(TOOLCPPFLAGS) $(TOOLCFLAGS) $(HOSTCFLAGS) -c -o $@ $< |
Julius Werner | 09f2921 | 2015-09-29 13:51:35 -0700 | [diff] [blame] | 171 | |
Yu-Ping Wu | 0beddb5 | 2020-03-09 10:58:37 +0800 | [diff] [blame] | 172 | $(objutil)/cbfstool/cbfstool: $(addprefix $(objutil)/cbfstool/,$(cbfsobj)) $(VBOOT_HOSTLIB) |
Stefan Reinauer | aa3f7ba | 2013-03-28 16:51:45 -0700 | [diff] [blame] | 173 | printf " HOSTCC $(subst $(objutil)/,,$(@)) (link)\n" |
Yu-Ping Wu | 0beddb5 | 2020-03-09 10:58:37 +0800 | [diff] [blame] | 174 | $(HOSTCC) -v $(TOOLLDFLAGS) -o $@ $(addprefix $(objutil)/cbfstool/,$(cbfsobj)) $(VBOOT_HOSTLIB) |
Aaron Durbin | 4fde5a6 | 2014-03-07 15:11:53 -0600 | [diff] [blame] | 175 | |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 176 | $(objutil)/cbfstool/fmaptool: $(addprefix $(objutil)/cbfstool/,$(fmapobj)) |
| 177 | printf " HOSTCC $(subst $(objutil)/,,$(@)) (link)\n" |
| 178 | $(HOSTCC) $(TOOLLDFLAGS) -o $@ $(addprefix $(objutil)/cbfstool/,$(fmapobj)) |
| 179 | |
Patrick Georgi | 913e171 | 2014-07-15 12:28:12 +0200 | [diff] [blame] | 180 | $(objutil)/cbfstool/rmodtool: $(addprefix $(objutil)/cbfstool/,$(rmodobj)) |
Aaron Durbin | 4fde5a6 | 2014-03-07 15:11:53 -0600 | [diff] [blame] | 181 | printf " HOSTCC $(subst $(objutil)/,,$(@)) (link)\n" |
Paul Menzel | 6548ae9 | 2015-05-03 09:35:32 +0200 | [diff] [blame] | 182 | $(HOSTCC) $(TOOLLDFLAGS) -o $@ $(addprefix $(objutil)/cbfstool/,$(rmodobj)) |
Sol Boucher | 0e53931 | 2015-03-05 15:38:03 -0800 | [diff] [blame] | 183 | |
Furquan Shaikh | 233f1b6 | 2016-05-19 16:12:16 -0700 | [diff] [blame] | 184 | $(objutil)/cbfstool/ifwitool: $(addprefix $(objutil)/cbfstool/,$(ifwiobj)) |
| 185 | printf " HOSTCC $(subst $(objutil)/,,$(@)) (link)\n" |
| 186 | $(HOSTCC) $(TOOLLDFLAGS) -o $@ $(addprefix $(objutil)/cbfstool/,$(ifwiobj)) |
| 187 | |
Yu-Ping Wu | 0beddb5 | 2020-03-09 10:58:37 +0800 | [diff] [blame] | 188 | $(objutil)/cbfstool/ifittool: $(addprefix $(objutil)/cbfstool/,$(ifitobj)) $(VBOOT_HOSTLIB) |
Philipp Deppenwiese | 5ada002 | 2018-11-20 13:54:49 +0100 | [diff] [blame] | 189 | printf " HOSTCC $(subst $(objutil)/,,$(@)) (link)\n" |
Yu-Ping Wu | 0beddb5 | 2020-03-09 10:58:37 +0800 | [diff] [blame] | 190 | $(HOSTCC) $(TOOLLDFLAGS) -o $@ $(addprefix $(objutil)/cbfstool/,$(ifitobj)) $(VBOOT_HOSTLIB) |
Philipp Deppenwiese | 5ada002 | 2018-11-20 13:54:49 +0100 | [diff] [blame] | 191 | |
Patrick Georgi | c88d16b | 2017-01-11 15:26:58 +0100 | [diff] [blame] | 192 | $(objutil)/cbfstool/cbfs-compression-tool: $(addprefix $(objutil)/cbfstool/,$(cbfscompobj)) |
| 193 | printf " HOSTCC $(subst $(objutil)/,,$(@)) (link)\n" |
| 194 | $(HOSTCC) $(TOOLLDFLAGS) -o $@ $(addprefix $(objutil)/cbfstool/,$(cbfscompobj)) |
| 195 | |
Marshall Dawson | 30cf155 | 2019-03-19 14:48:33 -0600 | [diff] [blame] | 196 | $(objutil)/cbfstool/amdcompress: $(addprefix $(objutil)/cbfstool/,$(amdcompobj)) |
| 197 | printf " HOSTCC $(subst $(objutil)/,,$(@)) (link)\n" |
| 198 | $(HOSTCC) $(TOOLLDFLAGS) -o $@ $(addprefix $(objutil)/cbfstool/,$(amdcompobj)) -lz |
| 199 | |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 200 | # Yacc source is superset of header |
Kyösti Mälkki | c877149 | 2015-05-09 08:06:02 +0300 | [diff] [blame] | 201 | $(objutil)/cbfstool/fmd.o: TOOLCFLAGS += -Wno-redundant-decls |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 202 | $(objutil)/cbfstool/fmd_parser.o: TOOLCFLAGS += -Wno-redundant-decls |
Kyösti Mälkki | c877149 | 2015-05-09 08:06:02 +0300 | [diff] [blame] | 203 | # Lex generates unneeded functions and declarations |
| 204 | $(objutil)/cbfstool/fmd_scanner.o: TOOLCFLAGS += -Wno-redundant-decls |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 205 | $(objutil)/cbfstool/fmd_scanner.o: TOOLCFLAGS += -Wno-unused-function |
Sol Boucher | 0e53931 | 2015-03-05 15:38:03 -0800 | [diff] [blame] | 206 | # Tolerate lzma sdk warnings |
| 207 | $(objutil)/cbfstool/LzmaEnc.o: TOOLCFLAGS += -Wno-sign-compare -Wno-cast-qual |
Aaron Durbin | 272a1f0 | 2015-12-15 18:00:30 -0600 | [diff] [blame] | 208 | # Tolerate commonlib warnings |
| 209 | $(objutil)/cbfstool/region.o: TOOLCFLAGS += -Wno-sign-compare -Wno-cast-qual |
| 210 | $(objutil)/cbfstool/cbfs.o: TOOLCFLAGS += -Wno-sign-compare -Wno-cast-qual |
| 211 | $(objutil)/cbfstool/mem_pool.o: TOOLCFLAGS += -Wno-sign-compare -Wno-cast-qual |
Julius Werner | 09f2921 | 2015-09-29 13:51:35 -0700 | [diff] [blame] | 212 | # Tolerate lz4 warnings |
| 213 | $(objutil)/cbfstool/lz4.o: TOOLCFLAGS += -Wno-missing-prototypes |
Nico Huber | 591dbfe | 2019-12-14 20:44:47 +0100 | [diff] [blame] | 214 | $(objutil)/cbfstool/lz4_wrapper.o: TOOLCFLAGS += -Wno-attributes |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 215 | |
Patrick Georgi | 7b32145 | 2015-05-19 16:43:05 +0200 | [diff] [blame] | 216 | $(objutil)/cbfstool/fmd.o: $(objutil)/cbfstool/fmd_parser.h |
| 217 | $(objutil)/cbfstool/fmd.o: $(objutil)/cbfstool/fmd_scanner.h |
Kyösti Mälkki | d32b273 | 2015-05-15 09:27:34 +0300 | [diff] [blame] | 218 | $(objutil)/cbfstool/fmd_parser.o: $(objutil)/cbfstool/fmd.o |
| 219 | $(objutil)/cbfstool/fmd_scanner.o: $(objutil)/cbfstool/fmd.o |
Patrick Georgi | 2b80734 | 2016-06-28 20:45:34 +0200 | [diff] [blame] | 220 | $(objutil)/cbfstool/fmd_scanner.o: TOOLCFLAGS += -Wno-sign-compare |
Kyösti Mälkki | d32b273 | 2015-05-15 09:27:34 +0300 | [diff] [blame] | 221 | |
Patrick Georgi | 7b32145 | 2015-05-19 16:43:05 +0200 | [diff] [blame] | 222 | $(objutil)/cbfstool/%: $(top)/util/cbfstool/%_shipped |
Kyösti Mälkki | d32b273 | 2015-05-15 09:27:34 +0300 | [diff] [blame] | 223 | mkdir -p $(dir $@) |
| 224 | cp $< $@ |
| 225 | |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 226 | ifeq ($(CONFIG_FMD_GENPARSER),y) |
| 227 | TOOLLEX := lex |
| 228 | TOOLYACC := yacc |
| 229 | |
Kyösti Mälkki | d32b273 | 2015-05-15 09:27:34 +0300 | [diff] [blame] | 230 | # the .c rule also creates .h |
| 231 | $(top)/util/cbfstool/fmd_scanner.h_shipped: $(top)/util/cbfstool/fmd_scanner.c_shipped |
| 232 | $(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] | 233 | echo " LEX util/cbfstool/fmd_scanner.[ch]" |
Kyösti Mälkki | d32b273 | 2015-05-15 09:27:34 +0300 | [diff] [blame] | 234 | $(TOOLLEX) -t --header-file=$(top)/util/cbfstool/fmd_scanner.h_shipped $< >$(top)/util/cbfstool/fmd_scanner.c_shipped |
| 235 | |
| 236 | # the .c rule also creates .h |
| 237 | $(top)/util/cbfstool/fmd_parser.h_shipped: $(top)/util/cbfstool/fmd_parser.c_shipped |
| 238 | $(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] | 239 | echo " YACC util/cbfstool/fmd_parser.[ch]" |
| 240 | $(TOOLYACC) -d $< |
Kyösti Mälkki | d32b273 | 2015-05-15 09:27:34 +0300 | [diff] [blame] | 241 | mv -f y.tab.c $(top)/util/cbfstool/fmd_parser.c_shipped |
| 242 | mv -f y.tab.h $(top)/util/cbfstool/fmd_parser.h_shipped |
| 243 | |
| 244 | endif # CONFIG_FMD_GENPARSER |