1 # location of code signing key, et al
4 AM_JAVACFLAGS=$(JAVAC_VERSION_FLAGS) -encoding UTF-8 -Xlint:deprecation -Xlint:unchecked
8 altoslibdir=$(libdir)/altos
10 CLASSPATH_ENV=mkdir -p $(JAVAROOT); CLASSPATH="$(JAVAROOT):../altoslib/*:../altosuilib/*:../libaltos:$(JCOMMON)/jcommon.jar:$(JFREECHART)/jfreechart.jar:$(FREETTS)/freetts.jar"
16 AltosChannelMenu.java \
17 AltosCompanionInfo.java \
19 AltosConfigFCUI.java \
20 AltosConfigPyroUI.java \
21 AltosConfigureUI.java \
23 AltosConfigTDUI.java \
25 AltosFlightStatus.java \
26 AltosFlightStatusUpdate.java \
29 AltosIdleMonitorUI.java \
55 altoslib_$(ALTOSLIB_VERSION).jar
58 altosuilib_$(ALTOSUILIB_VERSION).jar
61 LIBALTOS_LINUX=libaltos_i686.so libaltos_amd64.so libaltos_aarch64.so libaltos_armel.so libaltos_armhf.so
63 LIBALTOS_LINUX=libaltos.so
72 desktopdir = $(datadir)/applications
73 desktop_file = altusmetrum-altosui.desktop
74 desktop_SCRIPTS = $(desktop_file)
78 FATJAR=altosui-fat.jar
84 $(ICONDIR)/altusmetrum-altosui-16.png \
85 $(ICONDIR)/altusmetrum-altosui-32.png \
86 $(ICONDIR)/altusmetrum-altosui-48.png \
87 $(ICONDIR)/altusmetrum-altosui-64.png \
88 $(ICONDIR)/altusmetrum-altosui-128.png\
89 $(ICONDIR)/altusmetrum-altosui-256.png
91 # icon base names for jar
93 -C $(ICONDIR) altusmetrum-altosui-16.png \
94 -C $(ICONDIR) altusmetrum-altosui-32.png \
95 -C $(ICONDIR) altusmetrum-altosui-48.png \
96 -C $(ICONDIR) altusmetrum-altosui-64.png \
97 -C $(ICONDIR) altusmetrum-altosui-128.png\
98 -C $(ICONDIR) altusmetrum-altosui-256.png
101 $(ICONDIR)/altusmetrum-altosui.ico \
102 $(ICONDIR)/altusmetrum-altosui.exe
103 $(ICONDIR)/application-vnd.altusmetrum.eeprom.ico \
104 $(ICONDIR)/application-vnd.altusmetrum.eeprom.exe \
105 $(ICONDIR)/application-vnd.altusmetrum.telemetry.ico \
106 $(ICONDIR)/application-vnd.altusmetrum.telemetry.exe
109 $(ICONDIR)/altusmetrum-altosui.icns \
110 $(ICONDIR)/application-vnd.altusmetrum.eeprom.icns \
111 $(ICONDIR)/application-vnd.altusmetrum.telemetry.icns
114 $(ICONDIR)/altusmetrum-altosui.svg \
115 $(ICONDIR)/application-vnd.altusmetrum.eeprom.svg \
116 $(ICONDIR)/application-vnd.altusmetrum.telemetry.svg
119 $(ICONDIR)/org-altusmetrum-mimetypes.xml
122 FIRMWARE_TD_3_0=$(top_srcdir)/src/teledongle-v3.0/teledongle-v3.0-$(VERSION).ihx
123 FIRMWARE_TD=$(FIRMWARE_TD_3_0)
125 FIRMWARE_TM_2_0=$(top_srcdir)/src/telemetrum-v2.0/telemetrum-v2.0-$(VERSION).ihx
126 FIRMWARE_TM_3_0=$(top_srcdir)/src/telemetrum-v3.0/telemetrum-v3.0-$(VERSION).ihx
127 FIRMWARE_TM_4_0=$(top_srcdir)/src/telemetrum-v4.0/telemetrum-v4.0-$(VERSION).ihx
128 FIRMWARE_TM=$(FIRMWARE_TM_2_0) $(FIRMWARE_TM_3_0) $(FIRMWARE_TM_4_0)
130 FIRMWARE_TELEMINI_3_0=$(top_srcdir)/src/telemini-v3.0/telemini-v3.0-$(VERSION).ihx
131 FIRMWARE_TELEMINI=$(FIRMWARE_TELEMINI_3_0)
133 FIRMWARE_TBT_3_0=$(top_srcdir)/src/telebt-v3.0/telebt-v3.0-$(VERSION).ihx
134 FIRMWARE_TBT_4_0=$(top_srcdir)/src/telebt-v4.0/telebt-v4.0-$(VERSION).ihx
135 FIRMWARE_TBT=$(FIRMWARE_TBT_3_0) $(FIRMWARE_TBT_4_0)
137 FIRMWARE_TMEGA_1_0=$(top_srcdir)/src/telemega-v1.0/telemega-v1.0-$(VERSION).ihx
138 FIRMWARE_TMEGA_2_0=$(top_srcdir)/src/telemega-v2.0/telemega-v2.0-$(VERSION).ihx
139 FIRMWARE_TMEGA_3_0=$(top_srcdir)/src/telemega-v3.0/telemega-v3.0-$(VERSION).ihx
140 FIRMWARE_TMEGA_4_0=$(top_srcdir)/src/telemega-v4.0/telemega-v4.0-$(VERSION).ihx
141 FIRMWARE_TMEGA_5_0=$(top_srcdir)/src/telemega-v5.0/telemega-v5.0-$(VERSION).ihx
142 FIRMWARE_TMEGA_6_0=$(top_srcdir)/src/telemega-v6.0/telemega-v6.0-$(VERSION).ihx
143 FIRMWARE_TMEGA=$(FIRMWARE_TMEGA_1_0) $(FIRMWARE_TMEGA_2_0) $(FIRMWARE_TMEGA_3_0) $(FIRMWARE_TMEGA_4_0) $(FIRMWARE_TMEGA_5_0) $(FIRMWARE_TMEGA_6_0)
145 FIRMWARE_EMINI_1_0=$(top_srcdir)/src/easymini-v1.0/easymini-v1.0-$(VERSION).ihx
146 FIRMWARE_EMINI_2_0=$(top_srcdir)/src/easymini-v2.0/easymini-v2.0-$(VERSION).ihx
147 FIRMWARE_EMINI_3_0=$(top_srcdir)/src/easymini-v3.0/easymini-v3.0-$(VERSION).ihx
148 FIRMWARE_EMINI=$(FIRMWARE_EMINI_1_0) $(FIRMWARE_EMINI_2_0) $(FIRMWARE_EMINI_3_0)
150 FIRMWARE_EMEGA_1_0=$(top_srcdir)/src/easymega-v1.0/easymega-v1.0-$(VERSION).ihx
151 FIRMWARE_EMEGA_2_0=$(top_srcdir)/src/easymega-v2.0/easymega-v2.0-$(VERSION).ihx
152 FIRMWARE_EMEGA=$(FIRMWARE_EMEGA_1_0) $(FIRMWARE_EMEGA_2_0)
154 FIRMWARE_EMOTOR_3=$(top_srcdir)/src/easymotor-v3/easymotor-v3-$(VERSION).ihx
155 FIRMWARE_EMOTOR=$(FIRMWARE_EMOTOR_3)
157 FIRMWARE_ETIMER_1=$(top_srcdir)/src/easytimer-v1/easytimer-v1-$(VERSION).ihx
158 FIRMWARE_ETIMER=$(FIRMWARE_ETIMER_1)
160 FIRMWARE_TGPS_1_0=$(top_srcdir)/src/telegps-v1.0/telegps-v1.0-$(VERSION).ihx
161 FIRMWARE_TGPS_2_0=$(top_srcdir)/src/telegps-v2.0/telegps-v2.0-$(VERSION).ihx
162 FIRMWARE_TGPS_3_0=$(top_srcdir)/src/telegps-v3.0/telegps-v3.0-$(VERSION).ihx
163 FIRMWARE_TGPS=$(FIRMWARE_TGPS_1_0) $(FIRMWARE_TGPS_2_0) $(FIRMWARE_TGPS_3_0)
165 FIRMWARE_TLCO_2_0=$(top_srcdir)/src/telelco-v2.0/telelco-v2.0-$(VERSION).ihx
166 FIRMWARE_TLCO=$(FIRMWARE_TLCO_2_0)
168 FIRMWARE_TFIRE8_1_0=$(top_srcdir)/src/telefireeight-v1.0/telefireeight-v1.0-$(VERSION).ihx
169 FIRMWARE_TFIRE8_2_0=$(top_srcdir)/src/telefireeight-v2.0/telefireeight-v2.0-$(VERSION).ihx
170 FIRMWARE_TFIRE8=$(FIRMWARE_TFIRE8_1_0) $(FIRMWARE_TFIRE8_2_0)
172 FIRMWARE=$(FIRMWARE_TM) $(FIRMWARE_TELEMINI) $(FIRMWARE_TD) $(FIRMWARE_TBT) $(FIRMWARE_TMEGA) $(FIRMWARE_EMINI) $(FIRMWARE_TGPS) $(FIRMWARE_EMEGA) $(FIRMWARE_EMOTOR) $(FIRMWARE_ETIMER) $(FIRMWARE_TLCO) $(FIRMWARE_TFIRE8)
174 ALTUSMETRUM_DOC=$(top_srcdir)/doc/altusmetrum.pdf
175 ALTOS_DOC=$(top_srcdir)/doc/altos.pdf
176 TELEMETRY_DOC=$(top_srcdir)/doc/telemetry.pdf
177 MOTORTEST_DOC=$(top_srcdir)/doc/motortest.pdf
179 $(top_srcdir)/doc/telemetrum-outline.pdf \
180 $(top_srcdir)/doc/easymini-outline.pdf \
181 $(top_srcdir)/doc/telemega-outline.pdf \
182 $(top_srcdir)/doc/telemini-v1-outline.pdf \
183 $(top_srcdir)/doc/telemini-v3-outline.pdf
185 DOC=$(ALTUSMETRUM_DOC) $(ALTOS_DOC) $(TELEMETRY_DOC) $(MOTORTEST_DOC) $(TEMPLATE_DOC)
187 # Distribution targets
188 LINUX_DIST=Altos-Linux-$(VERSION).tar.bz2
189 LINUX_SH=Altos-Linux-$(VERSION).sh
190 MACOSX_DIST=Altos-Mac-$(VERSION).dmg
191 WINDOWS_DIST=Altos-Windows-$(VERSION_DASH).exe
195 FAT_FILES=$(FATJAR) $(ALTOSLIB_CLASS) $(ALTOSUILIB_CLASS) $(FREETTS_CLASS) $(JFREECHART_CLASS) $(JCOMMON_CLASS)
197 LINUX_LIBS=$(LIBALTOS_LINUX)
199 LINUX_FILES=$(FAT_FILES) $(LINUX_LIBS) $(FIRMWARE) $(DOC) $(desktop_file).in $(LINUX_ICONS) $(LINUX_MIMETYPE)
200 LINUX_EXTRA=altosui-fat
202 MACOSX_INFO_PLIST=Info.plist
203 MACOSX_INSTALL=install-macosx ask-pass
204 MACOSX_FILES=$(FAT_FILES) libaltos.dylib $(MACOSX_INFO_PLIST) $(DOC) ReadMe-Mac.rtf $(MACOSX_ICONS) $(MACOSX_INSTALL)
205 MACOSX_EXTRA=$(FIRMWARE)
207 WINDOWS_FILES=$(FAT_FILES) $(FIRMWARE) altos.dll altos64.dll $(top_srcdir)/altusmetrum.inf $(top_srcdir)/altusmetrum.cat $(WINDOWS_ICONS)
209 all-local: classes/altosui $(JAR) altosui altosui-test altosui-jdb $(MDWN)
212 -rm -rf classes $(JAR) $(FATJAR) \
213 Altos-Linux-*.tar.bz2 Altos-Linux-*.sh Altos-Mac-*.dmg Altos-Windows-*.exe \
214 windows altoslib_*.jar altosuilib_*.jar $(FREETTS_CLASS) \
215 $(JFREECHART_CLASS) $(JCOMMON_CLASS) $(LIBALTOS) Manifest.txt Manifest-fat.txt altos-windows.log altos-windows.nsi \
216 altosui altosui-test altosui-jdb macosx linux *.desktop *.mdwn
218 EXTRA_DIST = $(desktop_file).in
220 $(desktop_file): $(desktop_file).in
221 sed -e 's#%bindir%#@bindir@#' -e 's#%icondir%#$(datadir)/icons/hicolor/scalable/apps#' ${srcdir}/$(desktop_file).in > $@
226 FATTARGET=$(FATDIR)/AltOS/releases/$(VERSION)
228 LINUX_SH_TARGET=$(FATTARGET)/$(LINUX_SH)
229 MACOSX_DIST_TARGET=$(FATTARGET)/$(MACOSX_DIST)
230 WINDOWS_DIST_TARGET=$(FATTARGET)/$(WINDOWS_DIST)
231 MDWN_TARGET=$(FATDIR)/AltOS/releases/$(MDWN)
232 RELNOTES=release-notes-$(VERSION).html
233 RELNOTES_SRC=$(top_builddir)/doc/$(RELNOTES)
234 RELNOTES_TARGET=$(FATTARGET)/$(RELNOTES)
236 fat-install: fat $(LINUX_SH_TARGET) $(MACOSX_DIST_TARGET) $(WINDOWS_DIST_TARGET) $(MDWN_TARGET) $(RELNOTES_TARGET)
238 $(LINUX_SH_TARGET): $(LINUX_SH)
239 mkdir -p $(FATTARGET)
242 $(MACOSX_DIST_TARGET): $(MACOSX_DIST)
243 mkdir -p $(FATTARGET)
246 $(WINDOWS_DIST_TARGET): $(WINDOWS_DIST)
247 mkdir -p $(FATTARGET)
250 $(MDWN_TARGET): $(MDWN)
251 mkdir -p $(FATTARGET)
254 $(RELNOTES_TARGET): $(RELNOTES_SRC)
255 mkdir -p $(FATTARGET)
256 sh $(top_srcdir)/doc/install-html -d $(FATTARGET) $(RELNOTES_SRC)
261 sed -e 's/%version%/$(VERSION)/g' -e 's/%version_dash%/$(VERSION_DASH)/g' $(MDWNTMPL) > $@
263 fat: $(LINUX_DIST) $(LINUX_SH) $(MACOSX_DIST) $(WINDOWS_DIST)
265 altosuidir=$(datadir)/java
267 install-altosuiJAVA: altosui.jar
269 test -z "$(altosuidir)" || $(MKDIR_P) "$(DESTDIR)$(altosuidir)"
270 echo " $(INSTALL_DATA)" "$<" "'$(DESTDIR)$(altosuidir)/altosui.jar'"; \
271 $(INSTALL_DATA) "$<" "$(DESTDIR)$(altosuidir)"
274 mkdir -p classes/altosui
276 $(JAR): classaltosui.stamp Manifest.txt $(JAVA_ICONS) $(ALTOSLIB_CLASS) $(ALTOSUILIB_CLASS) build-libaltos
277 jar cfm $@ Manifest.txt \
280 -C ../libaltos libaltosJNI
281 if STRIP_NONDETERMINISM
282 $(STRIP_NONDETERMINISM) $@
285 $(FATJAR): classaltosui.stamp Manifest-fat.txt $(ALTOSLIB_CLASS) $(ALTOSUILIB_CLASS) $(FREETTS_CLASS) $(JFREECHART_CLASS) $(JCOMMON_CLASS) $(LIBALTOS) $(JAVA_ICONS)
286 jar cfm $@ Manifest-fat.txt \
289 -C ../libaltos libaltosJNI
290 if STRIP_NONDETERMINISM
291 $(STRIP_NONDETERMINISM) $@
294 Manifest.txt: Makefile
295 echo 'Main-Class: altosui.AltosUI' > $@
296 echo "Class-Path: $(ALTOSLIB_CLASS) $(ALTOSUILIB_CLASS) $(FREETTS)/freetts.jar $(JCOMMON)/jcommon.jar $(JFREECHART)/jfreechart.jar" >> $@
299 echo 'Main-Class: altosui.AltosUI' > $@
300 echo "Class-Path: $(ALTOSLIB_CLASS) $(ALTOSUILIB_CLASS) freetts.jar jcommon.jar jfreechart.jar" >> $@
303 echo "#!/bin/sh" > $@
304 echo 'exec java -Djava.library.path="$(altoslibdir)" -jar "$(altosuidir)/altosui.jar" "$$@"' >> $@
307 altosui-test: Makefile
308 echo '#!/bin/sh' > $@
309 echo 'dir="$$(dirname $$0)"' >> $@
310 echo 'cd "$$dir"' >> $@
311 echo 'altosui="$$(pwd -P)"' >> $@
312 echo 'altos="$$(dirname $$altosui)"' >> $@
313 echo 'exec java -Djava.library.path="$$altos/libaltos/.libs" -jar "$$altosui/altosui.jar" "$$@"' >> $@
316 altosui-jdb: Makefile
317 echo "#!/bin/sh" > $@
318 echo 'exec jdb -classpath "classes:./*:../libaltos:$(FREETTS)/freetts.jar:$(JCOMMON)/jcommon.jar:$(JFREECHART)/jfreechart.jar" -Djava.library.path="../libaltos/.libs" altosui/AltosUI "$$@"' >> $@
321 libaltos.so: build-libaltos
323 $(LN_S) ../libaltos/.libs/"$@" .
325 libaltos_i686.so: build-libaltos
327 $(LN_S) ../libaltos/.libs/"$@" .
329 libaltos_amd64.so: build-libaltos
331 $(LN_S) ../libaltos/.libs/"$@" .
333 libaltos_aarch64.so: build-libaltos
335 $(LN_S) ../libaltos/.libs/"$@" .
337 libaltos_armel.so: build-libaltos
339 $(LN_S) ../libaltos/.libs/"$@" .
341 libaltos_armhf.so: build-libaltos
343 $(LN_S) ../libaltos/.libs/"$@" .
347 $(LN_S) ../libaltos/"$@" .
349 altos.dll: build-libaltos
351 $(LN_S) ../libaltos/"$@" .
353 altos64.dll: build-libaltos
355 $(LN_S) ../libaltos/"$@" .
358 +cd ../libaltos && make
362 $(LN_S) ../altoslib/"$@" .
366 $(LN_S) ../altosuilib/"$@" .
370 $(LN_S) "$(FREETTS)"/"$@" .
374 $(LN_S) "$(JFREECHART)"/"$@" .
378 $(LN_S) "$(JCOMMON)"/"$@" .
380 $(LINUX_DIST): $(LINUX_FILES) $(LINUX_EXTRA)
384 cp -p $(LINUX_FILES) linux/AltOS
385 cp -p altosui-fat linux/AltOS/altosui
386 chmod +x linux/AltOS/altosui
387 tar cjf $@ -C linux AltOS
389 $(LINUX_SH): $(LINUX_DIST) linux-install.sh
390 cat linux-install.sh $(LINUX_DIST) > $@
393 $(MACOSX_DIST): $(MACOSX_FILES) $(MACOSX_EXTRA) Makefile
397 cp -a AltosUI.app macosx/
398 cp -a $(MACOSX_INSTALL) macosx
399 cp -a ReadMe-Mac.rtf macosx/ReadMe-AltosUI.rtf
401 cp -a $(DOC) macosx/Doc
402 cp -p Info.plist macosx/AltosUI.app/Contents
403 mkdir -p macosx/AltOS-$(VERSION) macosx/AltosUI.app/Contents/Resources/Java
404 cp -p $(MACOSX_ICONS) macosx/AltosUI.app/Contents/Resources
405 cp -p $(FATJAR) macosx/AltosUI.app/Contents/Resources/Java/altosui.jar
406 cp -p libaltos.dylib macosx/AltosUI.app/Contents/Resources/Java
407 cp -p $(ALTOSLIB_CLASS) macosx/AltosUI.app/Contents/Resources/Java
408 cp -p $(ALTOSUILIB_CLASS) macosx/AltosUI.app/Contents/Resources/Java
409 cp -p $(FREETTS_CLASS) macosx/AltosUI.app/Contents/Resources/Java
410 cp -p $(JFREECHART_CLASS) macosx/AltosUI.app/Contents/Resources/Java
411 cp -p $(JCOMMON_CLASS) macosx/AltosUI.app/Contents/Resources/Java
412 cp -p $(MACOSX_EXTRA) macosx/AltOS-$(VERSION)
413 genisoimage -D -V AltOS-$(VERSION) -no-pad -r -apple -o $@ macosx
415 $(WINDOWS_DIST): $(WINDOWS_FILES) altos-windows.nsi Instdrv/NSIS/Includes/java.nsh
417 makensis -Oaltos-windows.log "-XOutFile $@" "-DVERSION=$(VERSION)" altos-windows.nsi || (cat altos-windows.log && exit 1)
418 if [ "$(HAVE_WINDOWS_KEY)" = "yes" ]; then \
419 jsign --keystore "$(WINDOWSKEYFILE)" --alias 1 \
420 --storetype PKCS12 --storepass `cat "$(WINDOWSKEYPASSFILE)"` \
421 --tsaurl http://ts.ssl.com --tsmode RFC3161 $@ ; \