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