]> cloudbase.mooo.com Git - avrcpm.git/blob - cpm/Makefile
* cpm/Makefile
[avrcpm.git] / cpm / Makefile
1 #WARNING! Do not run a 'make install' unless you know what you're doing.
2
3 #Location of M80/L80
4 CPMBIN = /usr/local/lib/cpm/bin80
5 #CPMBIN = C:/cpmbin
6
7 #CP/M emulator
8 CPMEMU = aliados
9
10 diskimage: CPM.BIN cpmdsk/*
11 mkfs.cpm -f avrcpm -b CPM.BIN -L test diskimage
12 cd cpmdsk; for x in *; do cpmcp -f avrcpm ../diskimage $$x 0:$$x; done; cd ..
13
14 CPM.BIN: IPL.BIN BIOS.BIN CPM.SYS
15 dd conv=sync bs=128 count=1 if=IPL.BIN > tmpCPM.BIN
16 dd conv=sync bs=128 count=44 if=CPM.SYS >> tmpCPM.BIN
17 dd conv=sync bs=128 count=7 if=BIOS.BIN >> tmpCPM.BIN
18 mv tmpCPM.BIN CPM.BIN
19
20
21 BIOS.PRN BIOS.REL : AVRCPM.LIB CFGACPM.LIB
22 IPL.PRN IPL.REL : CFGACPM.LIB
23
24 %.REL: %.MAC
25 $(CPMEMU) $(CPMBIN)/m80.com =$<
26 # zxcc m80 -=$<
27
28
29 %.PRN: %.MAC
30 $(CPMEMU) $(CPMBIN)/m80.com ,$@=$<
31 # zxcc m80.com -,$@=$<
32
33 %.BIN: %.REL
34 $(CPMEMU) $(CPMBIN)/l80.com $<,$@/N/E
35 # zxcc l80.com -$<,$@/N/E
36
37 .PHONY: clean installcpm install help
38
39 clean:
40 rm -f BIOS.LST BIOS.BIN BIOS.PRN BIOS.REL
41 rm -f IPL.LST IPL.BIN IPL.PRN IPL.REL
42 rm -f CPM.BIN diskimage
43
44
45 installcpm: CPM.BIN
46 ifneq (${DEV},)
47 sudo dd if=CPM.BIN of=${DEV} bs=128 conv=sync oflag=sync
48 sync
49 sleep 1
50 sync
51 else
52 @echo Error: You must specify a device to install to!
53 @echo " i.e. 'make $@ DEV=/dev/sdb1'"
54 endif
55
56 install: diskimage
57 ifneq (${DEV},)
58 sudo dd if=diskimage of=${DEV} conv=sync oflag=direct,sync
59 sync
60 cpmls -f avrcpm ${DEV}
61 sync
62 sleep 1
63 sync
64 else
65 @echo Error: You must specify a device to install to!
66 @echo " i.e. 'make $@ DEV=/dev/sdb1'"
67 endif
68
69 help:
70 @echo -e "The following make targets are supported:\n"\
71 " diskimage - Build a complete CP/M image. (default)\n"\
72 " CPM.BIN - Build CP/M system (IPL+CCP+BDOS+BIOS).\n"\
73 "\n"\
74 " BIOS.PRN - Make a listing file from bios.asm\n"\
75 " IPL.PRN - Dito for ipl\n"\
76 "\n"\
77 " install - Copy diskimage to memory card.\n"\
78 " You must specify the card device on the command line.\n"\
79 " Example: 'DEV=/dev/sdb1'\n"\
80 " installcpm - Like install, but install only the system tracks,\n"\
81 " leaving the CP/M file system unaffected.\n"\
82 "\n"\
83 " clean - Remove intermediate and output files.\n"\
84 " help - Print this message and exit.\n"