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