Statistics
| Branch: | Revision:

root / src / org.omnetpp.ide.nativelibs / Makefile @ 0418c1a0

History | View | Annotate | Download (3.84 KB)

1 0418c1a0 Simon Tenbusch
#
2
# Global definitions
3
#
4
5
include ../../Makefile.inc
6
7
# Make sure that output locations are set
8
ifeq ("$(strip $(OMNETPP_BIN_DIR))","")
9
$(error OMNETPP_BIN_DIR must be correctly set)
10
endif
11
ifeq ("$(strip $(OMNETPP_OUT_DIR))","")
12
$(error OMNETPP_OUT_DIR must be correctly set)
13
endif
14
ifeq ("$(strip $(OMNETPP_LIB_DIR))","")
15
$(error OMNETPP_LIB_DIR must be correctly set)
16
endif
17
18
L=$(OMNETPP_LIB_DIR)/$(TOOLCHAIN_NAME)
19
O=$(OMNETPP_OUT_DIR)/$(TOOLCHAIN_NAME)-$(MODE)/ui
20
21
#
22
# Local definitions
23
#
24
COMMON=$(OMNETPP_ROOT)/src/common
25
NEDXML=$(OMNETPP_ROOT)/src/nedxml
26
SCAVE=$(OMNETPP_ROOT)/src/scave
27
LAYOUT=$(OMNETPP_ROOT)/src/layout
28
EVENTLOG=$(OMNETPP_ROOT)/src/eventlog
29
30
COMMON_JAVAPKG = org.omnetpp.common.engine
31
NEDXML_JAVAPKG = org.omnetpp.ned.engine
32
SCAVE_JAVAPKG = org.omnetpp.scave.engine
33
LAYOUT_JAVAPKG = org.omnetpp.layout.engine
34
EVENTLOG_JAVAPKG = org.omnetpp.eventlog.engine
35
36
COMMON_JAVADIR = src/$(subst .,/,$(COMMON_JAVAPKG))
37
NEDXML_JAVADIR = src/$(subst .,/,$(NEDXML_JAVAPKG))
38
SCAVE_JAVADIR = src/$(subst .,/,$(SCAVE_JAVAPKG))
39
LAYOUT_JAVADIR = src/$(subst .,/,$(LAYOUT_JAVAPKG))
40
EVENTLOG_JAVADIR = src/$(subst .,/,$(EVENTLOG_JAVAPKG))
41
42
OBJS = $O/nedxml.o $O/scave.o $O/layout.o $O/eventlog.o $O/common.o $O/jprogressmonitor.o
43
LIBS=-L$L -loppnedxml$D -loppscave$D -lopplayout$D -loppeventlog$D -loppcommon$D
44
45
ifeq ("$(JNI_LIB_SUFFIX)",".dll")
46
# on mingw we dont need the lib prefix for a JNI library
47
DLL = opplibs$(JNI_LIB_SUFFIX)
48
# the following is needed for building JNI lib with mingw (name mangling issue)
49
LDFLAGS+= -Wl,--kill-at
50
else
51
DLL = $(LIB_PREFIX)opplibs$(JNI_LIB_SUFFIX)
52
endif
53
54
# on MAC OS X we should strip only the non-public symbols
55
ifeq ("$(JNI_LIB_SUFFIX)",".jnilib")
56
STRIP_FLAGS=-x
57
endif
58
59
DLL_TARGET_DIR = ../org.omnetpp.ide.nativelibs.$(PLATFORM)
60
61
#
62
# Local definitions
63
#
64
INCLUDES=-I$(COMMON) -I$(NEDXML) -I$(SCAVE) -I$(LAYOUT) -I$(EVENTLOG) -I$(OMNETPP_INCL_DIR)/platdep
65
COPTS=$(CFLAGS) $(JAVA_CFLAGS) $(INCLUDES) -DTHREADED $(PTHREAD_CFLAGS) 
66
67
#
68
# Automatic rules
69
#
70
.SUFFIXES : .cc .cxx
71
72
$O/%.o: %.cc
73
	@mkdir -p $O
74
	$(CXX) -c $(COPTS) -o $@ $<
75
76
$O/%.o: %.cxx
77
	@mkdir -p $O
78
	$(CXX) -c $(COPTS) -o $@ $<
79
80
#
81
# Targets
82
#
83
all: $(JNILIBS_IF_POSSIBLE)
84
85
jnilibs: $O/$(DLL) $(DLL_TARGET_DIR)/$(DLL)
86
87
common.cxx : common.i
88
	-rm -f $(COMMON_JAVADIR)/*.java
89
	-mkdir -p $(COMMON_JAVADIR)
90
	$(SWIG) -c++ -java $(INCLUDES) -package $(COMMON_JAVAPKG) -outdir $(COMMON_JAVADIR) -o $@ $<
91
92
nedxml.cxx : nedxml.i
93
	-rm -f $(NEDXML_JAVADIR)/*.java
94
	-mkdir -p $(NEDXML_JAVADIR)
95
	$(SWIG) -c++ -java $(INCLUDES) -package $(NEDXML_JAVAPKG) -outdir $(NEDXML_JAVADIR) -o $@ $<
96
97
scave.cxx : scave.i idlist.i
98
	-rm -f $(SCAVE_JAVADIR)/*.java
99
	-mkdir -p $(SCAVE_JAVADIR)
100
	$(SWIG) -c++ -java $(INCLUDES) -package $(SCAVE_JAVAPKG) -outdir $(SCAVE_JAVADIR) -o $@ scave.i
101
102
layout.cxx : layout.i
103
	-rm -f $(LAYOUT_JAVADIR)/*.java
104
	-mkdir -p $(LAYOUT_JAVADIR)
105
	$(SWIG) -c++ -java $(INCLUDES) -package $(LAYOUT_JAVAPKG) -outdir $(LAYOUT_JAVADIR) -o $@ $<
106
107
eventlog.cxx : eventlog.i
108
	-rm -f $(EVENTLOG_JAVADIR)/*.java
109
	-mkdir -p $(EVENTLOG_JAVADIR)
110
	$(SWIG) -c++ -java $(INCLUDES) -package $(EVENTLOG_JAVAPKG) -outdir $(EVENTLOG_JAVADIR) -o $@ $<
111
112
$O/$(DLL): $(OBJS)
113
	$(SHLIB_LD) $(LDFLAGS) -o $O/$(DLL) $(OBJS) $(LIBS) $(PTHREAD_LIBS)
114
	$(STRIP) $(STRIP_FLAGS) $O/$(DLL)
115
116
$(DLL_TARGET_DIR)/$(DLL): $O/$(DLL)
117
	cp $O/$(DLL) $(DLL_TARGET_DIR)
118
119
120
missing-dependency:
121
	@echo '  *** Missing required dependency -- skipping build of UI support library.'
122
	@echo '  *** Install missing packages (probably SWIG and/or JDK), then run ./configure again.'
123
124
depend:
125
	$(MAKEDEPEND) $(INCLUDES) -fMakefile -- *.cxx *.cc
126
127
clean:
128
	-rm -f *.cxx *.o *.a *.so $(DLL_TARGET_DIR)/$(DLL)
129
	-rm -rf $(COMMON_JAVADIR) $(NEDXML_JAVADIR) $(SCAVE_JAVADIR) $(LAYOUT_JAVADIR) $(EVENTLOG_JAVADIR)
130
131
# DO NOT DELETE THIS LINE -- make depend depends on it.
132