1 | |
---|
2 | .SUFFIXES: .class .java |
---|
3 | |
---|
4 | bindir = @bindir@ |
---|
5 | datadir = @datadir@ |
---|
6 | datarootdir = @datarootdir@ |
---|
7 | exec_prefix = @exec_prefix@ |
---|
8 | includedir = @includedir@ |
---|
9 | libdir = @libdir@ |
---|
10 | mandir = @mandir@ |
---|
11 | prefix = @prefix@ |
---|
12 | srcdir = @srcdir@ |
---|
13 | |
---|
14 | destdir = $(libdir)/java |
---|
15 | packagedir = $(destdir)/rappture |
---|
16 | VPATH = $(srcdir):rappture |
---|
17 | |
---|
18 | INSTALL = @INSTALL@ |
---|
19 | SOEXT = @SHLIB_SUFFIX@ |
---|
20 | |
---|
21 | JAVA_HOME = @JAVA_HOME@ |
---|
22 | JAVA_INCLUDES = @JAVA_INC_SPEC@ |
---|
23 | JAVA = @JAVA@ |
---|
24 | JAVAC = @JAVAC@ |
---|
25 | JAVAH = @JAVAH@ |
---|
26 | |
---|
27 | CXX = @CXX@ |
---|
28 | CC = @CXX@ |
---|
29 | |
---|
30 | CFLAGS_DEBUG = @CFLAGS_DEBUG@ -Wall |
---|
31 | CFLAGS_OPTIMIZE = @CFLAGS_OPTIMIZE@ |
---|
32 | STLIB_LD = @STLIB_LD@ |
---|
33 | SHLIB_LD = @SHLIB_LD@ |
---|
34 | SHLIB_CFLAGS = @SHLIB_CFLAGS@ |
---|
35 | SHLIB_LDFLAGS = @SHLIB_LDFLAGS@ |
---|
36 | SHLIB_SUFFIX = @SHLIB_SUFFIX@ |
---|
37 | CFLAGS_DEFAULT = @CFLAGS_DEFAULT@ |
---|
38 | CFLAGS = ${CFLAGS_DEFAULT} ${CFLAGS_WARNING} ${SHLIB_CFLAGS} |
---|
39 | LIB_SEARCH_DIRS = @LIB_SEARCH_DIRS@ |
---|
40 | |
---|
41 | MKDIR_P = @MKDIR_P@ |
---|
42 | RM = rm -f |
---|
43 | |
---|
44 | INCLUDES = $(JAVA_INCLUDES) -I $(srcdir)/../../src/core -I . |
---|
45 | LIBS = -L../../src/core -lrappture |
---|
46 | |
---|
47 | CC_SWITCHES = $(CFLAGS) $(CFLAGS_DEBUG) $(SHLIB_CFLAGS) $(INCLUDES) $(DEFINES) |
---|
48 | CXX_SWITCHES = $(CFLAGS) $(CFLAGS_DEBUG) $(SHLIB_CFLAGS) $(INCLUDES) $(DEFINES) |
---|
49 | |
---|
50 | CLASSPATH = .:.. |
---|
51 | JAVAC_SWITCHES = -cp $(CLASSPATH) -d . |
---|
52 | JAVAH_SWITCHES = -jni -classpath $(CLASSPATH) |
---|
53 | |
---|
54 | CLASSFILES = \ |
---|
55 | rappture/Library.class \ |
---|
56 | rappture/Units.class \ |
---|
57 | rappture/Utils.class |
---|
58 | |
---|
59 | HEADERS = \ |
---|
60 | jRpLibrary.h \ |
---|
61 | jRpUnits.h \ |
---|
62 | jRpUtils.h |
---|
63 | |
---|
64 | OBJS = \ |
---|
65 | jRpLibrary.o \ |
---|
66 | jRpUnits.o \ |
---|
67 | jRpUtils.o |
---|
68 | |
---|
69 | name = JRappture |
---|
70 | libname = lib$(name) |
---|
71 | lib = $(libname).a |
---|
72 | shared_lib = $(libname)$(SHLIB_SUFFIX) |
---|
73 | |
---|
74 | all: $(shared_lib) |
---|
75 | |
---|
76 | $(shared_lib): $(OBJS) |
---|
77 | $(SHLIB_LD) $(SHLIB_LDFLAGS) -o $@ $(OBJS) \ |
---|
78 | $(LIB_SEARCH_DIRS) $(LIBS) |
---|
79 | |
---|
80 | jRpLibrary.o: $(srcdir)/jRpLibrary.cc jRpLibrary.h |
---|
81 | $(CXX) -c $(CXX_SWITCHES) -o $@ $< |
---|
82 | |
---|
83 | jRpUnits.o: $(srcdir)/jRpUnits.cc jRpUnits.h |
---|
84 | $(CXX) -c $(CXX_SWITCHES) -o $@ $< |
---|
85 | |
---|
86 | jRpUtils.o: $(srcdir)/jRpUtils.cc jRpUtils.h |
---|
87 | $(CXX) -c $(CXX_SWITCHES) -o $@ $< |
---|
88 | |
---|
89 | .java.class: |
---|
90 | $(JAVAC) $(JAVAC_SWITCHES) $< |
---|
91 | |
---|
92 | jRpLibrary.h: Library.class |
---|
93 | $(JAVAH) $(JAVAH_SWITCHES) -o $@ rappture.Library |
---|
94 | |
---|
95 | jRpUnits.h: Units.class |
---|
96 | $(JAVAH) $(JAVAH_SWITCHES) -o $@ rappture.Units |
---|
97 | |
---|
98 | jRpUtils.h: Utils.class |
---|
99 | $(JAVAH) $(JAVAH_SWITCHES) -o $@ rappture.Utils |
---|
100 | |
---|
101 | install: install-library install-classfiles |
---|
102 | |
---|
103 | install-library: $(shared_lib) |
---|
104 | $(MKDIR_P) -m 0755 $(libdir) |
---|
105 | $(INSTALL) -m 0555 $(shared_lib) $(libdir) |
---|
106 | |
---|
107 | install-classfiles: |
---|
108 | $(MAKE) -C rappture install || exit 1 |
---|
109 | |
---|
110 | clean: |
---|
111 | $(MAKE) -C rappture clean || exit 1 |
---|
112 | $(RM) $(CLASSFILES) $(OBJS) $(HEADERS) $(lib) $(shared_lib) |
---|
113 | |
---|
114 | distclean: clean |
---|
115 | $(MAKE) -C rappture distclean || exit 1 |
---|
116 | $(RM) Makefile |
---|
117 | |
---|