2009-08-12 17:00:51 +02:00
|
|
|
cbfsobj :=
|
2012-10-30 22:02:45 +01:00
|
|
|
cbfsobj += cbfstool.o
|
2009-09-14 15:29:27 +02:00
|
|
|
cbfsobj += common.o
|
|
|
|
cbfsobj += compress.o
|
2013-01-28 18:56:17 +01:00
|
|
|
cbfsobj += cbfs_image.o
|
2009-09-14 15:29:27 +02:00
|
|
|
cbfsobj += cbfs-mkstage.o
|
|
|
|
cbfsobj += cbfs-mkpayload.o
|
2013-12-30 22:16:18 +01:00
|
|
|
cbfsobj += elfheaders.o
|
2013-12-03 20:13:35 +01:00
|
|
|
cbfsobj += xdr.o
|
2012-12-15 00:16:21 +01:00
|
|
|
cbfsobj += fit.o
|
2012-10-30 22:02:45 +01:00
|
|
|
# LZMA
|
|
|
|
cbfsobj += lzma.o
|
|
|
|
cbfsobj += LzFind.o
|
|
|
|
cbfsobj += LzmaDec.o
|
|
|
|
cbfsobj += LzmaEnc.o
|
2013-08-27 20:22:21 +02:00
|
|
|
# linux as payload
|
|
|
|
cbfsobj += linux_trampoline.o
|
|
|
|
cbfsobj += cbfs-payload-linux.o
|
2009-08-12 17:00:51 +02:00
|
|
|
|
2015-02-26 20:47:19 +01:00
|
|
|
fmapobj :=
|
|
|
|
fmapobj += fmaptool.o
|
|
|
|
fmapobj += fmap_from_fmd.o
|
|
|
|
fmapobj += fmd.o
|
|
|
|
fmapobj += fmd_parser.o
|
|
|
|
fmapobj += fmd_scanner.o
|
|
|
|
# FMAP
|
|
|
|
fmapobj += fmap.o
|
|
|
|
fmapobj += kv_pair.o
|
|
|
|
fmapobj += valstr.o
|
|
|
|
|
2015-03-06 00:38:03 +01:00
|
|
|
rmodobj :=
|
2014-03-07 22:11:53 +01:00
|
|
|
rmodobj += rmodtool.o
|
|
|
|
rmodobj += rmodule.o
|
|
|
|
rmodobj += common.o
|
|
|
|
rmodobj += elfheaders.o
|
|
|
|
rmodobj += xdr.o
|
|
|
|
|
2015-03-06 00:38:03 +01:00
|
|
|
TOOLCFLAGS ?= -std=c99 -Werror -Wall -Wextra
|
|
|
|
TOOLCFLAGS += -Wcast-qual -Wmissing-prototypes -Wredundant-decls -Wshadow
|
|
|
|
TOOLCFLAGS += -Wstrict-prototypes -Wwrite-strings
|
2015-02-26 20:47:19 +01:00
|
|
|
TOOLCPPFLAGS ?= -D_DEFAULT_SOURCE # memccpy() from string.h
|
|
|
|
TOOLCPPFLAGS += -D_POSIX_C_SOURCE=200809L # strdup() from string.h
|
|
|
|
TOOLCPPFLAGS += -I$(top)/util/cbfstool/flashmap
|
2015-05-03 09:35:32 +02:00
|
|
|
TOOLLDFLAGS ?=
|
2015-03-06 00:38:03 +01:00
|
|
|
|
2012-10-22 10:39:24 +02:00
|
|
|
ifeq ($(shell uname -s | cut -c-7 2>/dev/null), MINGW32)
|
2014-03-07 22:11:53 +01:00
|
|
|
TOOLFLAGS+=-mno-ms-bitfields
|
2012-10-22 10:39:24 +02:00
|
|
|
endif
|
|
|
|
|
2010-04-17 00:48:57 +02:00
|
|
|
$(objutil)/cbfstool/%.o: $(top)/util/cbfstool/%.c
|
|
|
|
printf " HOSTCC $(subst $(objutil)/,,$(@))\n"
|
2015-03-06 00:38:03 +01:00
|
|
|
$(HOSTCC) $(TOOLCPPFLAGS) $(TOOLCFLAGS) $(HOSTCFLAGS) -c -o $@ $<
|
2009-08-12 17:00:51 +02:00
|
|
|
|
2015-02-26 20:47:19 +01:00
|
|
|
$(objutil)/cbfstool/%.o: $(top)/util/cbfstool/flashmap/%.c
|
|
|
|
printf " HOSTCC $(subst $(objutil)/,,$(@))\n"
|
|
|
|
$(HOSTCC) $(TOOLCPPFLAGS) $(TOOLCFLAGS) $(HOSTCFLAGS) -c -o $@ $<
|
|
|
|
|
2013-03-29 00:51:45 +01:00
|
|
|
$(objutil)/cbfstool/%.o: $(top)/util/cbfstool/lzma/%.c
|
|
|
|
printf " HOSTCC $(subst $(objutil)/,,$(@))\n"
|
2015-03-06 00:38:03 +01:00
|
|
|
$(HOSTCC) $(TOOLCPPFLAGS) $(TOOLCFLAGS) $(HOSTCFLAGS) -c -o $@ $<
|
2009-08-12 17:00:51 +02:00
|
|
|
|
2012-10-30 22:02:45 +01:00
|
|
|
$(objutil)/cbfstool/%.o: $(top)/util/cbfstool/lzma/C/%.c
|
2012-12-14 08:44:59 +01:00
|
|
|
printf " HOSTCC $(subst $(objutil)/,,$(@))\n"
|
2015-03-06 00:38:03 +01:00
|
|
|
$(HOSTCC) $(TOOLCPPFLAGS) $(TOOLCFLAGS) $(HOSTCFLAGS) -c -o $@ $<
|
2009-09-14 15:29:27 +02:00
|
|
|
|
2014-07-15 12:28:12 +02:00
|
|
|
$(objutil)/cbfstool/cbfstool: $(addprefix $(objutil)/cbfstool/,$(cbfsobj))
|
2013-03-29 00:51:45 +01:00
|
|
|
printf " HOSTCC $(subst $(objutil)/,,$(@)) (link)\n"
|
2015-05-03 09:35:32 +02:00
|
|
|
$(HOSTCC) $(TOOLLDFLAGS) -o $@ $(addprefix $(objutil)/cbfstool/,$(cbfsobj))
|
2014-03-07 22:11:53 +01:00
|
|
|
|
2015-02-26 20:47:19 +01:00
|
|
|
$(objutil)/cbfstool/fmaptool: $(addprefix $(objutil)/cbfstool/,$(fmapobj))
|
|
|
|
printf " HOSTCC $(subst $(objutil)/,,$(@)) (link)\n"
|
|
|
|
$(HOSTCC) $(TOOLLDFLAGS) -o $@ $(addprefix $(objutil)/cbfstool/,$(fmapobj))
|
|
|
|
|
2014-07-15 12:28:12 +02:00
|
|
|
$(objutil)/cbfstool/rmodtool: $(addprefix $(objutil)/cbfstool/,$(rmodobj))
|
2014-03-07 22:11:53 +01:00
|
|
|
printf " HOSTCC $(subst $(objutil)/,,$(@)) (link)\n"
|
2015-05-03 09:35:32 +02:00
|
|
|
$(HOSTCC) $(TOOLLDFLAGS) -o $@ $(addprefix $(objutil)/cbfstool/,$(rmodobj))
|
2015-03-06 00:38:03 +01:00
|
|
|
|
2015-02-26 20:47:19 +01:00
|
|
|
# Yacc source is superset of header
|
|
|
|
$(objutil)/cbfstool/fmd_parser.o: TOOLCFLAGS += -Wno-redundant-decls
|
|
|
|
# Lex generates unneeded functions
|
|
|
|
$(objutil)/cbfstool/fmd_scanner.o: TOOLCFLAGS += -Wno-unused-function
|
2015-03-06 00:38:03 +01:00
|
|
|
# Tolerate lzma sdk warnings
|
|
|
|
$(objutil)/cbfstool/LzmaEnc.o: TOOLCFLAGS += -Wno-sign-compare -Wno-cast-qual
|
2015-02-26 20:47:19 +01:00
|
|
|
|
|
|
|
ifeq ($(CONFIG_FMD_GENPARSER),y)
|
|
|
|
TOOLLEX := lex
|
|
|
|
TOOLYACC := yacc
|
|
|
|
|
|
|
|
$(objutil)/cbfstool/fmd.o: $(top)/util/cbfstool/fmd_parser.c
|
|
|
|
$(objutil)/cbfstool/fmd.o: $(top)/util/cbfstool/fmd_scanner.c
|
|
|
|
$(objutil)/cbfstool/fmd_parser.o: $(objutil)/cbfstool/fmd.o
|
|
|
|
$(objutil)/cbfstool/fmd_scanner.o: $(objutil)/cbfstool/fmd.o
|
|
|
|
$(top)/util/cbfstool/fmd_scanner.c $(top)/util/cbfstool/fmd_scanner.h: $(top)/util/cbfstool/fmd_scanner.l
|
|
|
|
echo " LEX util/cbfstool/fmd_scanner.[ch]"
|
|
|
|
$(TOOLLEX) -t --header-file=$(top)/util/cbfstool/fmd_scanner.h $< >$(top)/util/cbfstool/fmd_scanner.c
|
|
|
|
$(top)/util/cbfstool/fmd_parser.c $(top)/util/cbfstool/fmd_parser.h: $(top)/util/cbfstool/fmd_parser.y
|
|
|
|
echo " YACC util/cbfstool/fmd_parser.[ch]"
|
|
|
|
$(TOOLYACC) -d $<
|
|
|
|
mv -f y.tab.c $(top)/util/cbfstool/fmd_parser.c
|
|
|
|
mv -f y.tab.h $(top)/util/cbfstool/fmd_parser.h
|
|
|
|
endif
|