omsxctl/Makefile

71 lines
2 KiB
Makefile
Raw Normal View History

2020-05-01 02:00:32 +00:00
-include Makelocal.mk
PATH_SDCC ?= /usr/bin
PATH_BIN := bin
BUILD_ALL := "Use 'make help' for possible targets."
BUILD_HELP := "Use one of the following build targets;"
BUILD_VERSION ?= 1.0
BUILD_NAME := omsxctl-$(BUILD_VERSION)
2020-05-01 02:34:54 +00:00
.SUFFIXES:
2020-05-01 02:00:32 +00:00
.PHONY: all
all:
@echo $(BUILD_ALL)
BUILD_HELP += \\n\\t* help
.PHONY: help
help:
@echo $(BUILD_HELP)
BUILD_HELP += \\n\\t* clean
.PHONY: clean
clean:
rm bin -rf
bin/omsxctl:
mkdir -p bin/omsxctl
bin/omsxctl/%.rel: src/%.asm | bin/omsxctl
$(PATH_SDCC)/sdasz80 -g -l -c -o $@ $<
bin/omsxctl/omsxctl.hex: bin/omsxctl/omsxctl.rel
$(PATH_SDCC)/sdcc -mz80 --no-std-crt0 --code-loc 0x0100 -o $@ $<
BUILD_HELP += \\n\\t* bin/omsxctl/omsxctl.com
bin/omsxctl/omsxctl.com: bin/omsxctl/omsxctl.hex
2024-06-24 11:52:11 +00:00
$(PATH_SDCC)/sdobjcopy -I ihex --output-target=binary $< $@
2020-05-01 02:00:32 +00:00
bin/dist:
mkdir -p bin/dist
bin/dist/$(BUILD_NAME): | bin/dist
mkdir -p bin/dist/$(BUILD_NAME)
bin/dist/$(BUILD_NAME)/omsxctl.com: bin/dist/$(BUILD_NAME) | bin/omsxctl/omsxctl.com
cp bin/omsxctl/omsxctl.com bin/dist/$(BUILD_NAME)/omsxctl.com
bin/dist/$(BUILD_NAME)/omsxctl.tcl: bin/dist/$(BUILD_NAME)
cp src/omsxctl.tcl bin/dist/$(BUILD_NAME)/omsxctl.tcl
2020-05-01 02:07:52 +00:00
bin/dist/$(BUILD_NAME)/omsxctl.asm: bin/dist/$(BUILD_NAME)
cp src/omsxctl.asm bin/dist/$(BUILD_NAME)/omsxctl.asm
2020-05-01 02:10:00 +00:00
bin/dist/$(BUILD_NAME)/usage.txt: bin/dist/$(BUILD_NAME)
2020-05-01 02:07:52 +00:00
echo "# Usage\r" > $@
echo "\r" >> $@
echo "Pass the tcl script to openMSX on the command line:\r" >> $@
echo " openmsx -script <path-to>/omsxctl.tcl\r" >> $@
echo "\r" >> $@
echo "And then in MSX-DOS execute something like:\r" >> $@
echo " omsxctl set throttle off\r" >> $@
echo " ...\r" >> $@
echo " omsxctl exit\r" >> $@
echo "\r" >> $@
2020-05-01 02:00:32 +00:00
BUILD_HELP += \\n\\t* bin/dist/$(BUILD_NAME).tar.gz
2020-05-01 02:07:52 +00:00
bin/dist/$(BUILD_NAME).tar.gz: \
bin/dist/$(BUILD_NAME)/omsxctl.com \
bin/dist/$(BUILD_NAME)/omsxctl.tcl \
bin/dist/$(BUILD_NAME)/omsxctl.asm \
bin/dist/$(BUILD_NAME)/usage.txt
2020-05-01 02:00:32 +00:00
cd bin/dist && tar -czvf $(BUILD_NAME).tar.gz $(BUILD_NAME)