2009-04-04 20:24:21 +02:00
|
|
|
obj ?= $(shell pwd)
|
|
|
|
|
2014-01-28 00:17:29 +01:00
|
|
|
HOSTCC ?= $(CC)
|
2013-12-03 20:13:35 +01:00
|
|
|
CFLAGS ?= -g
|
|
|
|
CFLAGS += -Wall -Wundef -Wstrict-prototypes -Wmissing-prototypes
|
|
|
|
CFLAGS += -Wwrite-strings -Wredundant-decls -Wno-trigraphs
|
|
|
|
CFLAGS += -Wstrict-aliasing -Werror
|
2014-01-29 21:56:20 +01:00
|
|
|
CFLAGS += -Wshadow
|
2013-12-03 20:13:35 +01:00
|
|
|
LDFLAGS += -g
|
2009-09-14 15:29:27 +02:00
|
|
|
|
2014-03-07 22:11:53 +01:00
|
|
|
CBFSTOOL_BINARY:=$(obj)/cbfstool
|
2009-05-26 14:22:10 +02:00
|
|
|
|
2014-03-07 22:11:53 +01:00
|
|
|
CBFSTOOL_COMMON:=cbfstool.o common.o cbfs_image.o compress.o fit.o
|
|
|
|
CBFSTOOL_COMMON+=elfheaders.o cbfs-mkstage.o cbfs-mkpayload.o xdr.o
|
2012-10-30 22:02:45 +01:00
|
|
|
# LZMA
|
2014-03-07 22:11:53 +01:00
|
|
|
CBFSTOOL_COMMON+=lzma/lzma.o
|
|
|
|
CBFSTOOL_COMMON+=lzma/C/LzFind.o lzma/C/LzmaDec.o lzma/C/LzmaEnc.o
|
2009-04-04 20:24:21 +02:00
|
|
|
|
2014-03-07 22:11:53 +01:00
|
|
|
CBFSTOOL_COMMON+=linux_trampoline.o cbfs-payload-linux.o
|
2013-08-27 20:22:21 +02:00
|
|
|
|
2014-03-07 22:11:53 +01:00
|
|
|
CBFSTOOL_COMMON:=$(addprefix $(obj)/,$(CBFSTOOL_COMMON))
|
2009-03-31 13:57:36 +02:00
|
|
|
|
2014-03-07 22:11:53 +01:00
|
|
|
|
|
|
|
RMODTOOL_BINARY:=$(obj)/rmodtool
|
|
|
|
RMODTOOL_COMMON:=rmodtool.o rmodule.o common.o elfheaders.o xdr.o
|
|
|
|
|
|
|
|
RMODTOOL_COMMON:=$(addprefix $(obj)/,$(RMODTOOL_COMMON))
|
|
|
|
|
|
|
|
all: dep $(CBFSTOOL_BINARY) $(RMODTOOL_BINARY)
|
2012-08-16 01:02:52 +02:00
|
|
|
|
2009-09-14 15:29:27 +02:00
|
|
|
$(obj)/%.o: %.c
|
|
|
|
$(HOSTCC) $(CFLAGS) -c -o $@ $<
|
2009-03-31 13:57:36 +02:00
|
|
|
|
2009-09-14 15:29:27 +02:00
|
|
|
clean:
|
2014-03-07 22:11:53 +01:00
|
|
|
rm -f $(CBFSTOOL_COMMON) $(CBFSTOOL_BINARY)
|
|
|
|
rm -f $(RMODTOOL_COMMON) $(RMODTOOL_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
|
|
|
|
2014-03-07 22:11:53 +01:00
|
|
|
$(obj)/cbfstool:$(CBFSTOOL_COMMON)
|
|
|
|
$(HOSTCC) $(CFLAGS) -o $@ $^
|
|
|
|
|
|
|
|
$(obj)/rmodtool:$(RMODTOOL_COMMON)
|
2013-03-29 00:51:45 +01:00
|
|
|
$(HOSTCC) $(CFLAGS) -o $@ $^
|
2012-08-16 01:02:52 +02:00
|
|
|
|
|
|
|
dep:
|
|
|
|
@$(HOSTCC) $(CFLAGS) -MM *.c > .dependencies
|
2013-03-29 00:51:45 +01:00
|
|
|
@$(HOSTCC) $(CFLAGS) -MM lzma/*.c >> .dependencies
|
2012-10-30 22:02:45 +01:00
|
|
|
@$(HOSTCC) $(CFLAGS) -MM lzma/C/*.c >> .dependencies
|
2012-08-16 01:02:52 +02:00
|
|
|
|
|
|
|
-include .dependencies
|