Peter Stuge | 1d862de | 2009-04-14 00:08:34 +0000 | [diff] [blame] | 1 | obj ?= $(shell pwd) |
| 2 | |
Ronald G. Minnich | aa2f739 | 2013-12-03 11:13:35 -0800 | [diff] [blame^] | 3 | HOSTCC ?= gcc |
| 4 | CFLAGS ?= -g |
| 5 | CFLAGS += -D_7ZIP_ST |
| 6 | CFLAGS += -Wall -Wundef -Wstrict-prototypes -Wmissing-prototypes |
| 7 | CFLAGS += -Wwrite-strings -Wredundant-decls -Wno-trigraphs |
| 8 | CFLAGS += -Wstrict-aliasing -Werror |
| 9 | # You're going to have to fix the LzmaEnc.c first -- it's horrible. |
| 10 | # CFLAGS += -Wshadow |
| 11 | LDFLAGS += -g |
Stefan Reinauer | 3a5c277 | 2009-05-26 12:22:10 +0000 | [diff] [blame] | 12 | |
Patrick Georgi | b7b56dd8 | 2009-09-14 13:29:27 +0000 | [diff] [blame] | 13 | BINARY:=$(obj)/cbfstool |
Peter Stuge | 1d862de | 2009-04-14 00:08:34 +0000 | [diff] [blame] | 14 | |
Aaron Durbin | 6b0d0d6 | 2012-12-14 17:16:21 -0600 | [diff] [blame] | 15 | COMMON:=cbfstool.o common.o cbfs_image.o compress.o fit.o |
Ronald G. Minnich | aa2f739 | 2013-12-03 11:13:35 -0800 | [diff] [blame^] | 16 | COMMON+=cbfs-mkstage.o cbfs-mkpayload.o xdr.o |
Stefan Reinauer | 2e200cd | 2012-10-30 14:02:45 -0700 | [diff] [blame] | 17 | # LZMA |
| 18 | COMMON+=lzma/lzma.o |
| 19 | COMMON+=lzma/C/LzFind.o lzma/C/LzmaDec.o lzma/C/LzmaEnc.o |
Peter Stuge | 1d862de | 2009-04-14 00:08:34 +0000 | [diff] [blame] | 20 | |
Patrick Georgi | de36d33 | 2013-08-27 20:22:21 +0200 | [diff] [blame] | 21 | COMMON+=linux_trampoline.o cbfs-payload-linux.o |
| 22 | |
Patrick Georgi | b7b56dd8 | 2009-09-14 13:29:27 +0000 | [diff] [blame] | 23 | COMMON:=$(addprefix $(obj)/,$(COMMON)) |
Peter Stuge | 1d862de | 2009-04-14 00:08:34 +0000 | [diff] [blame] | 24 | |
Stefan Reinauer | 746d174 | 2012-08-15 16:02:52 -0700 | [diff] [blame] | 25 | all: dep $(BINARY) |
| 26 | |
Patrick Georgi | b7b56dd8 | 2009-09-14 13:29:27 +0000 | [diff] [blame] | 27 | $(obj)/%.o: %.c |
Stefan Reinauer | 9dd27bc | 2009-06-30 17:13:58 +0000 | [diff] [blame] | 28 | $(HOSTCC) $(CFLAGS) -c -o $@ $< |
Peter Stuge | 1d862de | 2009-04-14 00:08:34 +0000 | [diff] [blame] | 29 | |
Patrick Georgi | b7b56dd8 | 2009-09-14 13:29:27 +0000 | [diff] [blame] | 30 | clean: |
| 31 | rm -f $(COMMON) $(BINARY) |
Peter Stuge | 1d862de | 2009-04-14 00:08:34 +0000 | [diff] [blame] | 32 | |
Stefan Reinauer | 14e2277 | 2010-04-27 06:56:47 +0000 | [diff] [blame] | 33 | tags: |
Patrick Georgi | b7b56dd8 | 2009-09-14 13:29:27 +0000 | [diff] [blame] | 34 | ctags *.[ch] |
Peter Stuge | 1d862de | 2009-04-14 00:08:34 +0000 | [diff] [blame] | 35 | |
Patrick Georgi | b7b56dd8 | 2009-09-14 13:29:27 +0000 | [diff] [blame] | 36 | $(obj)/cbfstool:$(COMMON) |
Stefan Reinauer | aa3f7ba | 2013-03-28 16:51:45 -0700 | [diff] [blame] | 37 | $(HOSTCC) $(CFLAGS) -o $@ $^ |
Stefan Reinauer | 746d174 | 2012-08-15 16:02:52 -0700 | [diff] [blame] | 38 | |
| 39 | dep: |
| 40 | @$(HOSTCC) $(CFLAGS) -MM *.c > .dependencies |
Stefan Reinauer | aa3f7ba | 2013-03-28 16:51:45 -0700 | [diff] [blame] | 41 | @$(HOSTCC) $(CFLAGS) -MM lzma/*.c >> .dependencies |
Stefan Reinauer | 2e200cd | 2012-10-30 14:02:45 -0700 | [diff] [blame] | 42 | @$(HOSTCC) $(CFLAGS) -MM lzma/C/*.c >> .dependencies |
Stefan Reinauer | 746d174 | 2012-08-15 16:02:52 -0700 | [diff] [blame] | 43 | |
| 44 | -include .dependencies |