2 AM_JAVACFLAGS=$(JAVAC_VERSION_FLAGS) -encoding UTF-8 -Xlint:deprecation -Xlint:unchecked
6 altoslibdir=$(libdir)/altos
8 CLASSPATH_ENV=mkdir -p $(JAVAROOT); CLASSPATH=".:classes:../altoslib/*:../altosuilib/*:../libaltos:$(JCOMMON)/jcommon.jar:$(JFREECHART)/jfreechart.jar"
12 micropeakdir=$(datadir)/java
25 MicroFileChooser.java \
26 MicroDeviceDialog.java \
37 FATJAR=micropeak-fat.jar
40 LIBALTOS_LINUX=libaltos32.so libaltos64.so
42 LIBALTOS_LINUX=libaltos.so
52 altoslib_$(ALTOSLIB_VERSION).jar
55 altosuilib_$(ALTOSUILIB_VERSION).jar
58 ICONDIR=$(top_srcdir)/icon
61 $(ICONDIR)/altusmetrum-micropeak-16.png \
62 $(ICONDIR)/altusmetrum-micropeak-32.png \
63 $(ICONDIR)/altusmetrum-micropeak-48.png \
64 $(ICONDIR)/altusmetrum-micropeak-64.png \
65 $(ICONDIR)/altusmetrum-micropeak-128.png\
66 $(ICONDIR)/altusmetrum-micropeak-256.png
68 # icon base names for jar
70 -C $(ICONDIR) altusmetrum-micropeak-16.png \
71 -C $(ICONDIR) altusmetrum-micropeak-32.png \
72 -C $(ICONDIR) altusmetrum-micropeak-48.png \
73 -C $(ICONDIR) altusmetrum-micropeak-64.png \
74 -C $(ICONDIR) altusmetrum-micropeak-128.png\
75 -C $(ICONDIR) altusmetrum-micropeak-256.png
78 ../icon/altusmetrum-micropeak.ico \
79 ../icon/altusmetrum-micropeak.exe
80 ../icon/application-vnd.altusmetrum.micropeak.ico \
81 ../icon/application-vnd.altusmetrum.micropeak.ico
84 ../icon/altusmetrum-micropeak.icns \
85 ../icon/application-vnd.altusmetrum.micropeak.icns
88 $(ICONDIR)/altusmetrum-micropeak.svg \
89 $(ICONDIR)/application-vnd.altusmetrum.micropeak.svg
92 $(ICONDIR)/org-altusmetrum-mimetypes.xml
94 desktopdir = $(datadir)/applications
95 desktop_file = altusmetrum-micropeak.desktop
96 desktop_SCRIPTS = $(desktop_file)
98 all-local: micropeak-test micropeak-jdb $(JAR) $(MDWN)
101 -rm -rf classes $(JAR) $(FATJAR) \
102 MicroPeak-Linux-*.tar.bz2 MicroPeak-Mac-*.dmg MicroPeak-Windows-*.exe \
103 altoslib_*.jar altosuilib_*.jar \
104 $(JFREECHART_CLASS) $(JCOMMON_CLASS) $(LIBALTOS) Manifest.txt Manifest-fat.txt \
105 micropeak micropeak-test micropeak-jdb macosx linux windows micropeak-windows.log \
106 micropeak-windows.nsi *.desktop *.mdwn
108 EXTRA_DIST = $(desktop_file).in
110 $(desktop_file): $(desktop_file).in
111 sed -e 's#%bindir%#@bindir@#' -e 's#%icondir%#$(datadir)/icons/hicolor/scalable/apps#' ${srcdir}/$(desktop_file).in > $@
114 LINUX_DIST=MicroPeak-Linux-$(VERSION).tar.bz2
115 LINUX_SH=MicroPeak-Linux-$(VERSION).sh
116 MACOSX_DIST=MicroPeak-Mac-$(VERSION).dmg
117 WINDOWS_DIST=MicroPeak-Windows-$(VERSION_DASH).exe
121 MICROPEAK_DOC=$(top_srcdir)/doc/micropeak.pdf
125 FAT_FILES=$(FATJAR) $(ALTOSLIB_CLASS) $(ALTOSUILIB_CLASS) $(FREETTS_CLASS) $(JFREECHART_CLASS) $(JCOMMON_CLASS)
127 LINUX_FILES=$(FAT_FILES) $(LIBALTOS_LINUX) $(FIRMWARE) $(DOC) $(desktop_file).in $(LINUX_ICONS) $(LINUX_MIMETYPE)
128 LINUX_EXTRA=micropeak-fat $(desktop_file).in
130 MACOSX_DRIVER_0_URL=http://www.ftdichip.com/Drivers/VCP/MacOSX/FTDIUSBSerialDriver_v2_2_18.dmg
131 MACOSX_DRIVER_0=FTDI_v2_2_18.dmg
133 MACOSX_DRIVER_1_URL=http://www.ftdichip.com/Drivers/VCP/MacOSX/FTDIUSBSerialDriver_v2_3.dmg
134 MACOSX_DRIVER_1=FTDI_v2_3.dmg
136 MACOSX_DRIVERS=$(MACOSX_DRIVER_1) $(MACOSX_DRIVER_0)
138 MACOSX_INFO_PLIST=Info.plist
139 MACOSX_README=ReadMe-Mac.rtf
140 MACOSX_INSTALL=../altosui/install-macosx ../altosui/ask-pass
141 MACOSX_FILES=$(FAT_FILES) libaltos.dylib $(MACOSX_INFO_PLIST) $(MACOSX_DRIVERS) $(MACOSX_README) $(DOC) $(MACOSX_ICONS) $(MACOSX_INSTALL)
144 wget -O $@ $(MACOSX_DRIVER_0_URL)
147 wget -O $@ $(MACOSX_DRIVER_1_URL)
149 WINDOWS_DRIVER_URL=http://www.ftdichip.com/Drivers/CDM/CDM%20v2.12.00%20WHQL%20Certified.exe
150 WINDOWS_DRIVER=CDM_v2.12.00_WHQL_Certified.exe
153 wget -O "$(WINDOWS_DRIVER)" "$(WINDOWS_DRIVER_URL)"
155 WINDOWS_FILES=$(FAT_FILES) altos.dll altos64.dll $(DOC) $(WINDOWS_ICONS) $(WINDOWS_DRIVER)
159 FATTARGET=$(FATDIR)/MicroPeak/releases/$(VERSION)
161 LINUX_SH_TARGET=$(FATTARGET)/$(LINUX_SH)
162 MACOSX_DIST_TARGET=$(FATTARGET)/$(MACOSX_DIST)
163 WINDOWS_DIST_TARGET=$(FATTARGET)/$(WINDOWS_DIST)
164 MDWN_TARGET=$(FATDIR)/MicroPeak/releases/$(MDWN)
165 RELNOTES=release-notes-$(VERSION).html
166 RELNOTES_SRC=$(top_builddir)/doc/$(RELNOTES)
167 RELNOTES_TARGET=$(FATTARGET)/$(RELNOTES)
169 fat-install: $(LINUX_SH_TARGET) $(MACOSX_DIST_TARGET) $(WINDOWS_DIST_TARGET) $(MDWN_TARGET) $(RELNOTES_TARGET)
171 $(LINUX_SH_TARGET): $(LINUX_SH)
172 mkdir -p $(FATTARGET)
175 $(MACOSX_DIST_TARGET): $(MACOSX_DIST)
176 mkdir -p $(FATTARGET)
179 $(WINDOWS_DIST_TARGET): $(WINDOWS_DIST)
180 mkdir -p $(FATTARGET)
183 $(MDWN_TARGET): $(MDWN)
184 mkdir -p $(FATTARGET)
187 $(RELNOTES_TARGET): $(RELNOTES_SRC)
188 mkdir -p $(FATTARGET)
189 sh $(top_srcdir)/doc/install-html -d $(FATTARGET) $(RELNOTES_SRC)
194 sed -e 's/%version%/$(VERSION)/g' -e 's/%version_dash%/$(VERSION_DASH)/g' $(MDWNTMPL) > $@
196 fat: $(LINUX_DIST) $(LINUX_SH) $(MACOSX_DIST) $(WINDOWS_DIST)
200 echo "#!/bin/sh" > $@
201 echo 'exec java -Djava.library.path="$(altoslibdir)" -jar "$(micropeakdir)/micropeak.jar" "$$@"' >> $@
204 micropeak-jdb: Makefile
205 echo "#!/bin/sh" > $@
206 echo 'exec jdb -classpath "classes:./*:../libaltos:$(JCOMMON)/jcommon.jar:$(JFREECHART)/jfreechart.jar" -Djava.library.path="../libaltos/.libs" org.altusmetrum.micropeak.MicroPeak "$$@"' >> $@
209 micropeak-test: Makefile
210 echo "#!/bin/sh" > $@
211 echo 'exec java -cp "./*:../libaltos/*:$(JCOMMON)/jcommon.jar:$(JFREECHART)/jfreechart.jar" -Djava.library.path="../libaltos/.libs" -jar micropeak.jar "$$@"' >> $@
214 install-micropeakJAVA: micropeak.jar
216 test -z "$(micropeakdir)" || $(MKDIR_P) "$(DESTDIR)$(micropeakdir)"
217 echo " $(INSTALL_DATA)" "$<" "'$(DESTDIR)$(micropeakdir)/micropeak.jar'"; \
218 $(INSTALL_DATA) "$<" "$(DESTDIR)$(micropeakdir)"
220 $(JAR): classmicropeak.stamp Manifest.txt $(JAVA_ICONS) $(ALTOSLIB_CLASS) $(ALTOSUILIB_CLASS)
221 jar cfm $@ Manifest.txt \
224 -C ../libaltos libaltosJNI
225 if STRIP_NONDETERMINISM
226 $(STRIP_NONDETERMINISM) $@
229 $(FATJAR): classmicropeak.stamp Manifest-fat.txt $(ALTOSLIB_CLASS) $(ALTOSUILIB_CLASS) $(JFREECHART_CLASS) $(JCOMMON_CLASS) $(JAVA_ICONS)
230 jar cfm $@ Manifest-fat.txt \
233 -C ../libaltos libaltosJNI
234 if STRIP_NONDETERMINISM
235 $(STRIP_NONDETERMINISM) $@
238 classaltosui.stamp: $(ALTOSLIB_CLASS) $(ALTOSUILIB_CLASS)
240 libaltos.so: build-libaltos
242 $(LN_S) ../libaltos/.libs/"$@" .
244 libaltos32.so: build-libaltos
246 $(LN_S) ../libaltos/.libs/"$@" .
248 libaltos64.so: build-libaltos
250 $(LN_S) ../libaltos/.libs/"$@" .
254 $(LN_S) ../libaltos/"$@" .
256 altos.dll: ../libaltos/altos.dll
258 $(LN_S) ../libaltos/"$@" .
260 altos64.dll: ../libaltos/altos64.dll
262 $(LN_S) ../libaltos/"$@" .
264 ../libaltos/.libs/libaltos64.so: ../libaltos/.libs/libaltos32.so
266 ../libaltos/.libs/libaltos32.so: build-libaltos
268 ../libaltos/.libs/libaltos.so: build-libaltos
270 ../libaltos/altos.dll: build-altos-dll
272 ../libaltos/altos64.dll: build-altos64-dll
275 +cd ../libaltos && make libaltos.la
277 +cd ../libaltos && make altos.dll
280 +cd ../libaltos && make altos64.dll
284 $(LN_S) ../altoslib/"$@" .
288 $(LN_S) ../altosuilib/"$@" .
292 $(LN_S) "$(JFREECHART)"/"$@" .
296 $(LN_S) "$(JCOMMON)"/"$@" .
298 $(LINUX_DIST): $(LINUX_FILES) $(LINUX_EXTRA)
301 mkdir -p linux/MicroPeak
302 cp -p $(LINUX_FILES) linux/MicroPeak
303 cp -p micropeak-fat linux/MicroPeak/micropeak
304 chmod +x linux/MicroPeak/micropeak
305 tar cjf $@ -C linux MicroPeak
307 $(LINUX_SH): $(LINUX_DIST) $(srcdir)/../altosui/linux-install.sh
308 sed 's/AltOS/MicroPeak/g' $(srcdir)/../altosui/linux-install.sh | cat - $(LINUX_DIST) > $@
311 $(MACOSX_DIST): $(MACOSX_FILES)
315 cp -a MicroPeak.app macosx/
316 cp -a $(MACOSX_README) macosx/ReadMe-MicroPeak.rtf
317 cp -a $(MACOSX_INSTALL) macosx
319 cp -p Info.plist macosx/MicroPeak.app/Contents
320 cp -p $(MACOSX_DRIVERS) macosx
321 mkdir -p macosx/MicroPeak.app/Contents/Resources/Java
322 cp -p $(MACOSX_ICONS) macosx/MicroPeak.app/Contents/Resources
323 cp -p $(FATJAR) macosx/MicroPeak.app/Contents/Resources/Java/micropeak.jar
324 cp -p libaltos.dylib macosx/MicroPeak.app/Contents/Resources/Java
325 cp -p $(ALTOSLIB_CLASS) macosx/MicroPeak.app/Contents/Resources/Java
326 cp -p $(ALTOSUILIB_CLASS) macosx/MicroPeak.app/Contents/Resources/Java
327 cp -p $(JFREECHART_CLASS) macosx/MicroPeak.app/Contents/Resources/Java
328 cp -p $(JCOMMON_CLASS) macosx/MicroPeak.app/Contents/Resources/Java
329 genisoimage -D -V MicroPeak-$(VERSION) -no-pad -r -apple -o $@ macosx
331 $(WINDOWS_DIST): $(WINDOWS_FILES) micropeak-windows.nsi
333 makensis -Omicropeak-windows.log "-XOutFile $@" "-DVERSION=$(VERSION)" micropeak-windows.nsi || (cat micropeak-windows.log && exit 1)
335 Manifest.txt: Makefile
336 echo 'Main-Class: org.altusmetrum.micropeak.MicroPeak' > $@
337 echo "Class-Path: $(ALTOSLIB_CLASS) $(ALTOSUILIB_CLASS) $(JCOMMON)/jcommon.jar $(JFREECHART)/jfreechart.jar" >> $@
340 echo 'Main-Class: org.altusmetrum.micropeak.MicroPeak' > $@
341 echo "Class-Path: $(ALTOSLIB_CLASS) $(ALTOSUILIB_CLASS) jcommon.jar jfreechart.jar" >> $@