2
0
Fork 0

Renamed function and made safe.

This commit is contained in:
Willem Cazander 2024-07-10 23:00:29 +02:00
parent 8578c8eee5
commit 54dec85047
13 changed files with 88 additions and 81 deletions

View file

@ -1,10 +1,6 @@
#
# Top level makefile for dome
#
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_ALL := "Use 'make help' for possible targets."
@ -13,19 +9,21 @@ BUILD_HELP := "Use one of the following build targets;"
.SUFFIXES:
.PHONY: all
all:
@echo $(BUILD_ALL)
@echo -e $(BUILD_ALL)
BUILD_HELP += \\n\\t* help
.PHONY: help
help:
@echo $(BUILD_HELP)
@echo -e $(BUILD_HELP)
BUILD_HELP += \\n\\t* clean
.PHONY: clean
clean:
$(call mb_clean,$(PATH_BIN))
$(call mb_make_call,mb_os_dir_delete,$(PATH_BIN))
-include Makelocal.mk
include $(PATH_MSXBUILD)/lib/make/msxbuild-prolog.mk
include $(PATH_MSXBUILD)/lib/make/msxbuild.mk
include $(INC_LIBS)
include $(INC_MODS)
.RECIPEPREFIX :=
$(call mb_make_call,mb_make_flow_0module,$(PATH_SRC))

View file

@ -3,7 +3,7 @@
#
# Change to local installations if needed;
#PATH_SDCC ?= /usr/bin
#PATH_OPENMSX ?= /opt/openMSX/bin/
#MB_SDCC_PATH ?= /usr/bin
#MB_OPENMSX_PATH ?= /opt/openMSX/bin/
#PATH_MSXBUILD ?= /opt/msxbuild

View file

@ -9,13 +9,13 @@ BIOS_CODE := $(BIOS_SRC)/$(BIOS_NAME).asm
BUILD_HELP += \\n\\t* $(BIOS_DAT)
$(BIOS_BIN):
$(call mb_mkdir,$(BIOS_BIN))
$(call mb_make_call,mb_os_dir_create,$(BIOS_BIN))
$(BIOS_BIN)/%.rel: $(BIOS_SRC)/%.asm | $(BIOS_BIN)
$(call mb_sdcc_compile_asm,$<,$@)
$(call mb_make_call,mb_sdcc_compile_asm,$<,$@)
$(BIOS_HEX): $(BIOS_RELS)
$(call mb_sdcc_link_asm_bdos,$<,$@)
$(call mb_make_call,mb_sdcc_link_asm_bdos,$<,$@)
$(BIOS_DAT): $(BIOS_HEX)
$(call mb_sdcc_hex2bin,$<,$@)
$(call mb_make_call,mb_sdcc_objcopy,$<,$@)

View file

