]> cloudbase.mooo.com Git - avrcpm.git/blob - cpm/Makefile
* Test: Change directory hierarchy
[avrcpm.git] / cpm / Makefile
1 #WARNING! Do not run a 'make install' unless you know what you're doing.
2
3
4 diskimage: cpm.bin cpmdsk/*
5 mkfs.cpm -f avrcpm -b cpm.bin -L test diskimage
6 cd cpmdsk; for x in *; do cpmcp -f avrcpm ../diskimage $$x 0:$$x; done; cd ..
7
8 cpm.bin: ipl.bin bios.bin CPM.SYS
9 dd conv=sync bs=128 count=1 if=ipl.bin > cpm.bin
10 dd conv=sync bs=128 count=44 if=CPM.SYS >> cpm.bin
11 dd conv=sync bs=128 count=7 if=bios.bin >> cpm.bin
12
13
14 bios.prn bios.rel : avrcpm.lib cfgacpm.lib
15 ipl.prn ipl.rel : cfgacpm.lib
16
17 %.rel: %.mac
18 zxcc m80 -=$<
19
20
21 %.prn: %.mac
22 zxcc m80 -,$@=$<
23
24 %.bin: %.rel
25 zxcc l80 -$<,$@/N/E
26
27 .PHONY: clean installcpm install help
28
29 clean:
30 rm -f bios.lst bios.bin bios.prn bios.rel
31 rm -f ipl.lst ipl.bin ipl.prn ipl.rel
32 rm -f cpm.bin diskimage
33
34
35 installcpm: cpm.bin
36 ifneq (${DEV},)
37 sudo dd if=cpm.bin of=${DEV} bs=128 conv=sync oflag=sync
38 sync
39 sleep 1
40 sync
41 else
42 @echo Error: You must specify a device to install to!
43 @echo " i.e. 'make $@ DEV=/dev/sdb1'"
44 endif
45
46 install: diskimage
47 ifneq (${DEV},)
48 sudo dd if=diskimage of=${DEV} conv=sync oflag=direct,sync
49 sync
50 cpmls -f avrcpm ${DEV}
51 sync
52 sleep 1
53 sync
54 else
55 @echo Error: You must specify a device to install to!
56 @echo " i.e. 'make $@ DEV=/dev/sdb1'"
57 endif
58
59 help:
60 @echo -e "The following make targets are supported:\n"\
61 " diskimage - Build a complete CP/M image.\n"\
62 " cpm.bin - Build CP/M system (IPL+CCP+BDOS+BIOS).\n"\
63 "\n"\
64 " bios.prn - Make a listing file from bios.asm\n"\
65 " ipl.prn - Dito for ipl\n"\
66 "\n"\
67 " install - Copy diskimage to memory card.\n"\
68 " You must specify the card device on the command line.\n"\
69 " Example: 'DEV=/dev/sdb1'\n"\
70 " installcpm - Like install, but install only the system tracks,\n"\
71 " leaving the CP/M file system unaffected.\n"\
72 "\n"\
73 " clean - Remove intermediate and output files.\n"
74
75