Debian Codegraph @

tests/tosboot/makefile

raw
1 # Makefile to build the Atari test program and other required files
2 # for the TOS tester and to run it with minimal or fairly full
3 # set of options.
4
5 # default target is minimal 'test', everything else gets build as its deps
6 all: test
7
8 # targets without corresponding file
9 .PHONY: clean pylint test test-all toolcheck
10
11
12 # tos/ subdir should be either symlink to where you have your TOS
13 # images, or real directory with symlinks to TOS images you want
14 # to test with this. Or TOSDIR variable needs to point where they are:
15 # TOSDIR=/path/to/toses/ make
16
17 TOSDIR ?= tos
18
19 # TOSDIR should contain at least this!
20 BUILD_TOS = $(TOSDIR)/etos1024k.img
21
22 # Hatari machine config for AHCC build
23 BUILD_CONFIG = --layout uk --tos-res high --machine tt --tos $(BUILD_TOS)
24
25 # where the code & test programs are
26 DIR = disk
27
28 # AHCC related files expected for building by disk/ahcc-* hconsole scripts
29 AHCC_FILES = $(DIR)/ahcc_p.ttp $(DIR)/include $(DIR)/lib
30 BUILD_TOOLS = $(AHCC_FILES) $(BUILD_TOS)
31
32
33 # Building test programs requires:
34 # - EmuTOS, AHCC and installed Hatari
35 #
36 # before running make:
37 # - symlink etos1024k.img under $(TOSDIR)/ subdir
38 # - symlink ahcc_p.ttp + its include & lib dirs under $(DIR)/ subdir
39 #
40 # -> otherwise toolcheck fails
41
42 toolcheck:
43 @which hatari
44 @for i in $(BUILD_TOOLS); do \
45 if [ \! -e $$i ]; then \
46 echo "ERROR: required re-build file '$$i' missing!"; \
47 false; \
48 fi; \
49 done
50
51
52 # build the full and minimal GEMDOS emu testers.
53
54
55 GEMDOS_TEST = $(DIR)/GEMDOS.PRG
56 GEMDOS_SCRIPT = $(DIR)/ahcc-gemdos
57 GEMDOS_DEP = $(DIR)/gemdos.c $(DIR)/common.c $(DIR)/gemdos.prj
58
59 # build the full GEMDOS tester
60 $(GEMDOS_TEST): $(GEMDOS_DEP)
61 $(MAKE) toolcheck
62 $(RM) $(DIR)/*.O $(DIR)/*.MAP $(DIR)/*.tmp
63 ../../tools/hconsole/hconsole.py $(GEMDOS_SCRIPT) -- $(BUILD_CONFIG) $(DIR)
64 [ -f $(DIR)/GEMDOS.O ] && [ \! -f $(DIR)/ldfile.tmp ] # verify compiling & linking succeeded
65
66
67 MINIMAL_TEST = $(DIR)/MINIMAL.PRG
68 MINIMAL_SCRIPT = $(DIR)/ahcc-minimal
69 MINIMAL_DEP = $(DIR)/minimal.c $(DIR)/common.c $(DIR)/minimal.prj
70
71 # build the minimal GEMDOS tester
72 $(MINIMAL_TEST): $(MINIMAL_DEP)
73 $(MAKE) toolcheck
74 $(RM) $(DIR)/*.O $(DIR)/*.MAP $(DIR)/*.tmp
75 ../../tools/hconsole/hconsole.py $(MINIMAL_SCRIPT) -- $(BUILD_CONFIG) $(DIR)
76 [ -f $(DIR)/MINIMAL.O ] && [ \! -f $(DIR)/ldfile.tmp ] # verify compiling & linking succeeded
77
78
79 clean:
80 $(RM) $(DIR)/*.O $(DIR)/*.MAP $(DIR)/*.tmp
81
82
83 # create blank DD floppy image
84 blank-a.st.gz:
85 dd if=/dev/zero of=blank-a.st bs=1024 count=720
86 mformat -a -t 80 -h 2 -n 9 -i blank-a.st ::
87 gzip blank-a.st
88
89
90 # create 360KB (single side) test floppy that autoruns test program using *.INF file.
91 # requires:
92 # - mformat & mcopy from mtools
93 bootdesk.st.gz: $(MINIMAL_TEST) $(DIR)/TEXT floppy/*.INF
94 dd if=/dev/zero of=bootdesk.st bs=1024 count=360
95 mformat -a -t 80 -h 1 -n 9 -i bootdesk.st ::
96 MTOOLS_NO_VFAT=1 mcopy -i bootdesk.st -spmv $+ ::
97 $(RM) $@
98 gzip bootdesk.st
99
100 # create 360KB (single side) test floppy that autoruns test program from auto/
101 # as very old TOS versions don't like the *.INF file autorun feature.
102 # requires:
103 # - mformat, mcopy & mmd from mtools
104 bootauto.st.gz: $(MINIMAL_TEST) $(DIR)/TEXT
105 dd if=/dev/zero of=bootauto.st bs=1024 count=360
106 mformat -a -t 80 -h 1 -n 9 -i bootauto.st ::
107 MTOOLS_NO_VFAT=1 mmd -i bootauto.st ::AUTO
108 MTOOLS_NO_VFAT=1 mcopy -i bootauto.st -pmv $(DIR)/TEXT ::
109 MTOOLS_NO_VFAT=1 mcopy -i bootauto.st -pmv $(MINIMAL_TEST) ::AUTO
110 $(RM) $@
111 gzip bootauto.st
112
113
114 # optional 16MB HD image for EmuTOS/ACSI testing without HD drivers
115 # converts floppy desktop infos for HD (A: -> C:)
116 hd.img: $(MINIMAL_TEST) $(DIR)/TEXT floppy/*.INF
117 mkdir tmp
118 cp -a $(MINIMAL_TEST) $(DIR)/TEXT tmp/
119 for i in floppy/*.INF; do sed -e 's/A:/C:/g' < $$i > tmp/$${i##*/}; done
120 ../../tools/atari-hd-image.sh 16 $@ LABEL tmp
121 $(RM) -r tmp
122
123
124 # requires:
125 # - Building of floppies & GEMDOS_TEST to have succeeded
126 # - Latest Hatari to be installed, or to run this with something like:
127 # PATH=../../build/src:$PATH make
128 test: blank-a.st.gz bootauto.st.gz bootdesk.st.gz $(GEMDOS_TEST)
129 ./tos_tester.py --disks floppy,gemdos --graphics mono --memsizes 4 --machines ste $(BUILD_TOS)
130
131 # run all default tests
132 test-full: blank-a.st.gz bootauto.st.gz bootdesk.st.gz
133 ./tos_tester.py $(TOSDIR)/*.img
134
135 pylint:
136 PYTHONPATH=../../tools/hconsole/ pylint tos_tester.py