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