1 ## SPDX-License-Identifier: GPL-2.0-only
2 # copied from cbootimage/src/Makefile.am
3 CBOOTIMAGE_RAW_SRCS
:= \
17 t210
/nvbctlib_t210.c \
18 t132
/nvbctlib_t132.c \
19 t124
/nvbctlib_t124.c \
20 t114
/nvbctlib_t114.c \
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 \
39 t132
/nvboot_sdram_param_t132.h \
40 t210
/nvboot_bct_t210.h \
41 t210
/nvboot_sdram_param_t210.h
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
))))
45 CBOOTIMAGE_FLAGS
:=-Wall
-std
=c11
-O2
47 ifeq ($(OS_ARCH
), FreeBSD
)
48 CBOOTIMAGE_FLAGS
:=-DENODATA
=ENOATTR
51 additional-dirs
+= $(sort $(dir $(CBOOTIMAGE_OBJS
)))
53 $(objutil
)/nvidia
/cbootimage
/%.o
: util
/nvidia
/cbootimage
/src
/%.c
54 printf
" HOSTCC $(subst $(objutil)/,,$(@))\n"
55 $(HOSTCC
) $(CBOOTIMAGE_FLAGS
) -c
-o
$@
$<
57 $(CBOOTIMAGE
): $(CBOOTIMAGE_OBJS
)
58 printf
" HOSTCC $(subst $(objutil)/,,$(@)) (link)\n"
59 $(HOSTCC
) $(CBOOTIMAGE_FLAGS
) -o
$@.tmp
$^
-lm