From 1c338e73c5384ecd870fb2d80513b4a121b4d99d Mon Sep 17 00:00:00 2001 From: Vincent Barrilliot Date: Thu, 7 Dec 2023 21:52:50 +0100 Subject: [PATCH] More Windows path separator support --- src/Makefile | 42 ++++++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/src/Makefile b/src/Makefile index 55c403c..7e72fb6 100644 --- a/src/Makefile +++ b/src/Makefile @@ -8,8 +8,23 @@ MEMORY := ram # The script expects the following environment variables to be set: # VBCC: path to VBCC distribution -#UNIT := C256U_PLUS -#MEMORY := RAM +# Define OS-dependent tools --------------------------------------------------- +ifeq ("$(PAD_FLASH_SIZE)","") + # When compiling an image for flash, size to which the image must be padded + PAD_FLASH_SIZE = 524288 +endif +ifeq ($(OS),Windows_NT) + RM = del /F/Q + PAD_CMD = fsutil file seteof $@ $(PAD_FLASH_SIZE) + SEP= \$ # Leave this as is, it's a trick + PYTHON3=python +else + RM = rm -f + PAD_CMD = truncate -s $(PAD_FLASH_SIZE) $@ + SEP = / + PYTHON3=python3 +endif + # The below doesn't seem true ! # CPU_WDC65816 0x16 /* CPU code for the Western Design Center 65816 */ @@ -120,6 +135,9 @@ else endif INCLUDES = -I. -I$(CURDIR)/include -I$(CURDIR) +ifeq ($(OS),Windows_NT) + INCLUDES := $(subst /,$(SEP),$(INCLUDES)) +endif # Toolchain selection --------------------------------------------------------- @@ -167,6 +185,8 @@ else endif ifneq ($(OS),Windows_NT) CFG_FILE := $(CFG_FILE)_linux + else + CFG_FILE := $(subst /,$(SEP),$(CFG_FILE)) endif ASFLAGS = -Fvobj -nowarn=62 $(VASM_CPU) -quiet @@ -180,24 +200,6 @@ else endif -# Define OS-dependent tools --------------------------------------------------- -ifeq ("$(PAD_FLASH_SIZE)","") - # When compiling an image for flash, size to which the image must be padded - PAD_FLASH_SIZE = 524288 -endif -ifeq ($(OS),Windows_NT) - RM = del /F/Q - PAD_CMD = fsutil file seteof $@ $(PAD_FLASH_SIZE) - SEP= \$ # Leave this as is, it's a trick - PYTHON3=python -else - RM = rm -f - PAD_CMD = truncate -s $(PAD_FLASH_SIZE) $@ - SEP = / - PYTHON3=python3 -endif - - # Flags (are automatically used by make) -------------------------------------- ASFLAGS := $(ASFLAGS) $(DEFINES) $(INCLUDES) CFLAGS := $(CFLAGS) $(DEFINES) $(INCLUDES)