#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 #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 mv tmpCPM.BIN CPM.BIN BIOS.PRN BIOS.REL : AVRCPM.LIB CFGACPM.LIB IPL.PRN IPL.REL : CFGACPM.LIB %.REL: %.MAC $(CPMEMU) $(CPMBIN)/m80.com =$< # zxcc m80 -=$< %.PRN: %.MAC $(CPMEMU) $(CPMBIN)/m80.com ,$@=$< # zxcc m80.com -,$@=$< %.BIN: %.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 installcpm: CPM.BIN ifneq (${DEV},) sudo dd if=CPM.BIN of=${DEV} bs=128 conv=sync oflag=sync sync sleep 1 sync else @echo Error: You must specify a device to install to! @echo " i.e. 'make $@ DEV=/dev/sdb1'" endif install: diskimage ifneq (${DEV},) sudo dd if=diskimage of=${DEV} conv=sync oflag=direct,sync sync cpmls -f avrcpm ${DEV} sync sleep 1 sync else @echo Error: You must specify a device to install to! @echo " i.e. 'make $@ DEV=/dev/sdb1'" endif 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"\ "\n"\ " BIOS.PRN - Make a listing file from bios.asm\n"\ " IPL.PRN - Dito for ipl\n"\ "\n"\ " install - Copy diskimage to memory card.\n"\ " You must specify the card device on the command line.\n"\ " Example: 'DEV=/dev/sdb1'\n"\ " installcpm - Like install, but install only the system tracks,\n"\ " leaving the CP/M file system unaffected.\n"\ "\n"\ " clean - Remove intermediate and output files.\n"\ " help - Print this message and exit.\n"