blob: 813ba1b053362f9cef74caf3309130aea21e1bdc (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
obj ?= $(shell pwd)
HOSTCXX ?= g++
HOSTCC ?= gcc
CFLAGS ?= -g -Wall
CXXFLAGS +=-DCOMPACT $(CFLAGS)
LDFLAGS ?= -g
BINARY:=$(obj)/cbfstool
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
COMMON:=$(addprefix $(obj)/,$(COMMON))
all: dep $(BINARY)
$(obj)/%.o: %.c
$(HOSTCC) $(CFLAGS) -c -o $@ $<
$(obj)/%.o: lzma/%.cc
$(HOSTCXX) $(CXXFLAGS) -c -o $@ $<
$(obj)/%.o: lzma/C/7zip/Compress/LZMA/%.cpp
$(HOSTCXX) $(CXXFLAGS) -c -o $@ $<
$(obj)/%.o: lzma/C/7zip/Compress/LZ/%.cpp
$(HOSTCXX) $(CXXFLAGS) -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 $@ $<
clean:
rm -f $(COMMON) $(BINARY)
tags:
ctags *.[ch]
$(obj)/cbfstool:$(COMMON)
$(HOSTCXX) $(LDFLAGS) -o $@ $^
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
|