X-Git-Url: http://cloudbase.mooo.com/gitweb/avrcpm.git/blobdiff_plain/aeb04ad3a16924d33e05f38564959b079cf07447..d8fa6a36ffba80be398c90641b3e7e7a79d56d43:/cpm/Makefile diff --git a/cpm/Makefile b/cpm/Makefile index 054dfa4..e60ea57 100644 --- a/cpm/Makefile +++ b/cpm/Makefile @@ -1,22 +1,50 @@ #WARNING! Do not run a 'make install' unless you know what you're doing. -#Location of M80/L80 -CPMBIN = /usr/local/lib/cpm/bin80 -#CPMBIN = C:/cpmbin +CPMSIZE = 62 + +CPMSYS = CPM$(CPMSIZE).SYS + +IMGFORMAT = avrcpm +#IMGFORMAT = simhd -#CP/M emulator +# CP/M emulator CPMEMU = aliados -diskimage: CPM.BIN cpmdsk/* - mkfs.cpm -f avrcpm -b CPM.BIN -L test diskimage - cd cpmdsk; for x in *; do cpmcp -f avrcpm ../diskimage $$x 0:$$x; done; cd .. -CPM.BIN: IPL.BIN BIOS.BIN CPM.SYS - dd conv=sync bs=128 count=1 if=IPL.BIN > tmpCPM.BIN - dd conv=sync bs=128 count=44 if=CPM.SYS >> tmpCPM.BIN - dd conv=sync bs=128 count=7 if=BIOS.BIN >> tmpCPM.BIN +ifeq "$(OS)" "Windows_NT" + PLATFORM=win32 +else + PLATFORM=Linux +endif + + +#Location of M80/L80 +ifeq ($(PLATFORM),Linux) + CPMBIN = /usr/local/lib/cpm/bin80 +else + CPMBIN = C:/cpmbin +endif + + +diskimage: CPM.BIN cpmdsk/* + mkfs.cpm -f $(IMGFORMAT) -b CPM.BIN -L test diskimage + cd cpmdsk; for x in *; do cpmcp -f $(IMGFORMAT) ../diskimage $$x 0:$$x; done; cd .. + +CPM.BIN: IPL.BIN BIOS.BIN $(CPMSYS) + dd conv=sync bs=118 count=1 if=IPL.BIN > tmpCPM.BIN &&\ + echo -n "" >> tmpCPM.BIN &&\ + dd conv=sync bs=128 count=44 if=$(CPMSYS) >> tmpCPM.BIN &&\ + dd conv=sync bs=128 count=7 if=BIOS.BIN >> tmpCPM.BIN &&\ mv tmpCPM.BIN CPM.BIN +zsdossys: IPL.BIN CCP.BIN ZSDOS.BIN BIOS.BIN + dd conv=sync bs=118 count=1 if=IPL.BIN > tmpCPM.BIN &&\ + echo -n "" >> tmpCPM.BIN &&\ + dd conv=sync bs=128 count=16 if=CCP.BIN >> tmpCPM.BIN &&\ + dd conv=sync bs=128 count=28 if=ZSDOS.BIN >> tmpCPM.BIN &&\ + dd conv=sync bs=128 count=7 if=BIOS.BIN >> tmpCPM.BIN &&\ + mv tmpCPM.BIN zsdossys + BIOS.PRN BIOS.REL : AVRCPM.LIB CFGACPM.LIB IPL.PRN IPL.REL : CFGACPM.LIB @@ -34,12 +62,16 @@ IPL.PRN IPL.REL : CFGACPM.LIB $(CPMEMU) $(CPMBIN)/l80.com $<,$@/N/E # zxcc l80.com -$<,$@/N/E +%.COM: %.REL + $(CPMEMU) $(CPMBIN)/l80.com $<,$@/N/E +# zxcc l80.com -$<,$@/N/E + .PHONY: clean installcpm install help clean: - rm -f BIOS.LST BIOS.BIN BIOS.PRN BIOS.REL - rm -f IPL.LST IPL.BIN IPL.PRN IPL.REL - rm -f CPM.BIN diskimage + rm -f BIOS.LST IPL.LST + rm -f *.REL *.PRN *.BIN *.COM + rm -f diskimage installcpm: CPM.BIN @@ -57,7 +89,7 @@ install: diskimage ifneq (${DEV},) sudo dd if=diskimage of=${DEV} conv=sync oflag=direct,sync sync - cpmls -f avrcpm ${DEV} + cpmls -f $(IMGFORMAT) ${DEV} sync sleep 1 sync @@ -70,6 +102,7 @@ help: @echo -e "The following make targets are supported:\n"\ " diskimage - Build a complete CP/M image. (default)\n"\ " CPM.BIN - Build CP/M system (IPL+CCP+BDOS+BIOS).\n"\ + " zsdossys - Build ZSDOS system (IPL+CCP+ZSDOS+BIOS).\n"\ "\n"\ " BIOS.PRN - Make a listing file from bios.asm\n"\ " IPL.PRN - Dito for ipl\n"\ @@ -82,3 +115,4 @@ help: "\n"\ " clean - Remove intermediate and output files.\n"\ " help - Print this message and exit.\n" +