From deff8cf212a61eadb3b54efb3ebdb454f71fb91c Mon Sep 17 00:00:00 2001 From: Willem Date: Thu, 18 Apr 2019 14:29:17 +0200 Subject: [PATCH] Converted to msxbuild makefile and tools. --- .gitignore | 2 +- Makefile | 62 +++++++++---------------------- Makelocal.mk.tpl | 9 +++++ build/make/env.inc.mk | 36 ------------------ build/make/local.inc.mk-template | 9 ----- src/dist-run/0module.mk | 23 +++--------- src/dist-run/COMMAND.COM | Bin 6656 -> 0 bytes src/dist-run/MSXDOS.SYS | Bin 2432 -> 0 bytes src/dist-run/autoexec.bat | 6 --- src/dist/0module.mk | 25 ++++++------- src/tara/0module.mk | 9 +++-- 11 files changed, 49 insertions(+), 132 deletions(-) create mode 100644 Makelocal.mk.tpl delete mode 100644 build/make/env.inc.mk delete mode 100644 build/make/local.inc.mk-template delete mode 100755 src/dist-run/COMMAND.COM delete mode 100755 src/dist-run/MSXDOS.SYS delete mode 100644 src/dist-run/autoexec.bat diff --git a/.gitignore b/.gitignore index 83dc8a0..2a0dc31 100644 --- a/.gitignore +++ b/.gitignore @@ -3,7 +3,7 @@ syntax: glob # Project ignores bin bin/** -build/make/local.inc.mk +Makelocal.mk # IDE ignores .project diff --git a/Makefile b/Makefile index f659e7d..60a698e 100644 --- a/Makefile +++ b/Makefile @@ -1,56 +1,28 @@ # -# Single top level makefile +# Top level makefile for tara # -rwildcard=$(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2) $(filter $(subst *,%,$2),$d)) -MODULES := $(call rwildcard, src, */0module.mk) -MODULES_LIB := $(call rwildcard, src, */0module.lib.mk) - --include build/make/local.inc.mk -include build/make/env.inc.mk -include $(MODULES_LIB) -include $(MODULES) - +rwildcard = $(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2) $(filter $(subst *,%,$2),$d)) +INC_MODS := $(call rwildcard, src, */0module.mk) +INC_LIBS := $(call rwildcard, src, */0module.lib.mk) +PATH_BIN := bin +PATH_SRC := src +BUILD_HELP := "Use one of the following build targets;\\n\\t* clean" +MB_OPENMSX_EXT := -ext video9000 .PHONY: all all: - @echo TODO: All is build. + @echo $(BUILD_HELP) -.PHONY: test -test: - @echo TODO: Testing +.PHONY: help +help: + @echo $(BUILD_HELP) .PHONY: clean clean: - @echo === Cleaning - @test $(PATH_BIN) && $(RM) -r $(PATH_BIN); + $(call mb_clean,$(PATH_BIN)) - -define mod_mkdir - @echo === Create module build folder. - $(MKDIR) $(1) -endef - -define mod_compile_asm - @echo === Compile module asm. - $(SDASM) $(SDASM_FLAGS) -I$(LIBASM_SRC)/include $(1) $(2) -endef - -define mod_link_asm_lib - @echo === Link module asm lib. - $(SDAR) $(SDAR_FLAGS) $(1) $(2) -endef - -define mod_link_asm_dos - @echo === Link module asm dos. - $(SDCC) $(SDCC_FLAG_CPU) --no-std-crt0 --code-loc 0x0100 -o $(1) $(2) -endef -#-l$(LIBASM_LINK) - -define mod_hex2com - @echo === Convert to binary - cd $(dir $(1)) && $(H2B) -e com $(notdir $(1)); - @sha1sum $(2); - @echo === Done $(notdir $(2)) -endef - \ No newline at end of file +-include Makelocal.mk +include $(MB_PATH_MSXBUILD)/lib/make/msxbuild.mk +include $(INC_LIBS) +include $(INC_MODS) diff --git a/Makelocal.mk.tpl b/Makelocal.mk.tpl new file mode 100644 index 0000000..0da8c72 --- /dev/null +++ b/Makelocal.mk.tpl @@ -0,0 +1,9 @@ +# Local included makefile fragment. +# Save this file without tpl suffix and custumize it. +# +# Change to local installations if needed; + +#MB_PATH_SDCC ?= /usr/bin +#MB_PATH_HEX2BIN ?= /usr/bin +#MB_PATH_OPENMSX ?= /opt/openMSX/bin/ +#MB_PATH_MSXBUILD ?= /opt/msxbuild diff --git a/build/make/env.inc.mk b/build/make/env.inc.mk deleted file mode 100644 index bfb6738..0000000 --- a/build/make/env.inc.mk +++ /dev/null @@ -1,36 +0,0 @@ - -# Fill in all paths -PATH_SRC ?= src -PATH_BIN ?= bin -PATH_HEX2BIN ?= /usr/bin -PATH_SDCC ?= /usr/bin -PATH_CURRENT ?= $(dir $(lastword $(MAKEFILE_LIST))) - -# Build tools -H2B ?= $(PATH_HEX2BIN)/hex2bin -SDCC ?= $(PATH_SDCC)/sdcc -SDASM ?= $(PATH_SDCC)/sdasz80 -SDAR ?= $(PATH_SDCC)/sdar - -SDCC_FLAG_CPU ?= -mz80 -SDCC_FLAG_LD ?= --nostdinc -SDASM_FLAGS ?= -g -l -c -o -SDAR_FLAGS ?= -rc - -# OS cmds -ifeq ($(OS),Windows_NT) - RM = del /F /Q - RMDIR = -RMDIR /S /Q - MKDIR = -mkdir - ERRIGNORE = 2>NUL || true - SEP=\\ -else - RM = rm -rf - RMDIR = rm -rf - MKDIR = mkdir -p - ERRIGNORE = 2>/dev/null - SEP=/ -endif - -# Remove space after separator -PSEP = $(strip $(SEP)) diff --git a/build/make/local.inc.mk-template b/build/make/local.inc.mk-template deleted file mode 100644 index 95ff77d..0000000 --- a/build/make/local.inc.mk-template +++ /dev/null @@ -1,9 +0,0 @@ -# Local env included makefile -# This file should be ignored in version control -# note: the ?= is so you can override those again in cmdline. -# -# Change to local installations. - -#PATH_SDCC ?= /usr/bin - -#PATH_HEX2BIN ?= /usr/bin diff --git a/src/dist-run/0module.mk b/src/dist-run/0module.mk index 8650fd6..8e9ff6d 100644 --- a/src/dist-run/0module.mk +++ b/src/dist-run/0module.mk @@ -2,27 +2,16 @@ DIST_RUN_NAME := dist-run DIST_RUN_BIN := $(PATH_BIN)/$(DIST_RUN_NAME) DIST_RUN_SRC := $(PATH_SRC)/$(DIST_RUN_NAME) -DIST_RUN_INC := autoexec.bat COMMAND.COM MSXDOS.SYS -DIST_RUN_INC_BIN := $(patsubst %,$(DIST_RUN_BIN)/%,$(DIST_RUN_INC)) -DIST_RUN_INC_SRC := $(patsubst %,$(DIST_RUN_SRC)/%,$(DIST_RUN_INC)) DIST_RUN_DEP_TAR := $(PATH_BIN)/dist.tar.gz DIST_RUN_DEP := $(DIST_RUN_BIN)/tara.com - +BUILD_HELP += \\n\\t* $(DIST_RUN_NAME) $(DIST_RUN_BIN): - $(call mod_mkdir,$(DIST_RUN_BIN)) - -$(DIST_RUN_BIN)/autoexec.bat: $(DIST_RUN_SRC)/autoexec.bat | $(DIST_RUN_BIN) - unix2dos -n $< $@; - -$(DIST_RUN_BIN)/COMMAND.COM: $(DIST_RUN_SRC)/COMMAND.COM | $(DIST_RUN_BIN) - cp $< $@; - -$(DIST_RUN_BIN)/MSXDOS.SYS: $(DIST_RUN_SRC)/MSXDOS.SYS | $(DIST_RUN_BIN) - cp $< $@; + $(call mb_mkdir,$(DIST_RUN_BIN)) $(DIST_RUN_DEP): $(DIST_RUN_DEP_TAR) | $(DIST_RUN_BIN) - cp $(PATH_BIN)/dist/* $(DIST_RUN_BIN); + $(call mb_copy,$(PATH_BIN)/dist/*,$(DIST_RUN_BIN)) -$(DIST_RUN_NAME): $(DIST_RUN_INC_BIN) $(DIST_RUN_DEP) - openmsx -machine Philips_NMS_8250 -ext video9000 -ext ram4mb -ext ide -diska $(DIST_RUN_BIN); +$(DIST_RUN_NAME): $(DIST_RUN_DEP) + $(call mb_copy_autoexec_run,$(DIST_RUN_BIN),tara) + $(call mb_run_openmsx_dos2,$(DIST_RUN_BIN)) diff --git a/src/dist-run/COMMAND.COM b/src/dist-run/COMMAND.COM deleted file mode 100755 index ca1330aaf040e792b1b0df502708d55595220331..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6656 zcmeHLeRx#WnZMs(GjnI|%p`L%Ksa}9AeV%|FanNam>2>?tYkunM2Zw643Gi|%?Big z#?WHf<>|I+U7vo~t@f$guU&&m8?6-s0h%GbRfMEe#S$^GH5+X}P|;lWJvU%$cmLey z*?&6o%-nO{bKbAtdEfWEGrfNbyD2}#&^#^C0Xm;9py$vrdI7zNzJ@s#aTgl$V zZeZ_Yzruct{Vw|h_J{0$u)koRWnW->*bMty_9gZ-dxkyFj%ujre(Sop`snLEI#673;+>iOpiW*dgu__lo<)e-R%N|5g09_bo)KRY-xP<%G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