]> git.gag.com Git - fw/altos/blob - libaltos/Makefile.am
altos: Escape lisp REP loop with () input
[fw/altos] / libaltos / Makefile.am
1 JAVAC=javac
2 AM_CFLAGS=-DLINUX -DPOSIX_TTY -I$(JVM_INCLUDE) -I$(JVM_INCLUDE)/linux
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_common.c \
12         libaltos_posix.c \
13         libaltos_linux.c \
14         libaltos_wrap.c \
15         libaltos.h \
16         libaltos_posix.h \
17         libaltos_private.h
18
19 WINDOWS_SRC=\
20         libaltos_common.c\
21         libaltos_windows.c\
22         libaltos_wrap.c
23
24 WINDOWS_H=\
25         libaltos.h
26
27 noinst_PROGRAMS=cjnitest
28
29 cjnitest_SOURCES=cjnitest.c
30 cjnitest_LDADD=libaltos.la
31
32 if MULTI_ARCH
33 altoslib_LTLIBRARIES+=libaltos32.la libaltos64.la
34
35 libaltos32_la_LDFLAGS=$(libaltos_la_LDFLAGS)
36 libaltos64_la_LDFLAGS=$(libaltos_la_LDFLAGS)
37
38 libaltos32_la_CFLAGS=-m32 $(AM_CFLAGS)
39 libaltos64_la_CFLAGS=-m64 $(AM_CFLAGS)
40
41 libaltos32_la_SOURCES=$(libaltos_la_SOURCES)
42 libaltos64_la_SOURCES=$(libaltos_la_SOURCES)
43
44 noinst_PROGRAMS+=cjnitest32 cjnitest64
45
46 cjnitest32_CFLAGS=-m32
47 cjnitest64_CFLAGS=-m64
48
49 cjnitest32_SOURCES=$(cjnitest_SOURCES)
50 cjnitest64_SOURCES=$(cjnitest_SOURCES)
51
52 cjnitest32_LDADD=libaltos32.la
53 cjnitest64_LDADD=libaltos64.la
54
55 endif
56
57 LIBS=-ldl
58
59 HFILES=libaltos.h
60
61 SWIG_FILE=libaltos.swig
62
63 CLASSDIR=libaltosJNI
64
65 $(SWIG_FILE): libaltos.i0 $(HFILES)
66         sed 's;//%;%;' libaltos.i0 $(HFILES) > $(SWIG_FILE)
67
68 all-local: classlibaltos.stamp
69
70 libaltos_wrap.c: classlibaltos.stamp
71
72 classlibaltos.stamp: $(SWIG_FILE)
73         swig -java -package libaltosJNI $(SWIG_FILE)
74         mkdir -p libaltosJNI
75         $(JAVAC) -d . $(AM_JAVACFLAGS) $(JAVACFLAGS) *.java && \
76         touch classlibaltos.stamp
77
78 MINGCC32=i686-w64-mingw32-gcc
79 MINGCC64=x86_64-w64-mingw32-gcc
80 MINGFLAGS=-Wall -Wextra -DWINDOWS -DBUILD_DLL -mconsole -I$(JVM_INCLUDE) -I$(JVM_INCLUDE)/linux
81 MINGLIBS=-lsetupapi -lws2_32
82
83 fat: all altos.dll altos64.dll
84
85 altos.dll: $(WINDOWS_SRC) $(WINDOWS_H)
86         $(MINGCC32) -o $@ $(MINGFLAGS) -shared $(WINDOWS_SRC) $(MINGLIBS)
87
88 altos64.dll: $(WINDOWS_SRC) $(WINDOWS_H)
89         $(MINGCC64) -o $@ $(MINGFLAGS) -shared $(WINDOWS_SRC) $(MINGLIBS)
90
91 clean-local:
92         -rm -rf libaltosJNI *.class *.java classlibaltos.stamp $(SWIG_FILE) libaltos_wrap.c altos.dll altos64.dll