Skip to content

Commit eafa964

Browse files
committed
Consolidate build directory creation
Add BUILD_DIRS_ALL to aggregate $(BUILD_DIRS), $(EXTRA_C_BUILD_DIRS), $(EXTRA_CPP_BUILD_DIRS) and lib_gd32, and simplify the builddirs rule to run a single mkdir -p on this variable. Removes the conditional mkdir checks and the explicit lib_gd32 mkdir, reducing duplication and simplifying the Makefile without changing behavior.
1 parent c6abbab commit eafa964

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

firmware-template-gd32/lib/Rules.mk

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,10 @@ all : builddirs $(TARGET)
7777

7878
.PHONY: clean builddirs
7979

80+
BUILD_DIRS_ALL := $(BUILD_DIRS) $(EXTRA_C_BUILD_DIRS) $(EXTRA_CPP_BUILD_DIRS) lib_gd32
81+
8082
builddirs:
81-
mkdir -p $(BUILD_DIRS)
82-
if [[ -n "${EXTRA_C_BUILD_DIRS}" ]]; then mkdir -p $(EXTRA_C_BUILD_DIRS); fi
83-
if [[ -n "${EXTRA_CPP_BUILD_DIRS}" ]]; then mkdir -p $(EXTRA_CPP_BUILD_DIRS); fi
84-
mkdir -p lib_gd32
83+
mkdir -p $(BUILD_DIRS_ALL)
8584

8685
clean:
8786
rm -rf build_gd32

0 commit comments

Comments
 (0)