Peter Stuge | 1d862de | 2009-04-14 00:08:34 +0000 | [diff] [blame] | 1 | obj ?= $(shell pwd) |
2 | |||||
Stefan Reinauer | a1e4824 | 2011-10-21 14:24:57 -0700 | [diff] [blame] | 3 | HOSTCC ?= gcc |
Paul Menzel | 475d42a | 2013-02-18 11:56:13 +0100 | [diff] [blame] | 4 | CFLAGS ?= -g -Wall -Werror |
Stefan Reinauer | 2e200cd | 2012-10-30 14:02:45 -0700 | [diff] [blame] | 5 | CFLAGS += -D_7ZIP_ST |
Stefan Reinauer | 3a5c277 | 2009-05-26 12:22:10 +0000 | [diff] [blame] | 6 | |
Patrick Georgi | b7b56dd8 | 2009-09-14 13:29:27 +0000 | [diff] [blame] | 7 | BINARY:=$(obj)/cbfstool |
Peter Stuge | 1d862de | 2009-04-14 00:08:34 +0000 | [diff] [blame] | 8 | |
Aaron Durbin | 6b0d0d6 | 2012-12-14 17:16:21 -0600 | [diff] [blame] | 9 | COMMON:=cbfstool.o common.o cbfs_image.o compress.o fit.o |
Stefan Reinauer | 2e200cd | 2012-10-30 14:02:45 -0700 | [diff] [blame] | 10 | COMMON+=cbfs-mkstage.o cbfs-mkpayload.o |
11 | # LZMA | ||||
12 | COMMON+=lzma/lzma.o | ||||
13 | 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] | 14 | |
Patrick Georgi | de36d33 | 2013-08-27 20:22:21 +0200 | [diff] [blame^] | 15 | COMMON+=linux_trampoline.o cbfs-payload-linux.o |
16 | |||||
Patrick Georgi | b7b56dd8 | 2009-09-14 13:29:27 +0000 | [diff] [blame] | 17 | COMMON:=$(addprefix $(obj)/,$(COMMON)) |
Peter Stuge | 1d862de | 2009-04-14 00:08:34 +0000 | [diff] [blame] | 18 | |
Stefan Reinauer | 746d174 | 2012-08-15 16:02:52 -0700 | [diff] [blame] | 19 | all: dep $(BINARY) |
20 | |||||
Patrick Georgi | b7b56dd8 | 2009-09-14 13:29:27 +0000 | [diff] [blame] | 21 | $(obj)/%.o: %.c |
Stefan Reinauer | 9dd27bc | 2009-06-30 17:13:58 +0000 | [diff] [blame] | 22 | $(HOSTCC) $(CFLAGS) -c -o $@ $< |
Peter Stuge | 1d862de | 2009-04-14 00:08:34 +0000 | [diff] [blame] | 23 | |
Patrick Georgi | b7b56dd8 | 2009-09-14 13:29:27 +0000 | [diff] [blame] | 24 | clean: |
25 | rm -f $(COMMON) $(BINARY) | ||||
Peter Stuge | 1d862de | 2009-04-14 00:08:34 +0000 | [diff] [blame] | 26 | |
Stefan Reinauer | 14e2277 | 2010-04-27 06:56:47 +0000 | [diff] [blame] | 27 | tags: |
Patrick Georgi | b7b56dd8 | 2009-09-14 13:29:27 +0000 | [diff] [blame] | 28 | ctags *.[ch] |
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 | $(obj)/cbfstool:$(COMMON) |
Stefan Reinauer | aa3f7ba | 2013-03-28 16:51:45 -0700 | [diff] [blame] | 31 | $(HOSTCC) $(CFLAGS) -o $@ $^ |
Stefan Reinauer | 746d174 | 2012-08-15 16:02:52 -0700 | [diff] [blame] | 32 | |
33 | dep: | ||||
34 | @$(HOSTCC) $(CFLAGS) -MM *.c > .dependencies | ||||
Stefan Reinauer | aa3f7ba | 2013-03-28 16:51:45 -0700 | [diff] [blame] | 35 | @$(HOSTCC) $(CFLAGS) -MM lzma/*.c >> .dependencies |
Stefan Reinauer | 2e200cd | 2012-10-30 14:02:45 -0700 | [diff] [blame] | 36 | @$(HOSTCC) $(CFLAGS) -MM lzma/C/*.c >> .dependencies |
Stefan Reinauer | 746d174 | 2012-08-15 16:02:52 -0700 | [diff] [blame] | 37 | |
38 | -include .dependencies |