2009-04-04 20:24:21 +02:00
|
|
|
obj ?= $(shell pwd)
|
|
|
|
|
2011-10-21 23:24:57 +02:00
|
|
|
HOSTCXX ?= g++
|
|
|
|
HOSTCC ?= gcc
|
|
|
|
CFLAGS ?= -g -Wall
|
2012-05-11 21:58:11 +02:00
|
|
|
CXXFLAGS +=-DCOMPACT $(CFLAGS)
|
2011-10-21 23:24:57 +02:00
|
|
|
LDFLAGS ?= -g
|
2009-09-14 15:29:27 +02:00
|
|
|
|
|
|
|
BINARY:=$(obj)/cbfstool
|
2009-05-26 14:22:10 +02:00
|
|
|
|
2009-09-14 15:29:27 +02:00
|
|
|
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
|
2009-04-04 20:24:21 +02:00
|
|
|
|
2009-09-14 15:29:27 +02:00
|
|
|
COMMON:=$(addprefix $(obj)/,$(COMMON))
|
2009-03-31 13:57:36 +02:00
|
|
|
|
2012-08-16 01:02:52 +02:00
|
|
|
all: dep $(BINARY)
|
|
|
|
|
2009-09-14 15:29:27 +02:00
|
|
|
$(obj)/%.o: %.c
|
|
|
|
$(HOSTCC) $(CFLAGS) -c -o $@ $<
|
2009-03-31 13:57:36 +02:00
|
|
|
|
2009-09-14 15:29:27 +02:00
|
|
|
$(obj)/%.o: lzma/%.cc
|
|
|
|
$(HOSTCXX) $(CXXFLAGS) -c -o $@ $<
|
2009-03-31 13:57:36 +02:00
|
|
|
|
2009-09-14 15:29:27 +02:00
|
|
|
$(obj)/%.o: lzma/C/7zip/Compress/LZMA/%.cpp
|
|
|
|
$(HOSTCXX) $(CXXFLAGS) -c -o $@ $<
|
2009-03-31 13:57:36 +02:00
|
|
|
|
2009-09-14 15:29:27 +02:00
|
|
|
$(obj)/%.o: lzma/C/7zip/Compress/LZ/%.cpp
|
|
|
|
$(HOSTCXX) $(CXXFLAGS) -c -o $@ $<
|
2009-04-05 00:18:26 +02:00
|
|
|
|
2009-09-14 15:29:27 +02:00
|
|
|
$(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 $@ $<
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -f $(COMMON) $(BINARY)
|
2009-03-31 13:57:36 +02:00
|
|
|
|
2010-04-27 08:56:47 +02:00
|
|
|
tags:
|
2009-09-14 15:29:27 +02:00
|
|
|
ctags *.[ch]
|
2009-04-04 20:24:21 +02:00
|
|
|
|
2009-09-14 15:29:27 +02:00
|
|
|
$(obj)/cbfstool:$(COMMON)
|
|
|
|
$(HOSTCXX) $(LDFLAGS) -o $@ $^
|
2012-08-16 01:02:52 +02:00
|
|
|
|
|
|
|
dep:
|
|
|
|
@$(HOSTCC) $(CFLAGS) -MM *.c > .dependencies
|
|
|
|
@$(HOSTCC) $(CFLAGS) -MM lzma/C/7zip/Decompress/*.c >> .dependencies
|
|
|
|
@$(HOSTCXX) $(CXXFLAGS) -MM lzma/C/7zip/Compress/*/*.cpp >> .dependencies
|
|
|
|
@$(HOSTCXX) $(CXXFLAGS) -MM lzma/C/7zip/Common/*.cpp >> .dependencies
|
|
|
|
@$(HOSTCXX) $(CXXFLAGS) -MM lzma/C/Common/*.cpp >> .dependencies
|
|
|
|
@$(HOSTCXX) $(CXXFLAGS) -MM lzma/*.cc >> .dependencies
|
|
|
|
|
|
|
|
-include .dependencies
|