Peter Stuge | 1d862de | 2009-04-14 00:08:34 +0000 | [diff] [blame] | 1 | obj ?= $(shell pwd) |
| 2 | |
Stefan Reinauer | 3a5c277 | 2009-05-26 12:22:10 +0000 | [diff] [blame] | 3 | HOSTCXX ?= g++ |
Patrick Georgi | b7b56dd8 | 2009-09-14 13:29:27 +0000 | [diff] [blame] | 4 | HOSTCC ?= gcc |
Ronald G. Minnich | 5a1af7b | 2009-09-17 15:35:08 +0000 | [diff] [blame] | 5 | CFLAGS ?= -g |
| 6 | |
Stefan Reinauer | 3a5c277 | 2009-05-26 12:22:10 +0000 | [diff] [blame] | 7 | |
Patrick Georgi | b7b56dd8 | 2009-09-14 13:29:27 +0000 | [diff] [blame] | 8 | BINARY:=$(obj)/cbfstool |
Peter Stuge | 1d862de | 2009-04-14 00:08:34 +0000 | [diff] [blame] | 9 | |
Patrick Georgi | b7b56dd8 | 2009-09-14 13:29:27 +0000 | [diff] [blame] | 10 | COMMON:=common.o compress.o minilzma.o |
| 11 | COMMON+=LZMAEncoder.o LZInWindow.o |
| 12 | COMMON+=RangeCoderBit.o StreamUtils.o |
| 13 | COMMON+=OutBuffer.o Alloc.o CRC.o |
| 14 | COMMON+=cbfs-mkstage.o cbfs-mkpayload.o cbfstool.o |
Peter Stuge | 1d862de | 2009-04-14 00:08:34 +0000 | [diff] [blame] | 15 | |
Patrick Georgi | b7b56dd8 | 2009-09-14 13:29:27 +0000 | [diff] [blame] | 16 | COMMON:=$(addprefix $(obj)/,$(COMMON)) |
Peter Stuge | 1d862de | 2009-04-14 00:08:34 +0000 | [diff] [blame] | 17 | |
Patrick Georgi | b7b56dd8 | 2009-09-14 13:29:27 +0000 | [diff] [blame] | 18 | $(obj)/%.o: %.c |
Stefan Reinauer | 9dd27bc | 2009-06-30 17:13:58 +0000 | [diff] [blame] | 19 | $(HOSTCC) $(CFLAGS) -c -o $@ $< |
Peter Stuge | 1d862de | 2009-04-14 00:08:34 +0000 | [diff] [blame] | 20 | |
Patrick Georgi | b7b56dd8 | 2009-09-14 13:29:27 +0000 | [diff] [blame] | 21 | $(obj)/%.o: lzma/%.cc |
| 22 | $(HOSTCXX) $(CXXFLAGS) -c -o $@ $< |
| 23 | |
| 24 | $(obj)/%.o: lzma/C/7zip/Compress/LZMA/%.cpp |
| 25 | $(HOSTCXX) $(CXXFLAGS) -c -o $@ $< |
| 26 | |
| 27 | $(obj)/%.o: lzma/C/7zip/Compress/LZ/%.cpp |
| 28 | $(HOSTCXX) $(CXXFLAGS) -c -o $@ $< |
| 29 | |
| 30 | $(obj)/%.o: lzma/C/7zip/Compress/RangeCoder/%.cpp |
| 31 | $(HOSTCXX) $(CXXFLAGS) -c -o $@ $< |
| 32 | |
| 33 | $(obj)/%.o: lzma/C/7zip/Common/%.cpp |
| 34 | $(HOSTCXX) $(CXXFLAGS) -c -o $@ $< |
| 35 | |
| 36 | $(obj)/%.o: lzma/C/Common/%.cpp |
| 37 | $(HOSTCXX) $(CXXFLAGS) -c -o $@ $< |
| 38 | |
| 39 | all: $(BINARY) |
| 40 | |
| 41 | clean: |
| 42 | rm -f $(COMMON) $(BINARY) |
Peter Stuge | 1d862de | 2009-04-14 00:08:34 +0000 | [diff] [blame] | 43 | |
Stefan Reinauer | 14e2277 | 2010-04-27 06:56:47 +0000 | [diff] [blame^] | 44 | tags: |
Patrick Georgi | b7b56dd8 | 2009-09-14 13:29:27 +0000 | [diff] [blame] | 45 | ctags *.[ch] |
Peter Stuge | 1d862de | 2009-04-14 00:08:34 +0000 | [diff] [blame] | 46 | |
Patrick Georgi | ab13458 | 2009-09-16 08:19:07 +0000 | [diff] [blame] | 47 | CXXFLAGS=-DCOMPACT -g |
| 48 | CFLAGS=-g |
| 49 | LDFLAGS=-g |
Peter Stuge | 1d862de | 2009-04-14 00:08:34 +0000 | [diff] [blame] | 50 | |
Patrick Georgi | b7b56dd8 | 2009-09-14 13:29:27 +0000 | [diff] [blame] | 51 | $(obj)/cbfstool:$(COMMON) |
| 52 | $(HOSTCXX) $(LDFLAGS) -o $@ $^ |