1 .SUFFIXES: .java .class
3 CLASSPATH=classes:./*:/usr/share/java/*
6 AltosChannelMenu.class \
8 AltosConfigFCUI.class \
10 AltosCRCException.class \
14 AltosEepromDownload.class \
15 AltosEepromMonitor.class \
16 AltosEepromReader.class \
17 AltosEepromRecord.class \
21 AltosFlightInfoTableModel.class \
22 AltosFlightStatusTableModel.class \
24 AltosGreatCircle.class \
27 AltosInfoTable.class \
29 AltosLogfileChooser.class \
31 AltosPreferences.class \
34 AltosSerialMonitor.class \
37 AltosStatusTable.class \
38 AltosTelemetry.class \
39 AltosTelemetryReader.class \
42 AltosDeviceDialog.class \
43 AltosRomconfig.class \
44 AltosRomconfigUI.class \
48 ../icon/altus-metrum-16.png \
49 ../icon/altus-metrum-32.png \
50 ../icon/altus-metrum-48.png \
51 ../icon/altus-metrum-64.png \
52 ../icon/altus-metrum-128.png \
53 ../icon/altus-metrum-256.png
55 WINDOWS_ICON=../icon/altus-metrum.ico
57 # where altosui.jar gets installed
58 ALTOSLIB=/usr/share/java
60 # where freetts.jar is to be found
61 FREETTSLIB=/usr/share/java
63 # all of the freetts files
65 $(FREETTSLIB)/cmudict04.jar \
66 $(FREETTSLIB)/cmulex.jar \
67 $(FREETTSLIB)/cmu_time_awb.jar \
68 $(FREETTSLIB)/cmutimelex.jar \
69 $(FREETTSLIB)/cmu_us_kal.jar \
70 $(FREETTSLIB)/en_us.jar \
71 $(FREETTSLIB)/freetts.jar
73 # The current hex files
76 $(HEXLIB)/telemetrum-v1.0.ihx \
77 $(HEXLIB)/teledongle-v0.2.ihx
79 JAVAFLAGS=-Xlint:unchecked -Xlint:deprecation
81 ALTOSUIJAR = altosui.jar
82 FATJAR = fat/altosui.jar
88 DARWIN_ZIP=Altos-Mac.zip
90 WINDOWS_EXE=Altos-Windows.exe
92 LINUX_TGZ=Altos-Linux.tgz
94 all: altosui.jar $(LINUX_APP)
95 fat: altosui.jar $(LINUX_APP) $(DARWIN_ZIP) $(WINDOWS_EXE) $(LINUX_TGZ)
100 javac -encoding UTF8 -classpath "$(CLASSPATH)" $(JAVAFLAGS) $*.java
102 altosui.jar: classes/images classes/altosui classes/libaltosJNI $(CLASSFILES) Manifest.txt
103 cd ./classes && jar cfm ../$@ altosui/Manifest.txt images/* altosui/*.class libaltosJNI/*.class
105 Manifest.txt: Makefile $(CLASSFILES)
106 echo 'Main-Class: altosui.AltosUI' > $@
107 echo "Class-Path: $(FREETTSLIB)/freetts.jar" >> $@
111 ln -sf .. classes/altosui
115 ln -sf ../libaltos/libaltosJNI classes/libaltosJNI
118 mkdir -p classes/images
119 ln -sf ../$(JAVA_ICONS) classes/images
122 echo "#!/bin/sh" > $@
123 echo "exec java -Djava.library.path=/usr/lib/altos -jar /usr/share/java/altosui.jar" >> $@
127 echo "#!/bin/sh" > $@
128 echo 'ME=`which "$0"`' >> $@
129 echo 'DIR=`dirname "$ME"`' >> $@
130 echo 'exec java -Djava.library.path="$$DIR" -jar "$$DIR"/altosui.jar' >> $@
133 fat/altosui.jar: $(CLASSFILES) $(JAVA_ICONS) fat/classes/Manifest.txt
135 test -L fat/classes/altosui || ln -sf ../.. fat/classes/altosui
136 mkdir -p fat/classes/images
137 cp $(JAVA_ICONS) fat/classes/images
138 test -L fat/classes/libaltosJNI || ln -sf ../../libaltos/libaltosJNI fat/classes/libaltosJNI
139 cd ./fat/classes && jar cfm ../../$@ Manifest.txt images/* altosui/*.class libaltosJNI/*.class
141 fat/classes/Manifest.txt: $(CLASSFILES) Makefile
143 echo 'Main-Class: altosui.AltosUI' > $@
144 echo "Class-Path: freetts.jar" >> $@
146 install: altosui.jar altosui
147 install -m 0644 altosui.jar $(DESTDIR)/usr/share/java/altosui.jar
148 install -m 0644 altosui.1 $(DESTDIR)/usr/share/man/man1/altosui.1
149 install altosui $(DESTDIR)/usr/bin/altosui
152 rm -f *.class altosui.jar
153 rm -f AltosUI.app/Contents/Resources/Java/*
158 rm -f $(DARWIN_ZIP) $(WINDOWS_EXE) $(LINUX_TGZ)
161 FAT_FILES=$(FATJAR) $(FREETTSJAR) $(HEXFILES)
163 LINUX_FILES=$(FAT_FILES) libaltos/libaltos.so fat/altosui
164 $(LINUX_TGZ): $(LINUX_FILES)
168 cp $(LINUX_FILES) linux/AltOS
169 cd linux && tar czf ../$@ AltOS
171 DARWIN_RESOURCES=$(FATJAR) $(FREETTSJAR) libaltos/libaltos.dylib
172 DARWIN_EXTRA=$(HEXFILES)
173 DARWIN_FILES=$(DARWIN_RESOURCES) $(DARWIN_EXTRA)
175 $(DARWIN_ZIP): $(DARWIN_FILES)
177 cp -a AltosUI.app darwin/
178 mkdir -p darwin/AltosUI.app/Contents/Resources/Java
179 cp $(DARWIN_RESOURCES) darwin/AltosUI.app/Contents/Resources/Java
180 mkdir -p darwin/AltOS
181 cp $(DARWIN_EXTRA) darwin/AltOS
182 cd darwin && zip -r ../$@ AltosUI.app AltOS
184 WINDOWS_FILES = $(FAT_FILES) libaltos/altos.dll ../altusmetrum.inf $(WINDOWS_ICON)
186 $(WINDOWS_EXE): $(WINDOWS_FILES) altos-windows.nsi
188 mkdir -p windows/AltOS
189 rm -f windows/AltOS/*
190 cp $(WINDOWS_FILES) windows/AltOS
191 makensis altos-windows.nsi