diff options
Diffstat (limited to 'util/cbfstool/Makefile')
-rw-r--r-- | util/cbfstool/Makefile | 63 |
1 files changed, 36 insertions, 27 deletions
diff --git a/util/cbfstool/Makefile b/util/cbfstool/Makefile index 50f97961bc..51b6bad9c1 100644 --- a/util/cbfstool/Makefile +++ b/util/cbfstool/Makefile @@ -1,42 +1,51 @@ -# -# -# - obj ?= $(shell pwd) -COMMANDS=create.o bootblock.o delete.o extract.o add.o print.o resize.o -OBJ=$(COMMANDS) cbfstool.o util.o fs.o -INC=cbfstool.h cbfs.h - -HOSTCC ?= gcc HOSTCXX ?= g++ +HOSTCC ?= gcc + +BINARY:=$(obj)/cbfstool -CFLAGS=-g -Wall -W -Werror +COMMON:=common.o compress.o minilzma.o +COMMON+=LZMAEncoder.o LZInWindow.o +COMMON+=RangeCoderBit.o StreamUtils.o +COMMON+=OutBuffer.o Alloc.o CRC.o +COMMON+=cbfs-mkstage.o cbfs-mkpayload.o cbfstool.o -DESTDIR ?= /usr/local/bin +COMMON:=$(addprefix $(obj)/,$(COMMON)) -all: $(obj)/cbfstool $(obj)/tools/cbfs-mkpayload $(obj)/tools/cbfs-mkstage +$(obj)/%.o: %.c + $(HOSTCC) $(CFLAGS) -c -o $@ $< -$(obj)/cbfstool: $(patsubst %,$(obj)/%,$(OBJ)) - $(HOSTCC) -o $@ $(patsubst %,$(obj)/%,$(OBJ)) +$(obj)/%.o: lzma/%.cc + $(HOSTCXX) $(CXXFLAGS) -c -o $@ $< -tobj = $(obj)/tools -tsrc = $(shell pwd)/tools +$(obj)/%.o: lzma/C/7zip/Compress/LZMA/%.cpp + $(HOSTCXX) $(CXXFLAGS) -c -o $@ $< -include $(tsrc)/Makefile +$(obj)/%.o: lzma/C/7zip/Compress/LZ/%.cpp + $(HOSTCXX) $(CXXFLAGS) -c -o $@ $< -$(obj)/%.o: %.c $(INC) - $(HOSTCC) $(CFLAGS) -c -o $@ $< +$(obj)/%.o: lzma/C/7zip/Compress/RangeCoder/%.cpp + $(HOSTCXX) $(CXXFLAGS) -c -o $@ $< + +$(obj)/%.o: lzma/C/7zip/Common/%.cpp + $(HOSTCXX) $(CXXFLAGS) -c -o $@ $< + +$(obj)/%.o: lzma/C/Common/%.cpp + $(HOSTCXX) $(CXXFLAGS) -c -o $@ $< + +all: $(BINARY) -install: $(obj)/cbfstool $(obj)/tools/cbfs-mkpayload $(obj)/tools/cbfs-mkstage - @ install -d $(DESTDIR) - @ install -m 0755 $(obj)/cbfstool $(DESTDIR)/cbfstool - @ install -m 0755 $(obj)/tools/cbfs-mkstage $(DESTDIR)/cbfs-mkstage - @ install -m 0755 $(obj)/tools/cbfs-mkpayload $(DESTDIR)/cbfs-mkpayload +clean: + rm -f $(COMMON) $(BINARY) tags: - ctags *.[ch] */*.[ch] + ctags *.[ch] -clean: tools-clean - rm -f $(patsubst %,$(obj)/%,$(OBJ)) $(obj)/cbfstool +CXXFLAGS=-DCOMPACT -m32 +CFLAGS=-m32 +LDFLAGS=-m32 +$(obj)/cbfstool:$(COMMON) + $(HOSTCXX) $(LDFLAGS) -o $@ $^ + strip $@ |