@ -7,7 +7,7 @@ DIST_RUN_INC_BIN := $(patsubst %,$(DIST_RUN_BIN)/%,$(DIST_RUN_INC))
BUILD_HELP += \\n\\t* $(DIST_RUN_NAME)\\n\\t* $(DIST_RUN_BIN)/@flight-video
$(DIST_RUN_BIN):
$(call mb_mkdir,$(DIST_RUN_BIN))
$(call mb_make_call,mb_os_dir_create,$(DIST_RUN_BIN))
$(DIST_RUN_BIN)/init.com: bin/init/init.com | $(DIST_RUN_BIN)
cp $< $@;
@ -20,8 +20,8 @@ $(DIST_RUN_BIN)/dome.000: bin/domelib/dome.000 | $(DIST_RUN_BIN)
cp src/gfx/org/*.zop $(DIST_RUN_BIN);
$(DIST_RUN_NAME): $(DIST_RUN_INC_BIN)
$(call mb_msxpipe_run_gui_mouse,$(DIST_RUN_BIN),init)
$(call mb_make_call,mb_msxpipe_run_gui_mouse,$(DIST_RUN_BIN),init)
.PHONY: $(DIST_RUN_BIN)/@flight-video
$(DIST_RUN_BIN)/@flight-video:
$(if $(filter on,$(MB_FLIGHT_VIDEO)),$(call mb_create_flight_video,$(PATH_BIN)))
$(if $(filter on,$(MB_FLIGHT_VIDEO)),$(call mb_make_call,mb_flight_video_merge,$(PATH_BIN)))

View file

@ -11,13 +11,14 @@ BUILD_HELP += \\n\\t* $(DOME_DAT)
# TODO fix build trigger on ai_new.asm
$(DOME_BIN):
$(call mb_mkdir,$(DOME_BIN))
$(call mb_make_call,mb_os_dir_create,$(DOME_BIN))
$(DOME_BIN)/%.rel: $(DOME_SRC)/%.asm | $(DOME_BIN)
$(call mb_sdcc_compile_asm,$<,$@)
$(call mb_make_call,mb_sdcc_compile_asm,$<,$@)
$(DOME_HEX): $(DOME_RELS)
$(call mb_sdcc_link_asm_8000,$<,$@)
$(call mb_make_call,mb_sdcc_link_asm_8000,$<,$@)
$(DOME_DAT): $(DOME_HEX)
$(call mb_sdcc_hex2bin,$<,$@)
$(call mb_make_call,mb_sdcc_objcopy,$<,$@)

View file

@ -12,8 +12,8 @@ $(PATH_BIN)/makelib/makelib.com \
$(PATH_BIN)/menu/menu.dat \
$(PATH_BIN)/mmenu/mmenu.dat
$(DOMELIB_BIN):
$(call mb_mkdir,$(DOMELIB_BIN))
$(DOMELIB_BIN): | gfx
$(call mb_make_call,mb_os_dir_create,$(DOMELIB_BIN))
$(DOMELIB_BIN)/bios.dat: $(PATH_BIN)/bios/bios.dat | $(DOMELIB_BIN)
cp $< $@;
@ -21,7 +21,7 @@ $(DOMELIB_BIN)/dome.dat: $(PATH_BIN)/dome/dome.dat | $(DOMELIB_BIN)
cp $< $@;
$(DOMELIB_BIN)/loader.dat: $(PATH_BIN)/loader/loader.dat | $(DOMELIB_BIN)
cp $< $@;
$(DOMELIB_BIN)/makelib.com: $(PATH_BIN)/makelib/makelib.com bin/levels/code.001 bin/levels/code.002 | $(DOMELIB_BIN) gfx
$(DOMELIB_BIN)/makelib.com: $(PATH_BIN)/makelib/makelib.com bin/levels/code.001 bin/levels/code.002 | $(DOMELIB_BIN)
cp $< $@;
cp bin/gfx/*.zop $(DOMELIB_BIN);
cp bin/levels/*.00* $(DOMELIB_BIN);
@ -35,10 +35,11 @@ $(DOMELIB_BIN)/mmenu.dat: $(PATH_BIN)/mmenu/mmenu.dat | $(DOMELIB_BIN)
$(DOMELIB_OUT): $(DOMELIB_BIN)/bios.dat $(DOMELIB_BIN)/dome.dat $(DOMELIB_BIN)/loader.dat $(DOMELIB_BIN)/makelib.com $(DOMELIB_BIN)/menu.dat $(DOMELIB_BIN)/mmenu.dat
@echo === Generating autoexec.bat for command
$(call mb_autoexec_write_default,$(DOMELIB_BIN))
$(call mb_autoexec_append_echo,$(DOMELIB_BIN),Setup timeout for makelib)
$(call mb_autoexec_append_cmd,$(DOMELIB_BIN),omsxctl fail_after 120 seconds failed_makelib 126)
$(call mb_autoexec_append_echo,$(DOMELIB_BIN),Running command makelib)
$(call mb_autoexec_append_cmd,$(DOMELIB_BIN),makelib)
$(call mb_autoexec_append_exit,$(DOMELIB_BIN))
$(call mb_openmsx_dosctl,$(DOMELIB_BIN))
$(call mb_make_call,mb_autoexec_write_default,$(DOMELIB_BIN))
$(call mb_make_call,mb_autoexec_append_echo,$(DOMELIB_BIN),Setup timeout for makelib)
$(call mb_make_call,mb_autoexec_append_cmd,$(DOMELIB_BIN),omsxctl fail_after 120 seconds failed_makelib 126)
$(call mb_make_call,mb_autoexec_append_echo,$(DOMELIB_BIN),Running command makelib)
$(call mb_make_call,mb_autoexec_append_cmd,$(DOMELIB_BIN),makelib)
$(call mb_make_call,mb_autoexec_append_exit,$(DOMELIB_BIN))
$(call mb_make_call,mb_openmsx_dosctl,$(DOMELIB_BIN))

View file

@ -2,7 +2,7 @@
GFX_NAME := gfx
GFX_SRC := $(PATH_SRC)/$(GFX_NAME)
GFX_BIN := $(PATH_BIN)/$(GFX_NAME)
GFX_SRC_FILES := $(call rwildcard, $(PATH_SRC)/$(GFX_NAME), *.ge5)
GFX_SRC_FILES := $(call mb_make_call,mb_make_rwildcard, $(PATH_SRC)/$(GFX_NAME), *.ge5)
GFX_BIN_FILES := $(patsubst $(PATH_SRC)/$(GFX_NAME)/%.ge5,$(GFX_BIN)/%.zop,$(GFX_SRC_FILES))
BUILD_HELP += \\n\\t* gfx / test-gfx
@ -19,32 +19,33 @@ BUILD_HELP += \\n\\t* gfx / test-gfx
#
$(GFX_BIN):
$(call mb_mkdir,$(GFX_BIN))
$(call mb_msxhub_get_popcom,$(GFX_BIN))
$(call mb_make_call,mb_os_dir_create,$(GFX_BIN))
$(call mb_make_call,mb_msxhub_get_popcom,$(GFX_BIN))
$(GFX_BIN)/%.zop: $(GFX_SRC)/%.ge5 | $(GFX_BIN)
cp $< $(GFX_BIN)
$(call mb_autoexec_write_default,$(GFX_BIN))
$(call mb_autoexec_append_cmd,$(GFX_BIN),omsxctl fail_after 60 seconds fail_basic_script 126 > NUL)
$(call mb_autoexec_append_echo,$(GFX_BIN),Running basic conversion step)
$(call mb_autoexec_append_cmd,$(GFX_BIN),basic conv.bas)
$(call mb_make_call,mb_autoexec_write_default,$(GFX_BIN))
$(call mb_make_call,mb_autoexec_append_cmd,$(GFX_BIN),omsxctl fail_after 60 seconds fail_basic_script 126 > NUL)
$(call mb_make_call,mb_autoexec_append_echo,$(GFX_BIN),Running basic conversion step)
$(call mb_make_call,mb_autoexec_append_cmd,$(GFX_BIN),basic conv.bas)
@echo "10 SCREEN 5 : SETPAGE 1,1\r" > $(GFX_BIN)/conv.bas;
@echo "20 BLOAD\"$(notdir $<)\",S : COLOR=RESTORE\r" >> $(GFX_BIN)/conv.bas;
@echo "30 BSAVE\"$(notdir $@)\",&H0000,&H7FFF,S\r" >> $(GFX_BIN)/conv.bas;
@echo "40 _SYSTEM(\"pop.bat\")\r" >> $(GFX_BIN)/conv.bas;
@echo -e "10 SCREEN 5 : SETPAGE 1,1\r" > $(GFX_BIN)/conv.bas;
@echo -e "20 BLOAD\"$(notdir $<)\",S : COLOR=RESTORE\r" >> $(GFX_BIN)/conv.bas;
@echo -e "30 BSAVE\"$(notdir $@)\",&H0000,&H7FFF,S\r" >> $(GFX_BIN)/conv.bas;
@echo -e "40 _SYSTEM(\"pop.bat\")\r" >> $(GFX_BIN)/conv.bas;
@echo "\r" > $(GFX_BIN)/pop.bat;
@echo "mode 80 > NUL\r" >> $(GFX_BIN)/pop.bat;
@echo "omsxctl fail_after 120 seconds fail_popcom 126 > NUL\r" >> $(GFX_BIN)/pop.bat;
@echo "popcom $(notdir $@)\r" >> $(GFX_BIN)/pop.bat;
@echo "echo \"All done..................\"\r" >> $(GFX_BIN)/pop.bat;
@echo "omsxctl exit\r" >> $(GFX_BIN)/pop.bat;
@echo -e "\r" > $(GFX_BIN)/pop.bat;
@echo -e "mode 80 > NUL\r" >> $(GFX_BIN)/pop.bat;
@echo -e "omsxctl fail_after 120 seconds fail_popcom 126 > NUL\r" >> $(GFX_BIN)/pop.bat;
@echo -e "popcom $(notdir $@)\r" >> $(GFX_BIN)/pop.bat;
@echo -e "echo \"All done..................\"\r" >> $(GFX_BIN)/pop.bat;
@echo -e "omsxctl exit\r" >> $(GFX_BIN)/pop.bat;
$(call mb_openmsx_dosctl,$(GFX_BIN))
$(call mb_make_call,mb_openmsx_dosctl,$(GFX_BIN))
test-gfx: gfx
$(call mb_msxpipe_run_gui,$(GFX_BIN))
$(call mb_make_call,mb_msxpipe_run_gui,$(GFX_BIN))
gfx: $(GFX_BIN_FILES)
echo All GFX are compressed.

View file

@ -9,13 +9,14 @@ INIT_CODE := $(INIT_SRC)/$(INIT_NAME).asm
BUILD_HELP += \\n\\t* $(INIT_COM)
$(INIT_BIN):
$(call mb_mkdir,$(INIT_BIN))
$(call mb_make_call,mb_os_dir_create,$(INIT_BIN))
$(INIT_BIN)/%.rel: $(INIT_SRC)/%.asm | $(INIT_BIN)
$(call mb_sdcc_compile_asm,$<,$@)
$(call mb_make_call,mb_sdcc_compile_asm,$<,$@)
$(INIT_HEX): $(INIT_RELS)
$(call mb_sdcc_link_asm_bdos,$<,$@)
$(call mb_make_call,mb_sdcc_link_asm_bdos,$<,$@)
$(INIT_COM): $(INIT_HEX)
$(call mb_sdcc_hex2bin,$<,$@)
$(call mb_make_call,mb_sdcc_objcopy,$<,$@)

View file

@ -5,30 +5,31 @@ LEVELS_BIN := $(PATH_BIN)/$(LEVELS_NAME)
BUILD_HELP += \\n\\t* $(LEVELS_BIN)/code.001 / $(LEVELS_BIN)/code.002
$(LEVELS_BIN):
$(call mb_mkdir,$(LEVELS_BIN))
$(call mb_copy,$(LEVELS_SRC)/*.00*,$(LEVELS_BIN))
$(call mb_make_call,mb_os_dir_create,$(LEVELS_BIN))
$(call mb_make_call,mb_os_file_copy,$(LEVELS_SRC)/*.00*,$(LEVELS_BIN))
#cp $(LEVELS_SRC)/*.00* $(LEVELS_BIN);
$(LEVELS_BIN)/code001.rel: $(LEVELS_SRC)/code001.asm | $(LEVELS_BIN)
$(call mb_sdcc_compile_asm,$<,$@)
$(call mb_make_call,mb_sdcc_compile_asm,$<,$@)
$(LEVELS_BIN)/code002.rel: $(LEVELS_SRC)/code001.asm | $(LEVELS_BIN)
$(call mb_sdcc_compile_asm,$<,$@)
$(call mb_make_call,mb_sdcc_compile_asm,$<,$@)
$(LEVELS_BIN)/code001.hex: $(LEVELS_BIN)/code001.rel
$(call mb_sdcc_link_asm_1000,$<,$@)
$(call mb_make_call,mb_sdcc_link_asm_1000,$<,$@)
$(LEVELS_BIN)/code002.hex: $(LEVELS_BIN)/code002.rel
$(call mb_sdcc_link_asm_1000,$<,$@)
$(call mb_make_call,mb_sdcc_link_asm_1000,$<,$@)
$(LEVELS_BIN)/code001.dat: $(LEVELS_BIN)/code001.hex
$(call mb_sdcc_hex2bin,$<,$@)
$(call mb_make_call,mb_sdcc_objcopy,$<,$@)
$(LEVELS_BIN)/code002.dat: $(LEVELS_BIN)/code002.hex
$(call mb_sdcc_hex2bin,$<,$@)
$(call mb_make_call,mb_sdcc_objcopy,$<,$@)
$(LEVELS_BIN)/code.001: $(LEVELS_BIN)/code001.dat
$(call mb_copy,$<,$@)
$(call mb_make_call,mb_os_file_copy,$<,$@)
$(LEVELS_BIN)/code.002: $(LEVELS_BIN)/code002.dat
$(call mb_copy,$<,$@)
$(call mb_make_call,mb_os_file_copy,$<,$@)

View file

@ -9,13 +9,14 @@ LOADER_CODE := $(LOADER_SRC)/$(LOADER_NAME).asm
BUILD_HELP += \\n\\t* $(LOADER_DAT)
$(LOADER_BIN):
$(call mb_mkdir,$(LOADER_BIN))
$(call mb_make_call,mb_os_dir_create,$(LOADER_BIN))
$(LOADER_BIN)/%.rel: $(LOADER_SRC)/%.asm | $(LOADER_BIN)
$(call mb_sdcc_compile_asm,$<,$@)
$(call mb_make_call,mb_sdcc_compile_asm,$<,$@)
$(LOADER_HEX): $(LOADER_RELS)
$(call mb_sdcc_link_asm_8000,$<,$@)
$(call mb_make_call,mb_sdcc_link_asm_8000,$<,$@)
$(LOADER_DAT): $(LOADER_HEX)
$(call mb_sdcc_hex2bin,$<,$@)
$(call mb_make_call,mb_sdcc_objcopy,$<,$@)

View file

@ -9,13 +9,14 @@ MAKELIB_CODE := $(MAKELIB_SRC)/$(MAKELIB_NAME).asm
BUILD_HELP += \\n\\t* $(MAKELIB_COM)
$(MAKELIB_BIN):
$(call mb_mkdir,$(MAKELIB_BIN))
$(call mb_make_call,mb_os_dir_create,$(MAKELIB_BIN))
$(MAKELIB_BIN)/%.rel: $(MAKELIB_SRC)/%.asm | $(MAKELIB_BIN)
$(call mb_sdcc_compile_asm,$<,$@)
$(call mb_make_call,mb_sdcc_compile_asm,$<,$@)
$(MAKELIB_HEX): $(MAKELIB_RELS)
$(call mb_sdcc_link_asm_bdos,$<,$@)
$(call mb_make_call,mb_sdcc_link_asm_bdos,$<,$@)
$(MAKELIB_COM): $(MAKELIB_HEX)
$(call mb_sdcc_hex2bin,$<,$@)
$(call mb_make_call,mb_sdcc_objcopy,$<,$@)

View file

@ -9,13 +9,14 @@ MENU_CODE := $(MENU_SRC)/$(MENU_NAME).asm
BUILD_HELP += \\n\\t* $(MENU_DAT)
$(MENU_BIN):
$(call mb_mkdir,$(MENU_BIN))
$(call mb_make_call,mb_os_dir_create,$(MENU_BIN))
$(MENU_BIN)/%.rel: $(MENU_SRC)/%.asm | $(MENU_BIN)
$(call mb_sdcc_compile_asm,$<,$@)
$(call mb_make_call,mb_sdcc_compile_asm,$<,$@)
$(MENU_HEX): $(MENU_RELS)
$(call mb_sdcc_link_asm_8000,$<,$@)
$(call mb_make_call,mb_sdcc_link_asm_8000,$<,$@)
$(MENU_DAT): $(MENU_HEX)
$(call mb_sdcc_hex2bin,$<,$@)
$(call mb_make_call,mb_sdcc_objcopy,$<,$@)

View file

@ -9,13 +9,14 @@ MMENU_CODE := $(MMENU_SRC)/$(MMENU_NAME).asm
BUILD_HELP += \\n\\t* $(MMENU_DAT)
$(MMENU_BIN):
$(call mb_mkdir,$(MMENU_BIN))
$(call mb_make_call,mb_os_dir_create,$(MMENU_BIN))
$(MMENU_BIN)/%.rel: $(MMENU_SRC)/%.asm | $(MMENU_BIN)
$(call mb_sdcc_compile_asm,$<,$@)
$(call mb_make_call,mb_sdcc_compile_asm,$<,$@)
$(MMENU_HEX): $(MMENU_RELS)
$(call mb_sdcc_link_asm_4000,$<,$@)
$(call mb_make_call,mb_sdcc_link_asm_4000,$<,$@)
$(MMENU_DAT): $(MMENU_HEX)
$(call mb_sdcc_hex2bin,$<,$@)
$(call mb_make_call,mb_sdcc_objcopy,$<,$@)