Skip to content

Commit 5bd398d

Browse files
jmnlcruzAnas Nashif
authored andcommitted
win-build: Fixes Makefile target names including char ":"
The build system uses absolute path names to generate target names. In Windows, absolute path names include the character ":". Makefile does not support target names with the character ":" on them. The target names involved are PHONY. The commit modifies the Makefile logic to not include directory names in zephyr-app-dirs and clean-dirs targets. Jira: ZEP-517 Change-Id: I37b62f04b8bc6bffbbc19e0e4fd2a827347e5cbd Signed-off-by: Juan Manuel Cruz <[email protected]>
1 parent 2bf22ae commit 5bd398d

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

Makefile

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -739,14 +739,13 @@ export KBUILD_IMAGE ?= zephyr
739739

740740
zephyr-dirs := $(patsubst %/,%,$(filter %/, $(core-y) $(drivers-y) \
741741
$(libs-y)))
742+
zephyr-app-dir-root := $(abspath $(patsubst %, %/.., $(SOURCE_DIR)))
742743

743-
zephyr-app-dirs := $(SOURCE_DIR)
744-
745-
zephyr-alldirs := $(sort $(zephyr-dirs) $(zephyr-app-dirs) $(patsubst %/,%,$(filter %/, \
744+
zephyr-alldirs := $(sort $(zephyr-dirs) $(SOURCE_DIR) $(patsubst %/,%,$(filter %/, \
746745
$(core-) $(drivers-) $(libs-) $(app-))))
747746

748747
core-y := $(patsubst %/, %/built-in.o, $(core-y))
749-
app-y := $(patsubst %, %/built-in.o, $(notdir $(zephyr-app-dirs)))
748+
app-y := $(patsubst %, %/built-in.o, $(notdir $(SOURCE_DIR)))
750749
drivers-y := $(patsubst %/, %/built-in.o, $(drivers-y))
751750
libs-y1 := $(patsubst %/, %/lib.a, $(libs-y))
752751
libs-y2 := $(patsubst %/, %/built-in.o, $(libs-y))
@@ -883,7 +882,7 @@ zephyr: $(zephyr-deps) $(KERNEL_BIN_NAME)
883882

884883
# The actual objects are generated when descending,
885884
# make sure no implicit rule kicks in
886-
$(sort $(zephyr-deps)): $(zephyr-dirs) $(zephyr-app-dirs) ;
885+
$(sort $(zephyr-deps)): $(zephyr-dirs) zephyr-app-dir ;
887886

888887
# Handle descending into subdirectories listed in $(zephyr-dirs)
889888
# Preset locale variables to speed up the build process. Limit locale
@@ -895,10 +894,9 @@ PHONY += $(zephyr-dirs)
895894
$(zephyr-dirs): prepare scripts
896895
$(Q)$(MAKE) $(build)=$@
897896

898-
PHONY += $(zephyr-app-dirs)
899-
$(zephyr-app-dirs): zephyr-app-dir-root = $(abspath $(patsubst %, %/.., $@))
900-
$(zephyr-app-dirs): prepare scripts
901-
$(Q)$(MAKE) $(build)=$(@F) srctree=$(zephyr-app-dir-root)
897+
PHONY += zephyr-app-dir
898+
zephyr-app-dir: prepare scripts
899+
$(Q)$(MAKE) $(build)=$(notdir $(SOURCE_DIR)) srctree=$(zephyr-app-dir-root)
902900

903901
# Things we need to do before we recursively start building the kernel
904902
# or the modules are listed in "prepare".
@@ -1019,9 +1017,9 @@ clean: rm-dirs := $(CLEAN_DIRS)
10191017
clean: rm-files := $(CLEAN_FILES)
10201018
clean-dirs := $(addprefix _clean_, . $(zephyr-alldirs) )
10211019

1022-
PHONY += $(clean-dirs) clean archclean zephyrclean
1023-
$(clean-dirs):
1024-
$(Q)$(MAKE) $(clean)=$(patsubst _clean_%,%,$@)
1020+
PHONY += clean-dirs-target clean archclean zephyrclean
1021+
clean-dirs-target:
1022+
$(Q)$(MAKE) $(clean)=$(patsubst _clean_%,%,$(clean-dirs))
10251023

10261024
clean: archclean
10271025

@@ -1134,7 +1132,7 @@ $(help-board-dirs): help-%:
11341132
%docs: FORCE
11351133
$(Q)$(MAKE) -C doc htmldocs
11361134

1137-
clean: $(clean-dirs)
1135+
clean: clean-dirs-target
11381136
$(call cmd,rmdirs)
11391137
$(call cmd,rmfiles)
11401138
@find $(if $(KBUILD_EXTMOD), $(KBUILD_EXTMOD), .) $(RCS_FIND_IGNORE) \

0 commit comments

Comments
 (0)