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