1
0
mirror of https://github.com/cc65/cc65.git synced 2024-12-22 12:30:41 +00:00

Use --print-target-path only as last resort.

--print-target-path may return a path with (escaped) spaces. We'll use that path with $(wildcard ...), that's fine. But then we use the outcome with $(foreach ...) and there things fail badly and there's nothing to do about it.

Therefore we a) try to avoid --print-target-path in the first place and b) explicitly bail out if we end up with spaces.
This commit is contained in:
Oliver Schmidt 2018-06-08 18:58:36 +02:00
parent d861be8ad5
commit 9877042450

View File

@ -35,7 +35,15 @@ else
endif
ifneq ($(filter disk samples.%,$(MAKECMDGOALS)),)
TARGET_PATH := $(shell $(CL) --print-target-path)
ifdef CC65_HOME
TARGET_PATH = $(CC65_HOME)/target
else
TARGET_PATH := $(if $(wildcard ../target),../target,$(shell $(CL) --print-target-path))
endif
ifneq ($(words $(TARGET_PATH)),1)
$(error No space chars allowed in "$(TARGET_PATH)")
endif
EMD := $(wildcard $(TARGET_PATH)/$(SYS)/drv/emd/*)
MOU := $(wildcard $(TARGET_PATH)/$(SYS)/drv/mou/*)