Statistics
| Branch: | Revision:

root / ide / org.omnetpp.ide.nativelibs / Makefile @ b5650378

History | View | Annotate | Download (3.92 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 63d0f40e Georg Kunz
UI_VERSION_STRING = 4.1.0.100611-4b63c38
60
DLL_TARGET_DIR = ../plugins/org.omnetpp.ide.nativelibs.$(PLATFORM)_$(UI_VERSION_STRING)
61 0418c1a0 Simon Tenbusch
62
#
63
# Local definitions
64
#
65
INCLUDES=-I$(COMMON) -I$(NEDXML) -I$(SCAVE) -I$(LAYOUT) -I$(EVENTLOG) -I$(OMNETPP_INCL_DIR)/platdep
66
COPTS=$(CFLAGS) $(JAVA_CFLAGS) $(INCLUDES) -DTHREADED $(PTHREAD_CFLAGS) 
67
68
#
69
# Automatic rules
70
#
71
.SUFFIXES : .cc .cxx
72
73
$O/%.o: %.cc
74
	@mkdir -p $O
75
	$(CXX) -c $(COPTS) -o $@ $<
76
77
$O/%.o: %.cxx
78
	@mkdir -p $O
79
	$(CXX) -c $(COPTS) -o $@ $<
80
81
#
82
# Targets
83
#
84
all: $(JNILIBS_IF_POSSIBLE)
85
86
jnilibs: $O/$(DLL) $(DLL_TARGET_DIR)/$(DLL)
87
88
common.cxx : common.i
89
	-rm -f $(COMMON_JAVADIR)/*.java
90
	-mkdir -p $(COMMON_JAVADIR)
91
	$(SWIG) -c++ -java $(INCLUDES) -package $(COMMON_JAVAPKG) -outdir $(COMMON_JAVADIR) -o $@ $<
92
93
nedxml.cxx : nedxml.i
94
	-rm -f $(NEDXML_JAVADIR)/*.java
95
	-mkdir -p $(NEDXML_JAVADIR)
96
	$(SWIG) -c++ -java $(INCLUDES) -package $(NEDXML_JAVAPKG) -outdir $(NEDXML_JAVADIR) -o $@ $<
97
98
scave.cxx : scave.i idlist.i
99
	-rm -f $(SCAVE_JAVADIR)/*.java
100
	-mkdir -p $(SCAVE_JAVADIR)
101
	$(SWIG) -c++ -java $(INCLUDES) -package $(SCAVE_JAVAPKG) -outdir $(SCAVE_JAVADIR) -o $@ scave.i
102
103
layout.cxx : layout.i
104
	-rm -f $(LAYOUT_JAVADIR)/*.java
105
	-mkdir -p $(LAYOUT_JAVADIR)
106
	$(SWIG) -c++ -java $(INCLUDES) -package $(LAYOUT_JAVAPKG) -outdir $(LAYOUT_JAVADIR) -o $@ $<
107
108
eventlog.cxx : eventlog.i
109
	-rm -f $(EVENTLOG_JAVADIR)/*.java
110
	-mkdir -p $(EVENTLOG_JAVADIR)
111
	$(SWIG) -c++ -java $(INCLUDES) -package $(EVENTLOG_JAVAPKG) -outdir $(EVENTLOG_JAVADIR) -o $@ $<
112
113
$O/$(DLL): $(OBJS)
114
	$(SHLIB_LD) $(LDFLAGS) -o $O/$(DLL) $(OBJS) $(LIBS) $(PTHREAD_LIBS)
115
	$(STRIP) $(STRIP_FLAGS) $O/$(DLL)
116
117
$(DLL_TARGET_DIR)/$(DLL): $O/$(DLL)
118 63d0f40e Georg Kunz
	cp $O/$(DLL) $(DLL_TARGET_DIR)/$(DLL)
119 0418c1a0 Simon Tenbusch
120
121
missing-dependency:
122
	@echo '  *** Missing required dependency -- skipping build of UI support library.'
123
	@echo '  *** Install missing packages (probably SWIG and/or JDK), then run ./configure again.'
124
125
depend:
126
	$(MAKEDEPEND) $(INCLUDES) -fMakefile -- *.cxx *.cc
127
128
clean:
129
	-rm -f *.cxx *.o *.a *.so $(DLL_TARGET_DIR)/$(DLL)
130
	-rm -rf $(COMMON_JAVADIR) $(NEDXML_JAVADIR) $(SCAVE_JAVADIR) $(LAYOUT_JAVADIR) $(EVENTLOG_JAVADIR)
131
132
# DO NOT DELETE THIS LINE -- make depend depends on it.
133