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