Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 1 | cbfsobj := |
Stefan Reinauer | 2e200cd | 2012-10-30 14:02:45 -0700 | [diff] [blame] | 2 | cbfsobj += cbfstool.o |
Patrick Georgi | b7b56dd8 | 2009-09-14 13:29:27 +0000 | [diff] [blame] | 3 | cbfsobj += common.o |
| 4 | cbfsobj += compress.o |
Hung-Te Lin | eab2c81 | 2013-01-29 01:56:17 +0800 | [diff] [blame] | 5 | cbfsobj += cbfs_image.o |
Patrick Georgi | b7b56dd8 | 2009-09-14 13:29:27 +0000 | [diff] [blame] | 6 | cbfsobj += cbfs-mkstage.o |
| 7 | cbfsobj += cbfs-mkpayload.o |
Ronald G. Minnich | a8a133d | 2013-12-30 13:16:18 -0800 | [diff] [blame] | 8 | cbfsobj += elfheaders.o |
Aaron Durbin | 4be1674 | 2015-09-15 17:00:23 -0500 | [diff] [blame] | 9 | cbfsobj += rmodule.o |
Ronald G. Minnich | aa2f739 | 2013-12-03 11:13:35 -0800 | [diff] [blame] | 10 | cbfsobj += xdr.o |
Aaron Durbin | 6b0d0d6 | 2012-12-14 17:16:21 -0600 | [diff] [blame] | 11 | cbfsobj += fit.o |
Sol Boucher | e3260a0 | 2015-03-25 13:40:08 -0700 | [diff] [blame] | 12 | cbfsobj += partitioned_file.o |
Stefan Reinauer | 2e200cd | 2012-10-30 14:02:45 -0700 | [diff] [blame] | 13 | # LZMA |
| 14 | cbfsobj += lzma.o |
| 15 | cbfsobj += LzFind.o |
| 16 | cbfsobj += LzmaDec.o |
| 17 | cbfsobj += LzmaEnc.o |
Patrick Georgi | 89f2034 | 2015-10-01 15:54:04 +0200 | [diff] [blame] | 18 | # CRYPTOLIB |
| 19 | cbfsobj += 2sha_utility.o |
| 20 | cbfsobj += 2sha1.o |
| 21 | cbfsobj += 2sha256.o |
| 22 | cbfsobj += 2sha512.o |
Sol Boucher | e3260a0 | 2015-03-25 13:40:08 -0700 | [diff] [blame] | 23 | # FMAP |
| 24 | cbfsobj += fmap.o |
| 25 | cbfsobj += kv_pair.o |
| 26 | cbfsobj += valstr.o |
Patrick Georgi | de36d33 | 2013-08-27 20:22:21 +0200 | [diff] [blame] | 27 | # linux as payload |
| 28 | cbfsobj += linux_trampoline.o |
| 29 | cbfsobj += cbfs-payload-linux.o |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 30 | |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 31 | fmapobj := |
| 32 | fmapobj += fmaptool.o |
Sol Boucher | 023e829 | 2015-03-18 10:13:48 -0700 | [diff] [blame] | 33 | fmapobj += cbfs_sections.o |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 34 | fmapobj += fmap_from_fmd.o |
| 35 | fmapobj += fmd.o |
| 36 | fmapobj += fmd_parser.o |
| 37 | fmapobj += fmd_scanner.o |
| 38 | # FMAP |
| 39 | fmapobj += fmap.o |
| 40 | fmapobj += kv_pair.o |
| 41 | fmapobj += valstr.o |
| 42 | |
Sol Boucher | 0e53931 | 2015-03-05 15:38:03 -0800 | [diff] [blame] | 43 | rmodobj := |
Aaron Durbin | 4fde5a6 | 2014-03-07 15:11:53 -0600 | [diff] [blame] | 44 | rmodobj += rmodtool.o |
| 45 | rmodobj += rmodule.o |
| 46 | rmodobj += common.o |
| 47 | rmodobj += elfheaders.o |
| 48 | rmodobj += xdr.o |
| 49 | |
Sol Boucher | 0e53931 | 2015-03-05 15:38:03 -0800 | [diff] [blame] | 50 | TOOLCFLAGS ?= -std=c99 -Werror -Wall -Wextra |
| 51 | TOOLCFLAGS += -Wcast-qual -Wmissing-prototypes -Wredundant-decls -Wshadow |
| 52 | TOOLCFLAGS += -Wstrict-prototypes -Wwrite-strings |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 53 | TOOLCPPFLAGS ?= -D_DEFAULT_SOURCE # memccpy() from string.h |
Jonathan A. Kollasch | 9d6a17b | 2015-07-06 08:29:00 -0500 | [diff] [blame] | 54 | TOOLCPPFLAGS += -D_XOPEN_SOURCE=700 # strdup() from string.h |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 55 | TOOLCPPFLAGS += -I$(top)/util/cbfstool/flashmap |
Patrick Georgi | 7b32145 | 2015-05-19 16:43:05 +0200 | [diff] [blame] | 56 | TOOLCPPFLAGS += -I$(top)/util/cbfstool |
| 57 | TOOLCPPFLAGS += -I$(objutil)/cbfstool |
Paul Kocialkowski | 34ce438 | 2015-09-24 19:00:47 +0200 | [diff] [blame] | 58 | TOOLCPPFLAGS += -I$(top)/src/commonlib/include |
Patrick Georgi | 89f2034 | 2015-10-01 15:54:04 +0200 | [diff] [blame] | 59 | TOOLCPPFLAGS += -DNEED_VB2_SHA_LIBRARY |
| 60 | TOOLCPPFLAGS += -I$(top)/3rdparty/vboot/firmware/include |
| 61 | TOOLCPPFLAGS += -I$(top)/3rdparty/vboot/firmware/2lib/include |
Paul Menzel | 6548ae9 | 2015-05-03 09:35:32 +0200 | [diff] [blame] | 62 | TOOLLDFLAGS ?= |
Werner Zeh | 8c3780a | 2015-10-02 09:56:32 +0200 | [diff] [blame] | 63 | HOSTCFLAGS += -fms-extensions |
Sol Boucher | 0e53931 | 2015-03-05 15:38:03 -0800 | [diff] [blame] | 64 | |
Zheng Bao | c31cdd8 | 2012-10-22 16:39:24 +0800 | [diff] [blame] | 65 | ifeq ($(shell uname -s | cut -c-7 2>/dev/null), MINGW32) |
Patrick Georgi | cdeb1c4 | 2015-09-16 16:19:26 +0200 | [diff] [blame] | 66 | TOOLCFLAGS += -mno-ms-bitfields |
Zheng Bao | c31cdd8 | 2012-10-22 16:39:24 +0800 | [diff] [blame] | 67 | endif |
| 68 | |
Patrick Georgi | 7b32145 | 2015-05-19 16:43:05 +0200 | [diff] [blame] | 69 | $(objutil)/cbfstool/%.o: $(objutil)/cbfstool/%.c |
| 70 | printf " HOSTCC $(subst $(objutil)/,,$(@))\n" |
| 71 | $(HOSTCC) $(TOOLCPPFLAGS) $(TOOLCFLAGS) $(HOSTCFLAGS) -c -o $@ $< |
| 72 | |
Patrick Georgi | a2acbc7 | 2010-04-16 22:48:57 +0000 | [diff] [blame] | 73 | $(objutil)/cbfstool/%.o: $(top)/util/cbfstool/%.c |
| 74 | printf " HOSTCC $(subst $(objutil)/,,$(@))\n" |
Sol Boucher | 0e53931 | 2015-03-05 15:38:03 -0800 | [diff] [blame] | 75 | $(HOSTCC) $(TOOLCPPFLAGS) $(TOOLCFLAGS) $(HOSTCFLAGS) -c -o $@ $< |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 76 | |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 77 | $(objutil)/cbfstool/%.o: $(top)/util/cbfstool/flashmap/%.c |
| 78 | printf " HOSTCC $(subst $(objutil)/,,$(@))\n" |
| 79 | $(HOSTCC) $(TOOLCPPFLAGS) $(TOOLCFLAGS) $(HOSTCFLAGS) -c -o $@ $< |
| 80 | |
Stefan Reinauer | aa3f7ba | 2013-03-28 16:51:45 -0700 | [diff] [blame] | 81 | $(objutil)/cbfstool/%.o: $(top)/util/cbfstool/lzma/%.c |
| 82 | printf " HOSTCC $(subst $(objutil)/,,$(@))\n" |
Sol Boucher | 0e53931 | 2015-03-05 15:38:03 -0800 | [diff] [blame] | 83 | $(HOSTCC) $(TOOLCPPFLAGS) $(TOOLCFLAGS) $(HOSTCFLAGS) -c -o $@ $< |
Patrick Georgi | b7b56dd8 | 2009-09-14 13:29:27 +0000 | [diff] [blame] | 84 | |
Stefan Reinauer | 2e200cd | 2012-10-30 14:02:45 -0700 | [diff] [blame] | 85 | $(objutil)/cbfstool/%.o: $(top)/util/cbfstool/lzma/C/%.c |
Zheng Bao | a182cbd | 2012-12-14 15:44:59 +0800 | [diff] [blame] | 86 | printf " HOSTCC $(subst $(objutil)/,,$(@))\n" |
Sol Boucher | 0e53931 | 2015-03-05 15:38:03 -0800 | [diff] [blame] | 87 | $(HOSTCC) $(TOOLCPPFLAGS) $(TOOLCFLAGS) $(HOSTCFLAGS) -c -o $@ $< |
Patrick Georgi | b7b56dd8 | 2009-09-14 13:29:27 +0000 | [diff] [blame] | 88 | |
Patrick Georgi | 89f2034 | 2015-10-01 15:54:04 +0200 | [diff] [blame] | 89 | $(objutil)/cbfstool/%.o: $(top)/3rdparty/vboot/firmware/2lib/%.c |
| 90 | printf " HOSTCC $(subst $(objutil)/,,$(@))\n" |
| 91 | $(HOSTCC) $(TOOLCPPFLAGS) $(TOOLCFLAGS) $(HOSTCFLAGS) -c -o $@ $< |
| 92 | |
Patrick Georgi | 913e171 | 2014-07-15 12:28:12 +0200 | [diff] [blame] | 93 | $(objutil)/cbfstool/cbfstool: $(addprefix $(objutil)/cbfstool/,$(cbfsobj)) |
Stefan Reinauer | aa3f7ba | 2013-03-28 16:51:45 -0700 | [diff] [blame] | 94 | printf " HOSTCC $(subst $(objutil)/,,$(@)) (link)\n" |
Paul Menzel | 6548ae9 | 2015-05-03 09:35:32 +0200 | [diff] [blame] | 95 | $(HOSTCC) $(TOOLLDFLAGS) -o $@ $(addprefix $(objutil)/cbfstool/,$(cbfsobj)) |
Aaron Durbin | 4fde5a6 | 2014-03-07 15:11:53 -0600 | [diff] [blame] | 96 | |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 97 | $(objutil)/cbfstool/fmaptool: $(addprefix $(objutil)/cbfstool/,$(fmapobj)) |
| 98 | printf " HOSTCC $(subst $(objutil)/,,$(@)) (link)\n" |
| 99 | $(HOSTCC) $(TOOLLDFLAGS) -o $@ $(addprefix $(objutil)/cbfstool/,$(fmapobj)) |
| 100 | |
Patrick Georgi | 913e171 | 2014-07-15 12:28:12 +0200 | [diff] [blame] | 101 | $(objutil)/cbfstool/rmodtool: $(addprefix $(objutil)/cbfstool/,$(rmodobj)) |
Aaron Durbin | 4fde5a6 | 2014-03-07 15:11:53 -0600 | [diff] [blame] | 102 | printf " HOSTCC $(subst $(objutil)/,,$(@)) (link)\n" |
Paul Menzel | 6548ae9 | 2015-05-03 09:35:32 +0200 | [diff] [blame] | 103 | $(HOSTCC) $(TOOLLDFLAGS) -o $@ $(addprefix $(objutil)/cbfstool/,$(rmodobj)) |
Sol Boucher | 0e53931 | 2015-03-05 15:38:03 -0800 | [diff] [blame] | 104 | |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 105 | # Yacc source is superset of header |
Kyösti Mälkki | c877149 | 2015-05-09 08:06:02 +0300 | [diff] [blame] | 106 | $(objutil)/cbfstool/fmd.o: TOOLCFLAGS += -Wno-redundant-decls |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 107 | $(objutil)/cbfstool/fmd_parser.o: TOOLCFLAGS += -Wno-redundant-decls |
Kyösti Mälkki | c877149 | 2015-05-09 08:06:02 +0300 | [diff] [blame] | 108 | # Lex generates unneeded functions and declarations |
| 109 | $(objutil)/cbfstool/fmd_scanner.o: TOOLCFLAGS += -Wno-redundant-decls |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 110 | $(objutil)/cbfstool/fmd_scanner.o: TOOLCFLAGS += -Wno-unused-function |
Sol Boucher | 0e53931 | 2015-03-05 15:38:03 -0800 | [diff] [blame] | 111 | # Tolerate lzma sdk warnings |
| 112 | $(objutil)/cbfstool/LzmaEnc.o: TOOLCFLAGS += -Wno-sign-compare -Wno-cast-qual |
Patrick Georgi | 89f2034 | 2015-10-01 15:54:04 +0200 | [diff] [blame] | 113 | # Tolerate vboot warnings |
| 114 | $(objutil)/cbfstool/2sha_utility.o: TOOLCFLAGS += -Wno-sign-compare |
| 115 | $(objutil)/cbfstool/2sha1.o: TOOLCFLAGS += -Wno-cast-qual |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 116 | |
Patrick Georgi | 7b32145 | 2015-05-19 16:43:05 +0200 | [diff] [blame] | 117 | $(objutil)/cbfstool/fmd.o: $(objutil)/cbfstool/fmd_parser.h |
| 118 | $(objutil)/cbfstool/fmd.o: $(objutil)/cbfstool/fmd_scanner.h |
Kyösti Mälkki | d32b273 | 2015-05-15 09:27:34 +0300 | [diff] [blame] | 119 | $(objutil)/cbfstool/fmd_parser.o: $(objutil)/cbfstool/fmd.o |
| 120 | $(objutil)/cbfstool/fmd_scanner.o: $(objutil)/cbfstool/fmd.o |
| 121 | |
Patrick Georgi | 7b32145 | 2015-05-19 16:43:05 +0200 | [diff] [blame] | 122 | $(objutil)/cbfstool/%: $(top)/util/cbfstool/%_shipped |
Kyösti Mälkki | d32b273 | 2015-05-15 09:27:34 +0300 | [diff] [blame] | 123 | mkdir -p $(dir $@) |
| 124 | cp $< $@ |
| 125 | |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 126 | ifeq ($(CONFIG_FMD_GENPARSER),y) |
| 127 | TOOLLEX := lex |
| 128 | TOOLYACC := yacc |
| 129 | |
Kyösti Mälkki | d32b273 | 2015-05-15 09:27:34 +0300 | [diff] [blame] | 130 | # the .c rule also creates .h |
| 131 | $(top)/util/cbfstool/fmd_scanner.h_shipped: $(top)/util/cbfstool/fmd_scanner.c_shipped |
| 132 | $(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] | 133 | echo " LEX util/cbfstool/fmd_scanner.[ch]" |
Kyösti Mälkki | d32b273 | 2015-05-15 09:27:34 +0300 | [diff] [blame] | 134 | $(TOOLLEX) -t --header-file=$(top)/util/cbfstool/fmd_scanner.h_shipped $< >$(top)/util/cbfstool/fmd_scanner.c_shipped |
| 135 | |
| 136 | # the .c rule also creates .h |
| 137 | $(top)/util/cbfstool/fmd_parser.h_shipped: $(top)/util/cbfstool/fmd_parser.c_shipped |
| 138 | $(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] | 139 | echo " YACC util/cbfstool/fmd_parser.[ch]" |
| 140 | $(TOOLYACC) -d $< |
Kyösti Mälkki | d32b273 | 2015-05-15 09:27:34 +0300 | [diff] [blame] | 141 | mv -f y.tab.c $(top)/util/cbfstool/fmd_parser.c_shipped |
| 142 | mv -f y.tab.h $(top)/util/cbfstool/fmd_parser.h_shipped |
| 143 | |
| 144 | endif # CONFIG_FMD_GENPARSER |