]> git.gag.com Git - fw/altos/blob - libaltos/Makefile.am
altosdroid: Update version code and name for 1.5
[fw/altos] / libaltos / Makefile.am
1 JAVAC=javac
2 AM_CFLAGS=-DLINUX -DPOSIX_TTY -I$(JVM_INCLUDE)
3 AM_JAVACFLAGS=-target 1.6 -encoding UTF-8 -Xlint:deprecation -source 6
4
5 altoslibdir=$(libdir)/altos
6
7 altoslib_LTLIBRARIES=libaltos.la
8 libaltos_la_LDFLAGS=-version-info 1:0:1 -Wl,-znoexecstack
9
10 libaltos_la_SOURCES=\
11         libaltos.c \
12         libaltos_wrap.c
13
14 noinst_PROGRAMS=cjnitest
15
16 cjnitest_SOURCES=cjnitest.c
17 cjnitest_LDADD=libaltos.la
18
19 if MULTI_ARCH
20 altoslib_LTLIBRARIES+=libaltos32.la libaltos64.la
21
22 libaltos32_la_LDFLAGS=$(libaltos_la_LDFLAGS)
23 libaltos64_la_LDFLAGS=$(libaltos_la_LDFLAGS)
24
25 libaltos32_la_CFLAGS=-m32 $(AM_CFLAGS)
26 libaltos64_la_CFLAGS=-m64 $(AM_CFLAGS)
27
28 libaltos32_la_SOURCES=$(libaltos_la_SOURCES)
29 libaltos64_la_SOURCES=$(libaltos_la_SOURCES)
30
31 noinst_PROGRAMS+=cjnitest32 cjnitest64
32
33 cjnitest32_CFLAGS=-m32
34 cjnitest64_CFLAGS=-m64
35
36 cjnitest32_SOURCES=$(cjnitest_SOURCES)
37 cjnitest64_SOURCES=$(cjnitest_SOURCES)
38
39 cjnitest32_LDADD=libaltos32.la
40 cjnitest64_LDADD=libaltos64.la
41
42 endif
43
44 LIBS=-ldl
45
46 HFILES=libaltos.h
47
48 SWIG_FILE=libaltos.swig
49
50 CLASSDIR=libaltosJNI
51
52 $(SWIG_FILE): libaltos.i0 $(HFILES)
53         sed 's;//%;%;' libaltos.i0 $(HFILES) > $(SWIG_FILE)
54
55 all-local: classlibaltos.stamp
56
57 libaltos_wrap.c: classlibaltos.stamp
58
59 classlibaltos.stamp: $(SWIG_FILE)
60         swig -java -package libaltosJNI $(SWIG_FILE)
61         mkdir -p libaltosJNI
62         $(JAVAC) -d . $(AM_JAVACFLAGS) $(JAVACFLAGS) *.java && \
63         touch classlibaltos.stamp
64
65 MINGCC32=i686-w64-mingw32-gcc
66 MINGCC64=x86_64-w64-mingw32-gcc
67 MINGFLAGS=-Wall -DWINDOWS -DBUILD_DLL -I$(JVM_INCLUDE)
68 MINGLIBS=-lsetupapi
69
70 fat: all altos.dll altos64.dll
71
72 altos.dll: $(libaltos_la_SOURCES)
73         $(MINGCC32) -o $@ $(MINGFLAGS) -shared $(libaltos_la_SOURCES) $(MINGLIBS)
74
75 altos64.dll: $(libaltos_la_SOURCES)
76         $(MINGCC64) -o $@ $(MINGFLAGS) -shared $(libaltos_la_SOURCES) $(MINGLIBS)
77
78 clean-local:
79         -rm -rf libaltosJNI *.class *.java classlibaltos.stamp $(SWIG_FILE) libaltos_wrap.c altos.dll altos64.dll