]> git.gag.com Git - fw/altos/blob - altosui/Makefile.am
altosui: Fix AltosLanded call to AltosGraphUI
[fw/altos] / altosui / Makefile.am
1
2 JAVAROOT=classes
3 AM_JAVACFLAGS=-encoding UTF-8 -Xlint:deprecation
4
5 man_MANS=altosui.1
6
7 altoslibdir=$(libdir)/altos
8
9 CLASSPATH_ENV=mkdir -p $(JAVAROOT); CLASSPATH="$(JAVAROOT):../altoslib/*:../altosuilib/*:../libaltos:$(JCOMMON)/jcommon.jar:$(JFREECHART)/jfreechart.jar:$(FREETTS)/freetts.jar"
10
11 bin_SCRIPTS=altosui
12
13 altosui_BT = \
14         AltosBTDevice.java \
15         AltosBTDeviceIterator.java \
16         AltosBTManage.java \
17         AltosBTKnown.java
18
19 altosui_JAVA = \
20         GrabNDrag.java \
21         AltosAscent.java \
22         AltosChannelMenu.java \
23         AltosCompanionInfo.java \
24         AltosConfig.java \
25         AltosConfigFreqUI.java \
26         AltosConfigUI.java \
27         AltosConfigPyroUI.java \
28         AltosConfigureUI.java \
29         AltosConfigTD.java \
30         AltosConfigTDUI.java \
31         AltosCSV.java \
32         AltosCSVUI.java \
33         AltosDebug.java \
34         AltosDescent.java \
35         AltosDeviceUIDialog.java \
36         AltosDisplayThread.java \
37         AltosEepromDelete.java \
38         AltosEepromDownload.java \
39         AltosEepromList.java \
40         AltosEepromManage.java \
41         AltosEepromMonitor.java \
42         AltosEepromSelect.java \
43         AltosFlash.java \
44         AltosFlashUI.java \
45         AltosFlightDisplay.java \
46         AltosFlightInfoTableModel.java \
47         AltosFlightStats.java \
48         AltosFlightStatsTable.java \
49         AltosFlightStatus.java \
50         AltosFlightStatusUpdate.java \
51         AltosFlightUI.java \
52         AltosFreqList.java \
53         AltosHexfile.java \
54         Altos.java \
55         AltosIdleMonitorUI.java \
56         AltosIgniteUI.java \
57         AltosLaunch.java \
58         AltosLaunchUI.java \
59         AltosInfoTable.java \
60         AltosKML.java \
61         AltosLanded.java \
62         AltosLed.java \
63         AltosLights.java \
64         AltosPad.java \
65         AltosUIPreferencesBackend.java \
66         AltosRomconfig.java \
67         AltosRomconfigUI.java \
68         AltosScanUI.java \
69         AltosSerial.java \
70         AltosSerialInUseException.java \
71         AltosSiteMap.java \
72         AltosSiteMapPreload.java \
73         AltosSiteMapCache.java \
74         AltosSiteMapTile.java \
75         AltosUI.java \
76         AltosWriter.java \
77         AltosGraph.java \
78         AltosGraphDataPoint.java \
79         AltosGraphDataSet.java \
80         AltosGraphUI.java \
81         AltosDataChooser.java \
82         AltosVoice.java \
83         $(altosui_BT)
84
85 JFREECHART_CLASS= \
86     jfreechart.jar
87
88 JCOMMON_CLASS=\
89     jcommon.jar
90
91 FREETTS_CLASS= \
92         cmudict04.jar \
93         cmulex.jar \
94         cmu_time_awb.jar \
95         cmutimelex.jar \
96         cmu_us_kal.jar \
97         en_us.jar \
98         freetts.jar
99
100 ALTOSLIB_CLASS=\
101         altoslib_$(ALTOSLIB_VERSION).jar
102
103 ALTOSUILIB_CLASS=\
104         altosuilib_$(ALTOSUILIB_VERSION).jar
105
106 LIBALTOS= \
107         libaltos.so \
108         libaltos.dylib \
109         altos.dll
110
111 JAR=altosui.jar
112
113 FATJAR=altosui-fat.jar
114
115 # Icons
116 ICONDIR=$(top_srcdir)/icon
117
118 JAVA_ICONS=\
119         $(ICONDIR)/altus-metrum-16.png \
120         $(ICONDIR)/altus-metrum-32.png \
121         $(ICONDIR)/altus-metrum-48.png \
122         $(ICONDIR)/altus-metrum-64.png \
123         $(ICONDIR)/altus-metrum-128.png \
124         $(ICONDIR)/altus-metrum-256.png
125
126 ICONS=  $(ICONDIR)/redled.png $(ICONDIR)/redoff.png \
127         $(ICONDIR)/greenled.png $(ICONDIR)/greenoff.png \
128         $(ICONDIR)/grayled.png $(ICONDIR)/grayoff.png
129
130 # icon base names for jar
131 ICONJAR= -C $(ICONDIR) altus-metrum-16.png \
132         -C $(ICONDIR) altus-metrum-32.png \
133         -C $(ICONDIR) altus-metrum-48.png \
134         -C $(ICONDIR) altus-metrum-64.png \
135         -C $(ICONDIR) altus-metrum-128.png \
136         -C $(ICONDIR) altus-metrum-256.png \
137         -C $(ICONDIR) redled.png -C $(ICONDIR) redoff.png \
138         -C $(ICONDIR) greenled.png -C $(ICONDIR) greenoff.png \
139         -C $(ICONDIR) grayon.png -C $(ICONDIR) grayled.png
140
141 WINDOWS_ICON=$(ICONDIR)/altus-metrum.ico
142
143 # Firmware
144 FIRMWARE_TD_0_2=$(top_srcdir)/src/teledongle-v0.2-$(VERSION).ihx
145 FIRMWARE_TD=$(FIRMWARE_TD_0_2)
146
147 FIRMWARE_TM_1_0=$(top_srcdir)/src/telemetrum-v1.0-$(VERSION).ihx
148 FIRMWARE_TM_1_1=$(top_srcdir)/src/telemetrum-v1.1-$(VERSION).ihx
149 FIRMWARE_TM_1_2=$(top_srcdir)/src/telemetrum-v1.2-$(VERSION).ihx
150 FIRMWARE_TM=$(FIRMWARE_TM_1_0) $(FIRMWARE_TM_1_1) $(FIRMWARE_TM_1_2)
151
152 FIRMWARE_TELEMINI_1_0=$(top_srcdir)/src/telemini-v1.0-$(VERSION).ihx
153 FIRMWARE_TELEMINI=$(FIRMWARE_TELEMINI_1_0)
154
155 FIRMWARE=$(FIRMWARE_TM) $(FIRMWARE_TELEMINI) $(FIRMWARE_TD) 
156
157 ALTUSMETRUM_DOC=$(top_srcdir)/doc/altusmetrum.pdf
158 ALTOS_DOC=$(top_srcdir)/doc/altos.pdf
159 TELEMETRY_DOC=$(top_srcdir)/doc/telemetry.pdf
160 TEMPLATE_DOC=$(top_srcdir)/doc/telemetrum-outline.pdf $(top_srcdir)/doc/megametrum-outline.pdf
161
162 DOC=$(ALTUSMETRUM_DOC) $(ALTOS_DOC) $(TELEMETRY_DOC) $(TEMPLATE_DOC)
163
164 # Distribution targets
165 LINUX_DIST=Altos-Linux-$(VERSION).tar.bz2
166 MACOSX_DIST=Altos-Mac-$(VERSION).dmg
167 WINDOWS_DIST=Altos-Windows-$(VERSION_DASH).exe
168
169 FAT_FILES=$(FATJAR) $(ALTOSLIB_CLASS) $(ALTOSUILIB_CLASS) $(FREETTS_CLASS) $(JFREECHART_CLASS) $(JCOMMON_CLASS)
170
171 LINUX_FILES=$(FAT_FILES) libaltos.so $(FIRMWARE) $(DOC)
172 LINUX_EXTRA=altosui-fat
173
174 MACOSX_INFO_PLIST=Info.plist
175 MACOSX_FILES=$(FAT_FILES) libaltos.dylib $(MACOSX_INFO_PLIST) ReadMe-Mac.rtf
176 MACOSX_EXTRA=$(FIRMWARE)
177
178 WINDOWS_FILES=$(FAT_FILES) altos.dll altos64.dll $(top_srcdir)/telemetrum.inf $(WINDOWS_ICON)
179
180 all-local: classes/altosui $(JAR) altosui altosui-test altosui-jdb
181
182 clean-local:
183         -rm -rf classes $(JAR) $(FATJAR) \
184                 $(LINUX_DIST) $(MACOSX_DIST) windows $(WINDOWS_DIST) $(ALTOSLIB_CLASS) $(ALTOSUILIB_CLASS) $(FREETTS_CLASS) \
185                 $(JFREECHART_CLASS) $(JCOMMON_CLASS) $(LIBALTOS) Manifest.txt Manifest-fat.txt altos-windows.log \
186                 altosui altosui-test altosui-jdb macosx linux
187
188 if FATINSTALL
189
190 FATTARGET=$(FATDIR)/$(VERSION)
191
192 LINUX_DIST_TARGET=$(FATTARGET)/$(LINUX_DIST)
193 MACOSX_DIST_TARGET=$(FATTARGET)/$(MACOSX_DIST)
194 WINDOWS_DIST_TARGET=$(FATTARGET)/$(WINDOWS_DIST)
195
196 fat: $(LINUX_DIST_TARGET) $(MACOSX_DIST_TARGET) $(WINDOWS_DIST_TARGET)
197
198 $(LINUX_DIST_TARGET): $(LINUX_DIST)
199         mkdir -p $(FATTARGET)
200         cp -p $< $@
201
202 $(MACOSX_DIST_TARGET): $(MACOSX_DIST)
203         mkdir -p $(FATTARGET)
204         cp -p $< $@
205
206 $(WINDOWS_DIST_TARGET): $(WINDOWS_DIST)
207         mkdir -p $(FATTARGET)
208         cp -p $< $@
209
210 else
211 fat: $(LINUX_DIST) $(MACOSX_DIST) $(WINDOWS_DIST)
212 endif
213
214
215 altosuidir=$(datadir)/java
216
217 install-altosuiJAVA: altosui.jar
218         @$(NORMAL_INSTALL)
219         test -z "$(altosuidir)" || $(MKDIR_P) "$(DESTDIR)$(altosuidir)"
220         echo " $(INSTALL_DATA)" "$<" "'$(DESTDIR)$(altosuidir)/altosui.jar'"; \
221         $(INSTALL_DATA) "$<" "$(DESTDIR)$(altosuidir)"
222
223 classes/altosui:
224         mkdir -p classes/altosui
225
226 $(JAR): classaltosui.stamp Manifest.txt $(JAVA_ICONS) $(ALTOSLIB_CLASS) $(ALTOSUILIB_CLASS)
227         jar cfm $@ Manifest.txt \
228                 $(ICONJAR) \
229                 -C classes altosui \
230                 -C ../libaltos libaltosJNI
231
232 $(FATJAR): classaltosui.stamp Manifest-fat.txt $(ALTOSLIB_CLASS) $(ALTOSUILIB_CLASS) $(FREETTS_CLASS) $(JFREECHART_CLASS) $(JCOMMON_CLASS) $(LIBALTOS) $(JAVA_ICONS)
233         jar cfm $@ Manifest-fat.txt \
234                 $(ICONJAR) \
235                 -C classes altosui \
236                 -C ../libaltos libaltosJNI
237
238 Manifest.txt: Makefile
239         echo 'Main-Class: altosui.AltosUI' > $@
240         echo "Class-Path: $(ALTOSLIB_CLASS) $(ALTOSUILIB_CLASS) $(FREETTS)/freetts.jar $(JCOMMON)/jcommon.jar $(JFREECHART)/jfreechart.jar" >> $@
241
242 Manifest-fat.txt:
243         echo 'Main-Class: altosui.AltosUI' > $@
244         echo "Class-Path: $(ALTOSLIB_CLASS) $(ALTOSUILIB_CLASS) freetts.jar jcommon.jar jfreechart.jar" >> $@
245
246 altosui: Makefile
247         echo "#!/bin/sh" > $@
248         echo 'exec java -Djava.library.path="$(altoslibdir)" -jar "$(altosuidir)/altosui.jar" "$$@"' >> $@
249         chmod +x $@
250
251 altosui-test: Makefile
252         echo "#!/bin/sh" > $@
253         echo 'exec java -Djava.library.path="../libaltos/.libs" -jar altosui.jar "$$@"' >> $@
254         chmod +x $@
255
256 altosui-jdb: Makefile
257         echo "#!/bin/sh" > $@
258         echo 'exec jdb -classpath "classes:./*:../libaltos:$(FREETTS)/freetts.jar:$(JCOMMON)/jcommon.jar:$(JFREECHART)/jfreechart.jar" -Djava.library.path="../libaltos/.libs" altosui/AltosUI "$$@"' >> $@
259         chmod +x $@
260
261 libaltos.so: build-libaltos
262         -rm -f "$@"
263         $(LN_S) ../libaltos/.libs/"$@" .
264
265 libaltos.dylib:
266         -rm -f "$@"
267         $(LN_S) ../libaltos/"$@" .
268
269 altos.dll: ../libaltos/altos.dll
270         -rm -f "$@"
271         $(LN_S) ../libaltos/"$@" .
272
273 altos64.dll: ../libaltos/altos64.dll
274         -rm -f "$@"
275         $(LN_S) ../libaltos/"$@" .
276
277 ../libaltos/.libs/libaltos.so: build-libaltos
278
279 ../libaltos/altos.dll: build-altos-dll
280
281 ../libaltos/altos64.dll: build-altos64-dll
282
283 build-libaltos:
284         +cd ../libaltos && make libaltos.la
285 build-altos-dll:
286         +cd ../libaltos && make altos.dll
287
288 build-altos64-dll:
289         +cd ../libaltos && make altos64.dll
290
291 $(ALTOSLIB_CLASS):
292         -rm -f "$@"
293         $(LN_S) ../altoslib/"$@" .
294
295 $(ALTOSUILIB_CLASS):
296         -rm -f "$@"
297         $(LN_S) ../altosuilib/"$@" .
298
299 $(FREETTS_CLASS):
300         -rm -f "$@"
301         $(LN_S) "$(FREETTS)"/"$@" .
302
303 $(JFREECHART_CLASS):
304         -rm -f "$@"
305         $(LN_S) "$(JFREECHART)"/"$@" .
306
307 $(JCOMMON_CLASS):
308         -rm -f "$@"
309         $(LN_S) "$(JCOMMON)"/"$@" .
310
311 $(LINUX_DIST): $(LINUX_FILES) $(LINUX_EXTRA)
312         -rm -f $@
313         -rm -rf linux
314         mkdir -p linux/AltOS
315         cp -p $(LINUX_FILES) linux/AltOS
316         cp -p altosui-fat linux/AltOS/altosui
317         chmod +x linux/AltOS/altosui
318         tar cjf $@ -C linux AltOS
319
320 $(MACOSX_DIST): $(MACOSX_FILES) $(MACOSX_EXTRA) Makefile
321         -rm -f $@
322         -rm -rf macosx
323         mkdir macosx
324         cp -a AltosUI.app macosx/
325         cp -a ReadMe-Mac.rtf macosx/ReadMe.rtf
326         cp -p Info.plist macosx/AltosUI.app/Contents
327         mkdir -p macosx/AltOS-$(VERSION) macosx/AltosUI.app/Contents/Resources/Java
328         cp -p $(FATJAR) macosx/AltosUI.app/Contents/Resources/Java/altosui.jar
329         cp -p libaltos.dylib macosx/AltosUI.app/Contents/Resources/Java
330         cp -p $(ALTOSLIB_CLASS) macosx/AltosUI.app/Contents/Resources/Java
331         cp -p $(ALTOSUILIB_CLASS) macosx/AltosUI.app/Contents/Resources/Java
332         cp -p $(FREETTS_CLASS) macosx/AltosUI.app/Contents/Resources/Java
333         cp -p $(JFREECHART_CLASS) macosx/AltosUI.app/Contents/Resources/Java
334         cp -p $(JCOMMON_CLASS) macosx/AltosUI.app/Contents/Resources/Java
335         cp -p $(MACOSX_EXTRA) macosx/AltOS-$(VERSION)
336         genisoimage -D -V AltOS-$(VERSION) -no-pad -r -apple -o $@ macosx
337
338 $(WINDOWS_DIST): $(WINDOWS_FILES) altos-windows.nsi
339         -rm -f $@
340         makensis -Oaltos-windows.log "-XOutFile $@" "-DVERSION=$(VERSION)" altos-windows.nsi
341