altosuilib: Fix minor scan UI nits
[fw/altos] / altosui / Makefile.am
1
2 JAVAROOT=classes
3 AM_JAVACFLAGS=-target 1.6 -encoding UTF-8 -Xlint:deprecation -Xlint:unchecked -source 6
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_JAVA = \
14         AltosAscent.java \
15         AltosChannelMenu.java \
16         AltosCompanionInfo.java \
17         AltosConfig.java \
18         AltosConfigUI.java \
19         AltosConfigPyroUI.java \
20         AltosConfigureUI.java \
21         AltosConfigTD.java \
22         AltosConfigTDUI.java \
23         AltosDescent.java \
24         AltosFlightStatus.java \
25         AltosFlightStatusUpdate.java \
26         AltosFlightUI.java \
27         Altos.java \
28         AltosIdleMonitorUI.java \
29         AltosIgniteUI.java \
30         AltosIgnitor.java \
31         AltosLaunch.java \
32         AltosLaunchUI.java \
33         AltosLanded.java \
34         AltosPad.java \
35         AltosUIPreferencesBackend.java \
36         AltosUI.java \
37         AltosGraphUI.java
38
39 JFREECHART_CLASS= \
40     jfreechart.jar
41
42 JCOMMON_CLASS=\
43     jcommon.jar
44
45 FREETTS_CLASS= \
46         cmudict04.jar \
47         cmulex.jar \
48         cmu_time_awb.jar \
49         cmutimelex.jar \
50         cmu_us_kal.jar \
51         en_us.jar \
52         freetts.jar
53
54 ALTOSLIB_CLASS=\
55         altoslib_$(ALTOSLIB_VERSION).jar
56
57 ALTOSUILIB_CLASS=\
58         altosuilib_$(ALTOSUILIB_VERSION).jar
59
60 LIBALTOS= \
61         libaltos32.so \
62         libaltos64.so \
63         libaltos.dylib \
64         altos.dll
65
66 desktopdir = $(datadir)/applications
67 desktop_file = altusmetrum-altosui.desktop
68 desktop_SCRIPTS = $(desktop_file)
69
70 JAR=altosui.jar
71
72 FATJAR=altosui-fat.jar
73
74 # Icons
75 ICONDIR=../icon
76
77 JAVA_ICONS=\
78         $(ICONDIR)/altusmetrum-altosui-16.png \
79         $(ICONDIR)/altusmetrum-altosui-32.png \
80         $(ICONDIR)/altusmetrum-altosui-48.png \
81         $(ICONDIR)/altusmetrum-altosui-64.png \
82         $(ICONDIR)/altusmetrum-altosui-128.png\
83         $(ICONDIR)/altusmetrum-altosui-256.png
84
85 # icon base names for jar
86 ICONJAR= \
87         -C $(ICONDIR) altusmetrum-altosui-16.png \
88         -C $(ICONDIR) altusmetrum-altosui-32.png \
89         -C $(ICONDIR) altusmetrum-altosui-48.png \
90         -C $(ICONDIR) altusmetrum-altosui-64.png \
91         -C $(ICONDIR) altusmetrum-altosui-128.png\
92         -C $(ICONDIR) altusmetrum-altosui-256.png
93
94 WINDOWS_ICONS   =\
95         $(ICONDIR)/altusmetrum-altosui.ico \
96         $(ICONDIR)/altusmetrum-altosui.exe
97         $(ICONDIR)/application-vnd.altusmetrum.eeprom.ico \
98         $(ICONDIR)/application-vnd.altusmetrum.eeprom.exe \
99         $(ICONDIR)/application-vnd.altusmetrum.telemetry.ico \
100         $(ICONDIR)/application-vnd.altusmetrum.telemetry.exe
101
102 MACOSX_ICONS    =\
103         $(ICONDIR)/altusmetrum-altosui.icns \
104         $(ICONDIR)/application-vnd.altusmetrum.eeprom.icns \
105         $(ICONDIR)/application-vnd.altusmetrum.telemetry.icns
106
107 # Firmware
108 FIRMWARE_TD_0_2=$(top_srcdir)/src/teledongle-v0.2/teledongle-v0.2-$(VERSION).ihx
109 FIRMWARE_TD=$(FIRMWARE_TD_0_2)
110
111 FIRMWARE_TM_1_0=$(top_srcdir)/src/telemetrum-v1.0/telemetrum-v1.0-$(VERSION).ihx
112 FIRMWARE_TM_1_1=$(top_srcdir)/src/telemetrum-v1.1/telemetrum-v1.1-$(VERSION).ihx
113 FIRMWARE_TM_1_2=$(top_srcdir)/src/telemetrum-v1.2/telemetrum-v1.2-$(VERSION).ihx
114 FIRMWARE_TM_2_0=$(top_srcdir)/src/telemetrum-v2.0/telemetrum-v2.0-$(VERSION).ihx
115 FIRMWARE_TM=$(FIRMWARE_TM_1_0) $(FIRMWARE_TM_1_1) $(FIRMWARE_TM_1_2) $(FIRMWARE_TM_2_0)
116
117 FIRMWARE_TELEMINI_1_0=$(top_srcdir)/src/telemini-v1.0/telemini-v1.0-$(VERSION).ihx
118 FIRMWARE_TELEMINI=$(FIRMWARE_TELEMINI_1_0)
119
120 FIRMWARE_TBT_1_0=$(top_srcdir)/src/telebt-v1.0/telebt-v1.0-$(VERSION).ihx
121 FIRMWARE_TBT=$(FIRMWARE_TBT_1_0)
122
123 FIRMWARE_TMEGA_1_0=$(top_srcdir)/src/telemega-v1.0/telemega-v1.0-$(VERSION).ihx
124 FIRMWARE_TMEGA=$(FIRMWARE_TMEGA_1_0)
125
126 FIRMWARE_EMINI_1_0=$(top_srcdir)/src/easymini-v1.0/easymini-v1.0-$(VERSION).ihx
127 FIRMWARE_EMINI=$(FIRMWARE_EMINI_1_0)
128
129 FIRMWARE_TGPS_1_0=$(top_srcdir)/src/telegps-v1.0/telegps-v1.0-$(VERSION).ihx
130 FIRMWARE_TGPS=$(FIRMWARE_TGPS_1_0)
131
132 FIRMWARE=$(FIRMWARE_TM) $(FIRMWARE_TELEMINI) $(FIRMWARE_TD) $(FIRMWARE_TBT) $(FIRMWARE_TMEGA) $(FIRMWARE_EMINI) $(FIRMWARE_TGPS)
133
134 ALTUSMETRUM_DOC=$(top_srcdir)/doc/altusmetrum.pdf
135 ALTOS_DOC=$(top_srcdir)/doc/altos.pdf
136 TELEMETRY_DOC=$(top_srcdir)/doc/telemetry.pdf
137 TEMPLATE_DOC=\
138         $(top_srcdir)/doc/telemetrum-outline.pdf \
139         $(top_srcdir)/doc/easymini-outline.pdf \
140         $(top_srcdir)/doc/telemega-outline.pdf \
141         $(top_srcdir)/doc/telemini.pdf
142
143 DOC=$(ALTUSMETRUM_DOC) $(ALTOS_DOC) $(TELEMETRY_DOC) $(TEMPLATE_DOC)
144
145 # Distribution targets
146 LINUX_DIST=Altos-Linux-$(VERSION).tar.bz2
147 LINUX_SH=Altos-Linux-$(VERSION).sh
148 MACOSX_DIST=Altos-Mac-$(VERSION).dmg
149 WINDOWS_DIST=Altos-Windows-$(VERSION_DASH).exe
150
151 FAT_FILES=$(FATJAR) $(ALTOSLIB_CLASS) $(ALTOSUILIB_CLASS) $(FREETTS_CLASS) $(JFREECHART_CLASS) $(JCOMMON_CLASS)
152
153 LINUX_LIBS=libaltos32.so libaltos64.so
154
155 LINUX_FILES=$(FAT_FILES) $(LINUX_LIBS) $(FIRMWARE) $(DOC) $(desktop_file).in $(ICONDIR)/altusmetrum-altosui.svg
156 LINUX_EXTRA=altosui-fat
157
158 MACOSX_INFO_PLIST=Info.plist
159 MACOSX_FILES=$(FAT_FILES) libaltos.dylib $(MACOSX_INFO_PLIST) $(DOC) ReadMe-Mac.rtf $(MACOSX_ICONS)
160 MACOSX_EXTRA=$(FIRMWARE)
161
162 WINDOWS_FILES=$(FAT_FILES) $(FIRMWARE) altos.dll altos64.dll $(top_srcdir)/altusmetrum.inf $(top_srcdir)/altusmetrum.cat $(WINDOWS_ICONS)
163
164 all-local: classes/altosui $(JAR) altosui altosui-test altosui-jdb
165
166 clean-local:
167         -rm -rf classes $(JAR) $(FATJAR) \
168                 $(LINUX_DIST) $(LINUX_SH) $(MACOSX_DIST) windows $(WINDOWS_DIST) $(ALTOSLIB_CLASS) $(ALTOSUILIB_CLASS) $(FREETTS_CLASS) \
169                 $(JFREECHART_CLASS) $(JCOMMON_CLASS) $(LIBALTOS) Manifest.txt Manifest-fat.txt altos-windows.log altos-windows.nsi \
170                 altosui altosui-test altosui-jdb macosx linux *.desktop
171
172 EXTRA_DIST = $(desktop_file).in
173
174 $(desktop_file): $(desktop_file).in
175         sed -e 's#%bindir%#@bindir@#' -e 's#%icondir%#$(datadir)/icons/hicolor/scalable/apps#' ${srcdir}/$(desktop_file).in > $@
176         chmod +x $@
177
178 if FATINSTALL
179
180 FATTARGET=$(FATDIR)/$(VERSION)
181
182 LINUX_DIST_TARGET=$(FATTARGET)/$(LINUX_DIST)
183 LINUX_SH_TARGET=$(FATTARGET)/$(LINUX_SH)
184 MACOSX_DIST_TARGET=$(FATTARGET)/$(MACOSX_DIST)
185 WINDOWS_DIST_TARGET=$(FATTARGET)/$(WINDOWS_DIST)
186
187 fat: $(LINUX_DIST_TARGET) $(LINUX_SH_TARGET) $(MACOSX_DIST_TARGET) $(WINDOWS_DIST_TARGET)
188
189 $(LINUX_DIST_TARGET): $(LINUX_DIST)
190         mkdir -p $(FATTARGET)
191         cp -p $< $@
192
193 $(LINUX_SH_TARGET): $(LINUX_SH)
194         mkdir -p $(FATTARGET)
195         cp -p $< $@
196
197 $(MACOSX_DIST_TARGET): $(MACOSX_DIST)
198         mkdir -p $(FATTARGET)
199         cp -p $< $@
200
201 $(WINDOWS_DIST_TARGET): $(WINDOWS_DIST)
202         mkdir -p $(FATTARGET)
203         cp -p $< $@
204
205 else
206 fat: $(LINUX_DIST) $(LINUX_SH) $(MACOSX_DIST) $(WINDOWS_DIST)
207 endif
208
209 altosuidir=$(datadir)/java
210
211 install-altosuiJAVA: altosui.jar
212         @$(NORMAL_INSTALL)
213         test -z "$(altosuidir)" || $(MKDIR_P) "$(DESTDIR)$(altosuidir)"
214         echo " $(INSTALL_DATA)" "$<" "'$(DESTDIR)$(altosuidir)/altosui.jar'"; \
215         $(INSTALL_DATA) "$<" "$(DESTDIR)$(altosuidir)"
216
217 classes/altosui:
218         mkdir -p classes/altosui
219
220 $(JAR): classaltosui.stamp Manifest.txt $(JAVA_ICONS) $(ALTOSLIB_CLASS) $(ALTOSUILIB_CLASS)
221         jar cfm $@ Manifest.txt \
222                 $(ICONJAR) \
223                 -C classes altosui \
224                 -C ../libaltos libaltosJNI
225
226 $(FATJAR): classaltosui.stamp Manifest-fat.txt $(ALTOSLIB_CLASS) $(ALTOSUILIB_CLASS) $(FREETTS_CLASS) $(JFREECHART_CLASS) $(JCOMMON_CLASS) $(LIBALTOS) $(JAVA_ICONS)
227         jar cfm $@ Manifest-fat.txt \
228                 $(ICONJAR) \
229                 -C classes altosui \
230                 -C ../libaltos libaltosJNI
231
232 Manifest.txt: Makefile
233         echo 'Main-Class: altosui.AltosUI' > $@
234         echo "Class-Path: $(ALTOSLIB_CLASS) $(ALTOSUILIB_CLASS) $(FREETTS)/freetts.jar $(JCOMMON)/jcommon.jar $(JFREECHART)/jfreechart.jar" >> $@
235
236 Manifest-fat.txt:
237         echo 'Main-Class: altosui.AltosUI' > $@
238         echo "Class-Path: $(ALTOSLIB_CLASS) $(ALTOSUILIB_CLASS) freetts.jar jcommon.jar jfreechart.jar" >> $@
239
240 altosui: Makefile
241         echo "#!/bin/sh" > $@
242         echo 'exec java -Djava.library.path="$(altoslibdir)" -jar "$(altosuidir)/altosui.jar" "$$@"' >> $@
243         chmod +x $@
244
245 altosui-test: Makefile
246         echo '#!/bin/sh' > $@
247         echo 'dir="$$(dirname $$0)"' >> $@
248         echo 'cd "$$dir"' >> $@
249         echo 'altosui="$$(pwd -P)"' >> $@
250         echo 'altos="$$(dirname $$altosui)"' >> $@
251         echo 'exec java -Djava.library.path="$$altos/libaltos/.libs" -jar "$$altosui/altosui.jar" "$$@"' >> $@
252         chmod +x $@
253
254 altosui-jdb: Makefile
255         echo "#!/bin/sh" > $@
256         echo 'exec jdb -classpath "classes:./*:../libaltos:$(FREETTS)/freetts.jar:$(JCOMMON)/jcommon.jar:$(JFREECHART)/jfreechart.jar" -Djava.library.path="../libaltos/.libs" altosui/AltosUI "$$@"' >> $@
257         chmod +x $@
258
259 libaltos32.so: build-libaltos
260         -rm -f "$@"
261         $(LN_S) ../libaltos/.libs/"$@" .
262
263 libaltos64.so: build-libaltos
264         -rm -f "$@"
265         $(LN_S) ../libaltos/.libs/"$@" .
266
267 libaltos.dylib:
268         -rm -f "$@"
269         $(LN_S) ../libaltos/"$@" .
270
271 altos.dll: ../libaltos/altos.dll
272         -rm -f "$@"
273         $(LN_S) ../libaltos/"$@" .
274
275 altos64.dll: ../libaltos/altos64.dll
276         -rm -f "$@"
277         $(LN_S) ../libaltos/"$@" .
278
279 ../libaltos/.libs/libaltos64.so: ../libaltos/.libs/libaltos32.so
280
281 ../libaltos/.libs/libaltos32.so: build-libaltos
282
283 ../libaltos/altos.dll: build-altos-dll
284
285 ../libaltos/altos64.dll: build-altos64-dll
286
287 build-libaltos:
288         +cd ../libaltos && make libaltos.la
289 build-altos-dll:
290         +cd ../libaltos && make altos.dll
291
292 build-altos64-dll:
293         +cd ../libaltos && make altos64.dll
294
295 $(ALTOSLIB_CLASS):
296         -rm -f "$@"
297         $(LN_S) ../altoslib/"$@" .
298
299 $(ALTOSUILIB_CLASS):
300         -rm -f "$@"
301         $(LN_S) ../altosuilib/"$@" .
302
303 $(FREETTS_CLASS):
304         -rm -f "$@"
305         $(LN_S) "$(FREETTS)"/"$@" .
306
307 $(JFREECHART_CLASS):
308         -rm -f "$@"
309         $(LN_S) "$(JFREECHART)"/"$@" .
310
311 $(JCOMMON_CLASS):
312         -rm -f "$@"
313         $(LN_S) "$(JCOMMON)"/"$@" .
314
315 $(LINUX_DIST): $(LINUX_FILES) $(LINUX_EXTRA)
316         -rm -f $@
317         -rm -rf linux
318         mkdir -p linux/AltOS
319         cp -p $(LINUX_FILES) linux/AltOS
320         cp -p altosui-fat linux/AltOS/altosui
321         chmod +x linux/AltOS/altosui
322         tar cjf $@ -C linux AltOS
323
324 $(LINUX_SH): $(LINUX_DIST) linux-install.sh
325         cat linux-install.sh $(LINUX_DIST) > $@
326         chmod +x $@
327
328 $(MACOSX_DIST): $(MACOSX_FILES) $(MACOSX_EXTRA) Makefile
329         -rm -f $@
330         -rm -rf macosx
331         mkdir macosx
332         cp -a AltosUI.app macosx/
333         cp -a ReadMe-Mac.rtf macosx/ReadMe.rtf
334         mkdir -p macosx/Doc
335         cp -a $(DOC) macosx/Doc
336         cp -p Info.plist macosx/AltosUI.app/Contents
337         mkdir -p macosx/AltOS-$(VERSION) macosx/AltosUI.app/Contents/Resources/Java
338         cp -p $(MACOSX_ICONS) macosx/AltosUI.app/Contents/Resources
339         cp -p $(FATJAR) macosx/AltosUI.app/Contents/Resources/Java/altosui.jar
340         cp -p libaltos.dylib macosx/AltosUI.app/Contents/Resources/Java
341         cp -p $(ALTOSLIB_CLASS) macosx/AltosUI.app/Contents/Resources/Java
342         cp -p $(ALTOSUILIB_CLASS) macosx/AltosUI.app/Contents/Resources/Java
343         cp -p $(FREETTS_CLASS) macosx/AltosUI.app/Contents/Resources/Java
344         cp -p $(JFREECHART_CLASS) macosx/AltosUI.app/Contents/Resources/Java
345         cp -p $(JCOMMON_CLASS) macosx/AltosUI.app/Contents/Resources/Java
346         cp -p $(MACOSX_EXTRA) macosx/AltOS-$(VERSION)
347         genisoimage -D -V AltOS-$(VERSION) -no-pad -r -apple -o $@ macosx
348
349 $(WINDOWS_DIST): $(WINDOWS_FILES) altos-windows.nsi
350         -rm -f $@
351         makensis -Oaltos-windows.log "-XOutFile $@" "-DVERSION=$(VERSION)" altos-windows.nsi || (cat altos-windows.log && exit 1)