]> cloudbase.mooo.com Git - avrcpm.git/blob - cpm/Makefile
* avr/timer.asm
[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
41 BIOS.PRN BIOS.REL : AVRCPM.LIB CFGACPM.LIB
42 IPL.PRN IPL.REL : CFGACPM.LIB
43
44 %.REL: %.MAC
45 $(CPMEMU) $(CPMBIN)/m80.com =$<
46 # zxcc m80 -=$<
47
48
49 %.PRN: %.MAC
50 $(CPMEMU) $(CPMBIN)/m80.com ,$@=$<
51 # zxcc m80.com -,$@=$<
52
53 %.BIN: %.REL
54 $(CPMEMU) $(CPMBIN)/l80.com $<,$@/N/E
55 # zxcc l80.com -$<,$@/N/E
56
57 %.COM: %.REL
58 $(CPMEMU) $(CPMBIN)/l80.com $<,$@/N/E
59 # zxcc l80.com -$<,$@/N/E
60
61 .PHONY: clean installcpm install help
62
63 clean:
64 rm -f BIOS.LST IPL.LST
65 rm -f *.REL *.PRN *.BIN *.COM
66 rm -f diskimage
67
68
69 installcpm: CPM.BIN
70 ifneq (${DEV},)
71 sudo dd if=CPM.BIN of=${DEV} bs=128 conv=sync oflag=sync
72 sync
73 sleep 1
74 sync
75 else
76 @echo Error: You must specify a device to install to!
77 @echo " i.e. 'make $@ DEV=/dev/sdb1'"
78 endif
79
80 install: diskimage
81 ifneq (${DEV},)
82 sudo dd if=diskimage of=${DEV} conv=sync oflag=direct,sync
83 sync
84 cpmls -f $(IMGFORMAT) ${DEV}
85 sync
86 sleep 1
87 sync
88 else
89 @echo Error: You must specify a device to install to!
90 @echo " i.e. 'make $@ DEV=/dev/sdb1'"
91 endif
92
93 help:
94 @echo -e "The following make targets are supported:\n"\
95 " diskimage - Build a complete CP/M image. (default)\n"\
96 " CPM.BIN - Build CP/M system (IPL+CCP+BDOS+BIOS).\n"\
97 "\n"\
98 " BIOS.PRN - Make a listing file from bios.asm\n"\
99 " IPL.PRN - Dito for ipl\n"\
100 "\n"\
101 " install - Copy diskimage to memory card.\n"\
102 " You must specify the card device on the command line.\n"\
103 " Example: 'DEV=/dev/sdb1'\n"\
104 " installcpm - Like install, but install only the system tracks,\n"\
105 " leaving the CP/M file system unaffected.\n"\
106 "\n"\
107 " clean - Remove intermediate and output files.\n"\
108 " help - Print this message and exit.\n"