summaryrefslogtreecommitdiff
path: root/util/cbfstool/Makefile
blob: 94712bdd6d0bbd2375ad943f761b73a012affec5 (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
obj ?= $(shell pwd)

HOSTCXX ?= g++
HOSTCC ?= gcc

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))

$(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 $@ $<

all: $(BINARY)

clean:
	rm -f $(COMMON) $(BINARY)

tags: 
	ctags *.[ch]

CXXFLAGS=-DCOMPACT -g
CFLAGS=-g
LDFLAGS=-g

$(obj)/cbfstool:$(COMMON)
	$(HOSTCXX) $(LDFLAGS) -o $@ $^