-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
154 lines (112 loc) · 5.13 KB
/
build.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
<?xml version="1.0" encoding="UTF-8"?>
<project name="samagi">
<property environment="env" />
<property name="python" location="../../AppData/Local/Programs/Python/Python38/python.exe" />
<property name="pyz80" location="../pyz80/pyz80.py" />
<property name="simcoupe" location="${env.ProgramFiles(x86)}/SimCoupe/SimCoupe.exe" />
<!-- assemble -->
<macrodef name="assemble">
<attribute name="source" default="main" />
<attribute name="import-symbols" default="false" />
<attribute name="debug" default="false" />
<attribute name="debug-actions" default="false" />
<attribute name="silent" default="false" />
<sequential xmlns:if="ant:if">
<echo message="assembling '@{source}'" />
<exec executable="${python}" failonerror="true">
<arg value="${pyz80}" />
<arg line="-D debug" if:true="@{debug}" />
<arg line="-D debug-actions" if:true="@{debug-actions}" />
<arg line="-D silent" if:true="@{silent}" />
<arg value="--importfile=obj/symbols" if:true="@{import-symbols}" />
<arg value="--exportfile=obj/symbols" />
<arg value="--obj=obj/@{source}" />
<!-- <arg value="-e" /> -->
<arg value="--mapfile=obj/@{source}.map" />
<arg value="src/@{source}.s" />
</exec>
</sequential>
</macrodef>
<!-- create-disk -->
<macrodef name="create-disk">
<attribute name="source" default="main" />
<attribute name="additional.1" default="" />
<attribute name="additional.2" default="" />
<attribute name="additional.3" default="" />
<attribute name="additional.4" default="" />
<attribute name="import-symbols" default="false" />
<attribute name="game" />
<attribute name="debug" default="false" />
<attribute name="silent" default="false" />
<sequential xmlns:if="ant:if" xmlns:unless="ant:unless">
<echo message="create-disk '@{source}'" />
<exec executable="${python}" failonerror="true">
<arg value="${pyz80}" />
<arg line="-I gamefiles/@{game}/logdir" />
<arg line="-I gamefiles/@{game}/viewdir" />
<arg line="-I gamefiles/@{game}/picdir" />
<arg line="-I gamefiles/@{game}/snddir" />
<arg line="-I gamefiles/@{game}/words.tok" />
<arg line="-I gamefiles/@{game}/object" />
<arg line="-I gamefiles/@{game}/vol.0" />
<arg line="-I gamefiles/@{game}/vol.1" />
<arg line="-I gamefiles/@{game}/vol.2" />
<arg line="-I gamefiles/@{game}/object" />
<arg line="-I obj/@{additional.1}" unless:blank="@{additional.1}" />
<arg line="-I obj/@{additional.2}" unless:blank="@{additional.2}" />
<arg line="-I obj/@{additional.3}" unless:blank="@{additional.3}" />
<arg line="-I obj/@{additional.4}" unless:blank="@{additional.4}" />
<arg line="--importfile=obj/symbols" if:true="@{import-symbols}" />
<arg line="-o obj/@{game}.dsk" />
<arg line="-D debug" if:true="@{debug}" />
<arg line="-D xdebug-actions" if:true="@{debug}" />
<arg line="-D silent" if:true="@{silent}" />
<arg value="--mapfile=obj/@{game}.map" />
<arg value="src/@{source}.s" />
</exec>
<delete file="obj/@{additional.1}" unless:blank="@{additional.1}" />
<delete file="obj/@{additional.2}" unless:blank="@{additional.2}" />
<delete file="obj/@{additional.3}" unless:blank="@{additional.3}" />
<delete file="obj/@{additional.4}" unless:blank="@{additional.4}" />
</sequential>
</macrodef>
<macrodef name="samagi">
<attribute name="game" />
<attribute name="silent" default="false" />
<sequential>
<!-- first pass assembly of boot for symbols -->
<assemble source="boot" debug="true" />
<delete file="obj/boot" />
<assemble source="view" debug="true" silent="@{silent}" import-symbols="true" />
<assemble source="pic" debug="true" silent="@{silent}" import-symbols="true" />
<assemble source="snd" debug="true" silent="@{silent}" import-symbols="true" />
<assemble source="main" debug="true" silent="@{silent}" debug-actions="false" import-symbols="true" />
<create-disk game="@{game}" source="boot" additional.1="main" additional.2="view" additional.3="pic" additional.4="snd" silent="@{silent}" import-symbols="true" />
<concat destfile="obj/@{game}.map" append="true">
<fileset dir="obj" includes="view.map main.map snd.map pic.map" />
</concat>
<exec executable="${simcoupe}">
<arg value="obj/@{game}.dsk" />
</exec>
</sequential>
</macrodef>
<target name="lllll" description="Leisure Suit Larry In The Land Of The Lounge Lizards">
<samagi game="lllll" />
</target>
<target name="lllll-silent" description="Leisure Suit Larry In The Land Of The Lounge Lizards">
<samagi game="lllll" silent="true" />
</target>
<target name="sq1" description="Space Quest: The Sarien Encounter">
<samagi game="sq1" />
</target>
<target name="sq2" description="Space Quest II: Vohaul's Revenge">
<samagi game="sq2" />
</target>
<target name="pq1" description="Police Quest: In Pursuit of the Death Angel">
<samagi game="pq1" />
</target>
<target name="clean" description="clean obj">
<delete dir="obj" />
<mkdir dir="obj" />
</target>
</project>