1 .SUFFIXES: .java .class
3 CLASSPATH=classes:./*:/usr/share/java/*
6 AltosChannelMenu.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 \
47 JAVA_ICON=../icon/altus-metrum-16x16.jpg
48 WINDOWS_ICON=../icon/altus-metrum.ico
50 # where altosui.jar gets installed
51 ALTOSLIB=/usr/share/java
53 # where freetts.jar is to be found
54 FREETTSLIB=/usr/share/java
56 # all of the freetts files
58 $(FREETTSLIB)/cmudict04.jar \
59 $(FREETTSLIB)/cmulex.jar \
60 $(FREETTSLIB)/cmu_time_awb.jar \
61 $(FREETTSLIB)/cmutimelex.jar \
62 $(FREETTSLIB)/cmu_us_kal.jar \
63 $(FREETTSLIB)/en_us.jar \
64 $(FREETTSLIB)/freetts.jar
66 # The current hex files
69 $(HEXLIB)/telemetrum-v1.0.ihx \
70 $(HEXLIB)/teledongle-v0.2.ihx
72 JAVAFLAGS=-Xlint:unchecked -Xlint:deprecation
74 ALTOSUIJAR = altosui.jar
75 FATJAR = fat/altosui.jar
81 DARWIN_ZIP=Altos-Mac.zip
83 WINDOWS_EXE=Altos-Windows.exe
85 LINUX_TGZ=Altos-Linux.tgz
87 all: altosui.jar $(LINUX_APP)
88 fat: altosui.jar $(LINUX_APP) $(DARWIN_ZIP) $(WINDOWS_EXE) $(LINUX_TGZ)
93 javac -encoding UTF8 -classpath "$(CLASSPATH)" $(JAVAFLAGS) $*.java
95 altosui.jar: classes/images classes/altosui classes/libaltosJNI $(CLASSFILES) Manifest.txt
96 cd ./classes && jar cfm ../$@ altosui/Manifest.txt images/* altosui/*.class libaltosJNI/*.class
98 Manifest.txt: Makefile $(CLASSFILES)
99 echo 'Main-Class: altosui.AltosUI' > $@
100 echo "Class-Path: $(FREETTSLIB)/freetts.jar" >> $@
104 ln -sf .. classes/altosui
108 ln -sf ../libaltos/libaltosJNI classes/libaltosJNI
111 mkdir -p classes/images
112 ln -sf ../$(JAVA_ICON) classes/images
115 echo "#!/bin/sh" > $@
116 echo "exec java -Djava.library.path=/usr/lib/altos -jar /usr/share/java/altosui.jar" >> $@
120 echo "#!/bin/sh" > $@
121 echo 'ME=`which "$0"`' >> $@
122 echo 'DIR=`dirname "$ME"`' >> $@
123 echo 'exec java -Djava.library.path="$$DIR" -jar "$$DIR"/altosui.jar' >> $@
126 fat/altosui.jar: $(CLASSFILES) $(JAVA_ICON) fat/classes/Manifest.txt
128 test -L fat/classes/altosui || ln -sf ../.. fat/classes/altosui
129 mkdir -p fat/classes/images
130 cp $(JAVA_ICON) fat/classes/images
131 test -L fat/classes/libaltosJNI || ln -sf ../../libaltos/libaltosJNI fat/classes/libaltosJNI
132 cd ./fat/classes && jar cfm ../../$@ Manifest.txt images/* altosui/*.class libaltosJNI/*.class
134 fat/classes/Manifest.txt: $(CLASSFILES) Makefile
136 echo 'Main-Class: altosui.AltosUI' > $@
137 echo "Class-Path: freetts.jar" >> $@
139 install: altosui.jar altosui
140 install -m 0644 altosui.jar $(DESTDIR)/usr/share/java/altosui.jar
141 install -m 0644 altosui.1 $(DESTDIR)/usr/share/man/man1/altosui.1
142 install altosui $(DESTDIR)/usr/bin/altosui
145 rm -f *.class altosui.jar
146 rm -f AltosUI.app/Contents/Resources/Java/*
151 rm -f $(DARWIN_ZIP) $(WINDOWS_EXE) $(LINUX_TGZ)
154 FAT_FILES=$(FATJAR) $(FREETTSJAR) $(HEXFILES)
156 LINUX_FILES=$(FAT_FILES) libaltos/libaltos.so fat/altosui
157 $(LINUX_TGZ): $(LINUX_FILES)
161 cp $(LINUX_FILES) linux/AltOS
162 cd linux && tar czf ../$@ AltOS
164 DARWIN_RESOURCES=$(FATJAR) $(FREETTSJAR) libaltos/libaltos.dylib
165 DARWIN_EXTRA=$(HEXFILES)
166 DARWIN_FILES=$(DARWIN_RESOURCES) $(DARWIN_EXTRA)
168 $(DARWIN_ZIP): $(DARWIN_FILES)
170 cp -a AltosUI.app darwin/
171 mkdir -p darwin/AltosUI.app/Contents/Resources/Java
172 cp $(DARWIN_RESOURCES) darwin/AltosUI.app/Contents/Resources/Java
173 mkdir -p darwin/AltOS
174 cp $(DARWIN_EXTRA) darwin/AltOS
175 cd darwin && zip -r ../$@ AltosUI.app AltOS
177 WINDOWS_FILES = $(FAT_FILES) libaltos/altos.dll ../telemetrum.inf $(WINDOWS_ICON)
179 $(WINDOWS_EXE): $(WINDOWS_FILES) altos-windows.nsi
181 mkdir -p windows/AltOS
182 rm -f windows/AltOS/*
183 cp $(WINDOWS_FILES) windows/AltOS
184 makensis altos-windows.nsi