2009-04-04 20:24:21 +02:00
|
|
|
obj ?= $(shell pwd)
|
|
|
|
|
2009-05-26 14:22:10 +02:00
|
|
|
HOSTCXX ?= g++
|
2009-09-14 15:29:27 +02:00
|
|
|
HOSTCC ?= gcc
|
2009-09-17 17:35:08 +02:00
|
|
|
CFLAGS ?= -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
|
|
|
|
|
|
|
tags:
|
2009-09-14 15:29:27 +02:00
|
|
|
ctags *.[ch]
|
2009-04-04 20:24:21 +02:00
|
|
|
|
2009-09-16 10:19:07 +02:00
|
|
|
CXXFLAGS=-DCOMPACT -g
|
|
|
|
CFLAGS=-g
|
|
|
|
LDFLAGS=-g
|
2009-04-05 00:18:26 +02:00
|
|
|
|
2009-09-14 15:29:27 +02:00
|
|
|
$(obj)/cbfstool:$(COMMON)
|
|
|
|
$(HOSTCXX) $(LDFLAGS) -o $@ $^
|