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 <juan.m.cruz.alcaraz@intel.com>
This commit is contained in:
Juan Manuel Cruz 2016-08-23 15:06:38 -05:00 committed by Anas Nashif
commit 5bd398d3e3

View file

@ -739,14 +739,13 @@ export KBUILD_IMAGE ?= zephyr
zephyr-dirs := $(patsubst %/,%,$(filter %/, $(core-y) $(drivers-y) \ zephyr-dirs := $(patsubst %/,%,$(filter %/, $(core-y) $(drivers-y) \
$(libs-y))) $(libs-y)))
zephyr-app-dir-root := $(abspath $(patsubst %, %/.., $(SOURCE_DIR)))
zephyr-app-dirs := $(SOURCE_DIR) zephyr-alldirs := $(sort $(zephyr-dirs) $(SOURCE_DIR) $(patsubst %/,%,$(filter %/, \
zephyr-alldirs := $(sort $(zephyr-dirs) $(zephyr-app-dirs) $(patsubst %/,%,$(filter %/, \
$(core-) $(drivers-) $(libs-) $(app-)))) $(core-) $(drivers-) $(libs-) $(app-))))
core-y := $(patsubst %/, %/built-in.o, $(core-y)) core-y := $(patsubst %/, %/built-in.o, $(core-y))
app-y := $(patsubst %, %/built-in.o, $(notdir $(zephyr-app-dirs))) app-y := $(patsubst %, %/built-in.o, $(notdir $(SOURCE_DIR)))
drivers-y := $(patsubst %/, %/built-in.o, $(drivers-y)) drivers-y := $(patsubst %/, %/built-in.o, $(drivers-y))
libs-y1 := $(patsubst %/, %/lib.a, $(libs-y)) libs-y1 := $(patsubst %/, %/lib.a, $(libs-y))
libs-y2 := $(patsubst %/, %/built-in.o, $(libs-y)) libs-y2 := $(patsubst %/, %/built-in.o, $(libs-y))
@ -883,7 +882,7 @@ zephyr: $(zephyr-deps) $(KERNEL_BIN_NAME)
# The actual objects are generated when descending, # The actual objects are generated when descending,
# make sure no implicit rule kicks in # make sure no implicit rule kicks in
$(sort $(zephyr-deps)): $(zephyr-dirs) $(zephyr-app-dirs) ; $(sort $(zephyr-deps)): $(zephyr-dirs) zephyr-app-dir ;
# Handle descending into subdirectories listed in $(zephyr-dirs) # Handle descending into subdirectories listed in $(zephyr-dirs)
# Preset locale variables to speed up the build process. Limit locale # Preset locale variables to speed up the build process. Limit locale
@ -895,10 +894,9 @@ PHONY += $(zephyr-dirs)
$(zephyr-dirs): prepare scripts $(zephyr-dirs): prepare scripts
$(Q)$(MAKE) $(build)=$@ $(Q)$(MAKE) $(build)=$@
PHONY += $(zephyr-app-dirs) PHONY += zephyr-app-dir
$(zephyr-app-dirs): zephyr-app-dir-root = $(abspath $(patsubst %, %/.., $@)) zephyr-app-dir: prepare scripts
$(zephyr-app-dirs): prepare scripts $(Q)$(MAKE) $(build)=$(notdir $(SOURCE_DIR)) srctree=$(zephyr-app-dir-root)
$(Q)$(MAKE) $(build)=$(@F) srctree=$(zephyr-app-dir-root)
# Things we need to do before we recursively start building the kernel # Things we need to do before we recursively start building the kernel
# or the modules are listed in "prepare". # or the modules are listed in "prepare".
@ -1019,9 +1017,9 @@ clean: rm-dirs := $(CLEAN_DIRS)
clean: rm-files := $(CLEAN_FILES) clean: rm-files := $(CLEAN_FILES)
clean-dirs := $(addprefix _clean_, . $(zephyr-alldirs) ) clean-dirs := $(addprefix _clean_, . $(zephyr-alldirs) )
PHONY += $(clean-dirs) clean archclean zephyrclean PHONY += clean-dirs-target clean archclean zephyrclean
$(clean-dirs): clean-dirs-target:
$(Q)$(MAKE) $(clean)=$(patsubst _clean_%,%,$@) $(Q)$(MAKE) $(clean)=$(patsubst _clean_%,%,$(clean-dirs))
clean: archclean clean: archclean
@ -1134,7 +1132,7 @@ $(help-board-dirs): help-%:
%docs: FORCE %docs: FORCE
$(Q)$(MAKE) -C doc htmldocs $(Q)$(MAKE) -C doc htmldocs
clean: $(clean-dirs) clean: clean-dirs-target
$(call cmd,rmdirs) $(call cmd,rmdirs)
$(call cmd,rmfiles) $(call cmd,rmfiles)
@find $(if $(KBUILD_EXTMOD), $(KBUILD_EXTMOD), .) $(RCS_FIND_IGNORE) \ @find $(if $(KBUILD_EXTMOD), $(KBUILD_EXTMOD), .) $(RCS_FIND_IGNORE) \