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
|
|
|
|
CXXFLAGS ?=-DCOMPACT $(CFLAGS)
|
|
|
|
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
|
|
|
|
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 $@ $<
|
|
|
|
|
|
|
|
all: $(BINARY)
|
2009-03-31 13:57:36 +02:00
|
|
|
|
2009-09-14 15:29:27 +02:00
|
|
|
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 $@ $^
|