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