Skip to content

Commit 0a29cac

Browse files
povergoingceolin
authored andcommitted
Makefile: Make fiptool build out-of-tree
Zephyr needs fiptool compile build out-of-tree fix Zephyr #51165 Signed-off-by: Jaxson Han <[email protected]> (cherry picked from commit e4d6544) Signed-off-by: Flavio Ceolin <[email protected]>
1 parent 6896893 commit 0a29cac

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ ENCTOOL ?= ${ENCTOOLPATH}/encrypt_fw$(.exe)
107107

108108
# Variables for use with Firmware Image Package
109109
FIPTOOLPATH ?= tools/fiptool
110-
FIPTOOL ?= ${FIPTOOLPATH}/fiptool$(.exe)
110+
FIPTOOL ?= ${BUILD_PLAT}/fiptool${BIN_EXT}
111111

112112
# Variables for use with sptool
113113
SPTOOLPATH ?= tools/sptool

tools/fiptool/Makefile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@ include ${MAKE_HELPERS_DIRECTORY}defaults.mk
1111
include ${MAKE_HELPERS_DIRECTORY}toolchain.mk
1212

1313
FIPTOOL ?= fiptool$(.exe)
14-
PROJECT := $(notdir ${FIPTOOL})
15-
OBJECTS := fiptool.o tbbr_config.o
14+
PROJECT := ${FIPTOOL}
15+
PROJECT_DIR := $(dir ${FIPTOOL})
16+
OBJECTS := ${PROJECT_DIR}/fiptool.o ${PROJECT_DIR}/tbbr_config.o
1617
STATIC ?= 0
1718

1819
override CPPFLAGS += -D_GNU_SOURCE -D_XOPEN_SOURCE=700
@@ -78,7 +79,7 @@ ${PROJECT}: ${OBJECTS} Makefile
7879
$(s)echo "Built $@ successfully"
7980
$(s)echo
8081

81-
%.o: %.c Makefile
82+
${PROJECT_DIR}/%.o: %.c Makefile
8283
$(s)echo " HOSTCC $<"
8384
$(q)$(host-cc) -c ${CPPFLAGS} ${HOSTCCFLAGS} ${INCLUDE_PATHS} -MD -MP $< -o $@
8485

0 commit comments

Comments
 (0)