summaryrefslogtreecommitdiff
path: root/util/cbfstool/tools/Makefile
blob: e750c21bd78bc5305b3835103c04f1ebe72bc46e (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
tobj ?= $(shell pwd)
tsrc ?= $(shell pwd)

CFLAGS=-g -Wall

TARGETS += $(tobj)/cbfs-mkstage $(tobj)/cbfs-mkpayload

tools: $(tobj)/cbfs-mkstage $(tobj)/cbfs-mkpayload

include $(tsrc)/lzma/Makefile

COMMON = common.o compress.o $(LZMA_OBJ)

$(tobj)/cbfs-mkstage: $(tobj)/cbfs-mkstage.o $(patsubst %,$(tobj)/%,$(COMMON))
	$(HOSTCXX) $(CFLAGS) -o $@ $^

$(tobj)/cbfs-mkpayload: $(tobj)/cbfs-mkpayload.o $(patsubst %,$(tobj)/%,$(COMMON))
	$(HOSTCXX) $(CFLAGS) -o $@ $^

$(tobj)/%.o: %.c
	$(HOSTCC) $(CFLAGS) -c -o $@ $<

tools-clean:
	rm -f $(tobj)/cbfs-mkpayload.o $(tobj)/cbfs-mkstage.o $(patsubst %,$(tobj)/%,$(COMMON))
	rm -f $(tobj)/cbfs-mkpayload $(tobj)/cbfs-mkstage