2009-04-04 20:24:21 +02:00
|
|
|
obj ?= $(shell pwd)
|
|
|
|
|
2011-10-21 23:24:57 +02:00
|
|
|
HOSTCXX ?= g++
|
|
|
|
HOSTCC ?= gcc
|
2013-02-18 11:56:13 +01:00
|
|
|
CFLAGS ?= -g -Wall -Werror
|
2012-10-30 22:02:45 +01:00
|
|
|
CFLAGS += -D_7ZIP_ST
|
2009-09-14 15:29:27 +02:00
|
|
|
|
|
|
|
BINARY:=$(obj)/cbfstool
|
2009-05-26 14:22:10 +02:00
|
|
|
|
2012-12-15 00:16:21 +01:00
|
|
|
COMMON:=cbfstool.o common.o cbfs_image.o compress.o fit.o
|
2012-10-30 22:02:45 +01:00
|
|
|
COMMON+=cbfs-mkstage.o cbfs-mkpayload.o
|
|
|
|
# LZMA
|
|
|
|
COMMON+=lzma/lzma.o
|
|
|
|
COMMON+=lzma/C/LzFind.o lzma/C/LzmaDec.o lzma/C/LzmaEnc.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
|
|
|
|
2012-08-16 01:02:52 +02:00
|
|
|
all: dep $(BINARY)
|
|
|
|
|
2009-09-14 15:29:27 +02:00
|
|
|
$(obj)/%.o: %.c
|
|
|
|
$(HOSTCC) $(CFLAGS) -c -o $@ $<
|
2009-03-31 13:57:36 +02:00
|
|
|
|
2012-10-30 22:02:45 +01:00
|
|
|
$(obj)/%.o: %.cc
|
|
|
|
$(HOSTCXX) $(CFLAGS) -c -o $@ $<
|
2009-09-14 15:29:27 +02:00
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -f $(COMMON) $(BINARY)
|
2009-03-31 13:57:36 +02:00
|
|
|
|
2010-04-27 08:56:47 +02:00
|
|
|
tags:
|
2009-09-14 15:29:27 +02:00
|
|
|
ctags *.[ch]
|
2009-04-04 20:24:21 +02:00
|
|
|
|
2009-09-14 15:29:27 +02:00
|
|
|
$(obj)/cbfstool:$(COMMON)
|
2012-10-30 22:02:45 +01:00
|
|
|
$(HOSTCXX) $(CFLAGS) -o $@ $^
|
2012-08-16 01:02:52 +02:00
|
|
|
|
|
|
|
dep:
|
|
|
|
@$(HOSTCC) $(CFLAGS) -MM *.c > .dependencies
|
2012-10-30 22:02:45 +01:00
|
|
|
@$(HOSTCC) $(CFLAGS) -MM lzma/*.cc >> .dependencies
|
|
|
|
@$(HOSTCC) $(CFLAGS) -MM lzma/C/*.c >> .dependencies
|
2012-08-16 01:02:52 +02:00
|
|
|
|
|
|
|
-include .dependencies
|