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