Patrick Georgi | 758f26a | 2014-09-27 11:37:46 +0200 | [diff] [blame] | 1 | # copied from cbootimage/src/Makefile.am |
| 2 | CBOOTIMAGE_RAW_SRCS:= \ |
| 3 | cbootimage.c \ |
| 4 | data_layout.c \ |
| 5 | set.c \ |
| 6 | crypto.c \ |
| 7 | aes_ref.c \ |
| 8 | context.c \ |
| 9 | parse.c \ |
Patrick Georgi | 7f845b3 | 2015-04-24 10:52:52 +0200 | [diff] [blame] | 10 | t210/parse_t210.c \ |
Patrick Georgi | 758f26a | 2014-09-27 11:37:46 +0200 | [diff] [blame] | 11 | t132/parse_t132.c \ |
| 12 | t124/parse_t124.c \ |
| 13 | t114/parse_t114.c \ |
| 14 | t30/parse_t30.c \ |
| 15 | t20/parse_t20.c \ |
Patrick Georgi | 7f845b3 | 2015-04-24 10:52:52 +0200 | [diff] [blame] | 16 | t210/nvbctlib_t210.c \ |
Patrick Georgi | 758f26a | 2014-09-27 11:37:46 +0200 | [diff] [blame] | 17 | t132/nvbctlib_t132.c \ |
| 18 | t124/nvbctlib_t124.c \ |
| 19 | t114/nvbctlib_t114.c \ |
| 20 | t30/nvbctlib_t30.c \ |
| 21 | t20/nvbctlib_t20.c \ |
| 22 | cbootimage.h \ |
| 23 | context.h \ |
| 24 | crypto.h \ |
| 25 | data_layout.h \ |
| 26 | nvaes_ref.h \ |
| 27 | parse.h \ |
| 28 | set.h \ |
| 29 | t20/nvboot_bct_t20.h \ |
| 30 | t20/nvboot_sdram_param_t20.h \ |
| 31 | t30/nvboot_bct_t30.h \ |
| 32 | t30/nvboot_sdram_param_t30.h \ |
| 33 | t114/nvboot_bct_t114.h \ |
| 34 | t114/nvboot_sdram_param_t114.h \ |
| 35 | t124/nvboot_bct_t124.h \ |
| 36 | t124/nvboot_sdram_param_t124.h \ |
| 37 | t132/nvboot_bct_t132.h \ |
Patrick Georgi | 7f845b3 | 2015-04-24 10:52:52 +0200 | [diff] [blame] | 38 | t132/nvboot_sdram_param_t132.h \ |
| 39 | t210/nvboot_bct_t210.h \ |
| 40 | t210/nvboot_sdram_param_t210.h |
Patrick Georgi | 758f26a | 2014-09-27 11:37:46 +0200 | [diff] [blame] | 41 | |
| 42 | CBOOTIMAGE_SRCS:=$(addprefix util/nvidia/cbootimage/src/,$(filter %.c,$(CBOOTIMAGE_RAW_SRCS))) |
| 43 | CBOOTIMAGE_OBJS:=$(addprefix $(objutil)/nvidia/cbootimage/,$(patsubst %.c,%.o,$(filter %.c,$(CBOOTIMAGE_RAW_SRCS)))) |
Marc Jones | e77e37b | 2015-02-10 14:15:45 -0700 | [diff] [blame] | 44 | CBOOTIMAGE_FLAGS:=-Wall -std=c99 -O2 |
Patrick Georgi | 758f26a | 2014-09-27 11:37:46 +0200 | [diff] [blame] | 45 | |
Martin Roth | 0baad5a | 2018-08-27 07:12:50 -0600 | [diff] [blame] | 46 | ifeq ($(OS_ARCH), FreeBSD) |
| 47 | CBOOTIMAGE_FLAGS:=-DENODATA=ENOATTR |
| 48 | endif |
| 49 | |
Patrick Georgi | 758f26a | 2014-09-27 11:37:46 +0200 | [diff] [blame] | 50 | additional-dirs += $(sort $(dir $(CBOOTIMAGE_OBJS))) |
| 51 | |
| 52 | $(objutil)/nvidia/cbootimage/%.o: util/nvidia/cbootimage/src/%.c |
Marc Jones | e77e37b | 2015-02-10 14:15:45 -0700 | [diff] [blame] | 53 | printf " HOSTCC $(subst $(objutil)/,,$(@))\n" |
| 54 | $(HOSTCC) $(CBOOTIMAGE_FLAGS) -c -o $@ $< |
Patrick Georgi | 758f26a | 2014-09-27 11:37:46 +0200 | [diff] [blame] | 55 | |
| 56 | $(CBOOTIMAGE): $(CBOOTIMAGE_OBJS) |
Marc Jones | e77e37b | 2015-02-10 14:15:45 -0700 | [diff] [blame] | 57 | printf " HOSTCC $(subst $(objutil)/,,$(@)) (link)\n" |
| 58 | $(HOSTCC) $(CBOOTIMAGE_FLAGS) -o $@.tmp $^ -lm |
Patrick Georgi | 758f26a | 2014-09-27 11:37:46 +0200 | [diff] [blame] | 59 | mv $@.tmp $@ |