Skip to content

Commit

Permalink
win-build: Fixes Makefile target names including char ":"
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
jmnlcruz authored and Anas Nashif committed Aug 25, 2016
1 parent 2bf22ae commit 5bd398d
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -739,14 +739,13 @@ export KBUILD_IMAGE ?= zephyr

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

zephyr-app-dirs := $(SOURCE_DIR)

zephyr-alldirs := $(sort $(zephyr-dirs) $(zephyr-app-dirs) $(patsubst %/,%,$(filter %/, \
zephyr-alldirs := $(sort $(zephyr-dirs) $(SOURCE_DIR) $(patsubst %/,%,$(filter %/, \
$(core-) $(drivers-) $(libs-) $(app-))))

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))
libs-y1 := $(patsubst %/, %/lib.a, $(libs-y))
libs-y2 := $(patsubst %/, %/built-in.o, $(libs-y))
Expand Down Expand Up @@ -883,7 +882,7 @@ zephyr: $(zephyr-deps) $(KERNEL_BIN_NAME)

# The actual objects are generated when descending,
# 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)
# Preset locale variables to speed up the build process. Limit locale
Expand All @@ -895,10 +894,9 @@ PHONY += $(zephyr-dirs)
$(zephyr-dirs): prepare scripts
$(Q)$(MAKE) $(build)=$@

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

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

PHONY += $(clean-dirs) clean archclean zephyrclean
$(clean-dirs):
$(Q)$(MAKE) $(clean)=$(patsubst _clean_%,%,$@)
PHONY += clean-dirs-target clean archclean zephyrclean
clean-dirs-target:
$(Q)$(MAKE) $(clean)=$(patsubst _clean_%,%,$(clean-dirs))

clean: archclean

Expand Down Expand Up @@ -1134,7 +1132,7 @@ $(help-board-dirs): help-%:
%docs: FORCE
$(Q)$(MAKE) -C doc htmldocs

clean: $(clean-dirs)
clean: clean-dirs-target
$(call cmd,rmdirs)
$(call cmd,rmfiles)
@find $(if $(KBUILD_EXTMOD), $(KBUILD_EXTMOD), .) $(RCS_FIND_IGNORE) \
Expand Down

0 comments on commit 5bd398d

Please sign in to comment.