2
0
Fork 0

Converted to msxbuild makefile and tools.

This commit is contained in:
Willem Cazander 2019-04-18 14:29:17 +02:00
parent 6b2082173b
commit deff8cf212
11 changed files with 49 additions and 132 deletions

2
.gitignore vendored
View file

@ -3,7 +3,7 @@ syntax: glob
# Project ignores
bin
bin/**
build/make/local.inc.mk
Makelocal.mk
# IDE ignores
.project

View file

@ -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
-include Makelocal.mk
include $(MB_PATH_MSXBUILD)/lib/make/msxbuild.mk
include $(INC_LIBS)
include $(INC_MODS)

9
Makelocal.mk.tpl Normal file
View file

@ -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

View file

@ -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))

View file

@ -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

View file

@ -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))

Binary file not shown.

Binary file not shown.

View file

@ -1,6 +0,0 @@
@echo "TARA: Start"
tara
@echo "TARA: Stop"

25
src/dist/0module.mk vendored
View file

@ -8,26 +8,23 @@ DIST_INC_BIN := $(patsubst %,$(DIST_BIN)/%,$(DIST_INC))
DIST_INC_SRC := $(patsubst %,$(DIST_SRC)/%,$(DIST_INC))
DIST_TARA_BIN := $(DIST_BIN)/tara.com
DIST_TARA_SRC := $(PATH_BIN)/tara/tara.com
BUILD_HELP += \\n\\t* $(DIST_OUT)
$(DIST_BIN):
$(call mod_mkdir,$(DIST_BIN))
$(call mb_mkdir,$(DIST_BIN))
$(DIST_BIN)/ALL.SR8: $(DIST_SRC)/ALL.SR8 | $(DIST_BIN)
cp $< $@;
$(call mb_copy,$<,$@)
$(DIST_BIN)/ASCII.SR8: $(DIST_SRC)/ASCII.SR8 | $(DIST_BIN)
cp $< $@;
$(call mb_copy,$<,$@)
$(DIST_BIN)/VELD.SR8: $(DIST_SRC)/VELD.SR8 | $(DIST_BIN)
cp $< $@;
$(call mb_copy,$<,$@)
$(DIST_BIN)/VELDBACK.4BP: $(DIST_SRC)/VELDBACK.4BP | $(DIST_BIN)
cp $< $@;
$(call mb_copy,$<,$@)
$(DIST_BIN)/readme.txt: $(DIST_SRC)/readme.txt | $(DIST_BIN)
cp $< $@;
#$(DIST_INC_BIN): $(DIST_INC_SRC) | $(DIST_BIN)
# cp $< $@;
$(call mb_copy,$<,$@)
$(DIST_TARA_BIN): $(DIST_TARA_SRC) | $(DIST_BIN)
cp $< $@;
$(call mb_copy,$<,$@)
$(DIST_OUT): $(DIST_INC_BIN) $(DIST_TARA_BIN)
cd $(DIST_BIN) && tar -czvf ../../$(DIST_OUT) *;
$(call mb_create_dist,$(DIST_OUT),$(DIST_BIN))

View file

@ -6,15 +6,16 @@ TARA_HEX := $(TARA_BIN)/$(TARA_NAME).hex
TARA_COM := $(TARA_BIN)/$(TARA_NAME).com
TARA_RELS := $(TARA_BIN)/$(TARA_NAME).rel
TARA_CODE := $(TARA_SRC)/$(TARA_NAME).asm
BUILD_HELP += \\n\\t* $(TARA_COM)
$(TARA_BIN):
$(call mod_mkdir,$(TARA_BIN))
$(call mb_mkdir,$(TARA_BIN))
$(TARA_BIN)/%.rel: $(TARA_SRC)/%.asm | $(TARA_BIN)
$(call mod_compile_asm,$@,$<)
$(call mb_compile_asm,$@,$<)
$(TARA_HEX): $(TARA_RELS)
$(call mod_link_asm_dos,$(TARA_HEX),$(TARA_RELS))
$(call mb_link_asm_dos,$(TARA_HEX),$(TARA_RELS))
$(TARA_COM): $(TARA_HEX)
$(call mod_hex2com,$(TARA_HEX),$(TARA_COM))
$(call mb_hex2com,$(TARA_HEX),$(TARA_COM))