online/Makefile

87 lines
2.2 KiB
Makefile
Raw Normal View History

# Require-mints:
#
# GNU make
# - To execute this make file
#
# merlin32
# - to assemble the source code
# https://www.brutaldeluxe.fr/products/crossdevtools/merlin/
#
# AppleCommander (included)
# - To create the Apple II disk image
#
# AppleWin
# - To load the disk and test the program
2017-09-07 19:24:17 +00:00
#
ifeq ($(OS),Windows_NT)
MERLIN_DIR=C:/opt/Merlin32_v1.0
MERLIN_LIB=$(MERLIN_DIR)/Library
MERLIN=$(MERLIN_DIR)/Windows/Merlin32
2018-10-17 18:40:01 +00:00
COPY=copy
APPLEWIN="c:\opt\AppleWin1.26.2.3\applewin.exe"
2017-09-07 19:24:17 +00:00
else
2018-11-18 23:45:48 +00:00
MERLIN_PREFIX=/usr/local
MERLIN_LIB=$(MERLIN_PREFIX)/share/merlin32/asminc
MERLIN=$(MERLIN_PREFIX)/bin/merlin32
2018-10-17 18:40:01 +00:00
COPY=cp
APPLEWIN=applewin
2017-09-07 19:24:17 +00:00
endif
2018-11-18 23:45:48 +00:00
MERLIN_URL=https://www.brutaldeluxe.fr/products/crossdevtools/merlin/Merlin32_v1.0.zip
# It is necessary to use this older version of AppleCommander to support
# the PowerBook G4 and iBook G3. This version only requires Java 1.3.
AC=java -jar AppleCommander-1.3.5-ac.jar
2017-09-07 19:24:17 +00:00
SRC=online.s
2018-10-17 18:40:01 +00:00
PGM=online
BASE_DSK=prodos-2.0.3-boot.dsk
2017-09-07 19:24:17 +00:00
VOL=$(PGM)
DSK=$(PGM).dsk
2018-10-17 18:40:01 +00:00
# There is some kind of problem with turning this into a boot disk
# after it is created by AppleCommander. So, copy an existing boot
# disk instead.
#$(AC) -pro140 $(DSK) $(VOL)
2017-09-07 19:24:17 +00:00
$(DSK): $(PGM)
2018-10-17 18:40:01 +00:00
$(COPY) $(BASE_DSK) $(DSK)
2018-11-18 23:45:48 +00:00
# Does not work on older AC
#$(AC) -n $(DSK) $(VOL)
2017-09-07 19:24:17 +00:00
$(AC) -p $(DSK) $(PGM) SYS < $(PGM)
2018-11-18 23:45:48 +00:00
cat $(PGM).VER.bas | tr '\n' '\r' | $(AC) -p $(DSK) $(PGM).VER TXT
2017-09-07 19:24:17 +00:00
2018-11-18 23:45:48 +00:00
$(PGM): $(SRC) $(MERLIN) $(MERLIN_LIB)
2017-09-07 19:24:17 +00:00
$(MERLIN) $(MERLIN_LIB) $(SRC)
2018-11-18 23:45:48 +00:00
$(MERLIN): Merlin32_v1.0/Source/Merlin32
( cd Merlin32_v1.0/Source; \
sudo install Merlin32 $(MERLIN) )
$(MERLIN_LIB): Merlin32_v1.0
sudo install -d $(MERLIN_LIB)
( cd Merlin32_v1.0; \
sudo install Library/* $(MERLIN_LIB) )
Merlin32_v1.0/Source/Merlin32: Merlin32_v1.0
( cd Merlin32_v1.0/Source; \
make -f linux_makefile )
Merlin32_v1.0: Merlin32_v1.0.zip
unzip Merlin32_v1.0.zip
Merlin32_v1.0.zip:
if java -jar jget.jar $(MERLIN_URL); then \
echo Download successful; \
else \
jget.jar failed. Retrying with curl.; \
curl --remote-name $(MERLIN_URL); \
fi
2017-09-07 19:24:17 +00:00
clean:
2018-11-18 23:45:48 +00:00
$(RM) $(DSK) $(PGM) *.zip _FileInformation.txt
$(RM) -r Merlin32_v1.0
2017-09-07 19:24:17 +00:00
2018-10-17 18:40:01 +00:00
test: $(DSK)
$(APPLEWIN) -d1 $(DSK)