Skip to content

Commit c9fa913

Browse files
authored
Merge pull request #22225 from maribu/dist/tools/riotboot_gen_hdr/build_dir
dist/tools/riotboot_gen_hdr: use $BUILD_DIR to build in
2 parents 217598c + ba715e6 commit c9fa913

2 files changed

Lines changed: 10 additions & 7 deletions

File tree

dist/tools/riotboot_gen_hdr/Makefile

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
RIOTBASE := ../../..
2+
BUILD_DIR ?= $(RIOTBASE)/build
3+
GENHDR_BINDIR := $(BUILD_DIR)/genhdr
24
RIOT_INCLUDE := $(RIOTBASE)/sys/include
35
RIOT_CORE_INC := $(RIOTBASE)/core/include
46
NATIVE_INCLUDE := $(RIOTBASE)/cpu/native/include
@@ -26,16 +28,16 @@ else
2628
Q=
2729
endif
2830

29-
all: bin/genhdr
31+
all: $(GENHDR_BINDIR)/genhdr
3032

31-
bin/:
32-
$(Q)mkdir -p bin
33+
$(GENHDR_BINDIR)/:
34+
$(Q)mkdir -p "$@"
3335

34-
bin/genhdr: $(GENHDR_HDR) $(GENHDR_SRC) Makefile | bin/
36+
$(GENHDR_BINDIR)/genhdr: $(GENHDR_HDR) $(GENHDR_SRC) Makefile | $(GENHDR_BINDIR)/
3537
$(Q)$(CC) $(CFLAGS) -I$(RIOT_INCLUDE) -I$(RIOT_CORE_INC) \
3638
-I$(NATIVE_INCLUDE) $(GENHDR_SRC) -o $@
3739

3840
clean:
39-
$(Q)rm -rf bin/
41+
$(Q)rm -rf $(GENHDR_BINDIR)
4042

4143
distclean: clean

makefiles/boot/riotboot.mk

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ RIOTBOOT_DIR = $(RIOTBASE)/bootloaders/riotboot
77
RIOTBOOT ?= $(RIOTBOOT_DIR)/bin/$(BOARD)/riotboot.elf
88
CFLAGS += -I$(BINDIR)/riotbuild
99

10-
HEADER_TOOL_DIR = $(RIOTBASE)/dist/tools/riotboot_gen_hdr
11-
HEADER_TOOL ?= $(HEADER_TOOL_DIR)/bin/genhdr
10+
HEADER_TOOL_DIR = $(RIOTTOOLS)/riotboot_gen_hdr
11+
HEADER_TOOL ?= $(BUILD_DIR)/genhdr/genhdr
1212
BINDIR_RIOTBOOT = $(BINDIR)/riotboot_files
1313

1414
$(BINDIR_RIOTBOOT): $(CLEAN)
@@ -58,6 +58,7 @@ $(HEADER_TOOL): FORCE
5858
$(Q)/usr/bin/env -i \
5959
QUIET=$(QUIET) \
6060
PATH="$(PATH)" \
61+
BUILD_DIR="$(BUILD_DIR)" \
6162
$(MAKE) --no-print-directory -C $(HEADER_TOOL_DIR) all
6263

6364
# Generate RIOT header and keep the original binary file

0 commit comments

Comments
 (0)