Statistics
| Branch: | Revision:

root / src / org.omnetpp.ide.nativelibs / Makefile.vc @ 79bb12dc

History | View | Annotate | Download (3.82 KB)

1
#
2
# Global definitions
3
#
4
!include ..\..\configuser.vc
5

    
6
# Make sure that output locations are set
7
!if "$(OMNETPP_BIN_DIR)"==""
8
!error OMNETPP_BIN_DIR must be correctly set
9
!endif
10
!if "$(OMNETPP_OUT_DIR)"==""
11
!error OMNETPP_OUT_DIR must be correctly set
12
!endif
13
!if "$(OMNETPP_LIB_DIR)"==""
14
!error OMNETPP_LIB_DIR must be correctly set
15
!endif
16

    
17
# Make sure that we are linking statically
18
!if "$(LIB_SUFFIX)"!=".lib"
19
!error The UI library is supported only with static linking. Please build with "nmake SHARED_LIBS=no ..."
20
!endif
21

    
22
L=$(OMNETPP_LIB_DIR)/$(TOOLCHAIN_NAME)
23
O=$(OMNETPP_OUT_DIR)/$(TOOLCHAIN_NAME)-$(MODE)/ui
24

    
25
JDK="$(TOOLS_DIR)\jdk1.5.0"
26
SWIG="$(TOOLS_DIR)\SWIGWIN-1.3.31\swig.exe"
27

    
28
COMMON=$(OMNETPP_ROOT)\src\common
29
NEDXML=$(OMNETPP_ROOT)\src\nedxml
30
SCAVE=$(OMNETPP_ROOT)\src\scave
31
LAYOUT=$(OMNETPP_ROOT)\src\layout
32
EVENTLOG=$(OMNETPP_ROOT)\src\eventlog
33

    
34
COMMON_JAVAPKG = org.omnetpp.common.engine
35
NEDXML_JAVAPKG = org.omnetpp.ned.engine
36
SCAVE_JAVAPKG = org.omnetpp.scave.engine
37
LAYOUT_JAVAPKG = org.omnetpp.layout.engine
38
EVENTLOG_JAVAPKG = org.omnetpp.eventlog.engine
39

    
40
COMMON_JAVADIR = src\$(COMMON_JAVAPKG:.=\)
41
NEDXML_JAVADIR = src\$(NEDXML_JAVAPKG:.=\)
42
SCAVE_JAVADIR = src\$(SCAVE_JAVAPKG:.=\)
43
LAYOUT_JAVADIR = src\$(LAYOUT_JAVAPKG:.=\)
44
EVENTLOG_JAVADIR = src\$(EVENTLOG_JAVAPKG:.=\)
45

    
46
OBJS = $O/common.obj $O/nedxml.obj $O/scave.obj $O/layout.obj $O/eventlog.obj $O/jprogressmonitor.obj
47
LIBS=$L/oppcommon$D.lib $L/oppnedxml$D.lib $L/oppscave$D.lib $L/opplayout$D.lib $L/oppeventlog$D.lib
48

    
49
DLL = opplibs.dll
50
DLL_TARGET_DIR = ..\org.omnetpp.ide.nativelibs.win32.x86
51

    
52

    
53
#
54
# Local definitions
55
#
56
INCLUDES=-I$(COMMON) -I$(NEDXML) -I$(SCAVE) -I$(LAYOUT) -I$(EVENTLOG) -I$(OMNETPP_INCL_DIR)/platdep 
57
COPTS=$(CFLAGS) -I$(JDK)\include -I$(JDK)\include\win32 $(INCLUDES) -DTHREADED $(PTHREAD_CFLAGS)
58
SWIGOPTS=$(SWIGFLAGS) $(INCLUDES)
59

    
60
#
61
# Automatic rules
62
#
63
.SUFFIXES : .cc .cxx
64

    
65
{.}.cc{$O}.obj:
66
	$(CXX) /Fo"$@" $(COPTS) /c /Tp $<
67

    
68
{.}.cxx{$O}.obj:
69
	$(CXX) /Fo"$@" $(COPTS) /c /Tp $<
70

    
71
#
72
# Targets. NOTE: cmd.exe "Command Extensions" must be enabled for "mkdir" commands to work!
73
#
74
all: $(JNILIBS_IF_POSSIBLE)
75

    
76
jnilibs: $O/$(DLL) $(DLL_TARGET_DIR)/$(DLL)
77

    
78
common.cxx : common.i
79
	-del $(COMMON_JAVADIR)\*.java >nul
80
	-mkdir $(COMMON_JAVADIR) >nul
81
	$(SWIG) -c++ -java $(SWIGOPTS) -package $(COMMON_JAVAPKG) -outdir $(COMMON_JAVADIR) -o $@ $**
82

    
83
nedxml.cxx : nedxml.i
84
	-del $(NEDXML_JAVADIR)\*.java >nul
85
	-mkdir $(NEDXML_JAVADIR) >nul
86
	$(SWIG) -c++ -java $(SWIGOPTS) -package $(NEDXML_JAVAPKG) -outdir $(NEDXML_JAVADIR) -o $@ $**
87

    
88
scave.cxx : scave.i idlist.i
89
	-del $(SCAVE_JAVADIR)\*.java >nul
90
	-mkdir $(SCAVE_JAVADIR) >nul
91
	$(SWIG) -c++ -java $(SWIGOPTS) -package $(SCAVE_JAVAPKG) -outdir $(SCAVE_JAVADIR) -o $@ scave.i
92

    
93
layout.cxx : layout.i
94
	-del $(LAYOUT_JAVADIR)\*.java >nul
95
	-mkdir $(LAYOUT_JAVADIR) >nul
96
	$(SWIG) -c++ -java $(SWIGOPTS) -package $(LAYOUT_JAVAPKG) -outdir $(LAYOUT_JAVADIR) -o $@ $**
97

    
98
eventlog.cxx : eventlog.i
99
	-del $(EVENTLOG_JAVADIR)\*.java >nul
100
	-mkdir $(EVENTLOG_JAVADIR) >nul
101
	$(SWIG) -c++ -java $(SWIGOPTS) -package $(EVENTLOG_JAVAPKG) -outdir $(EVENTLOG_JAVADIR) -o $@ $**
102

    
103
$O/$(DLL): $(OBJS) $(LIBS)
104
	$(LINK) /dll /out:$(O:/=\)\$(DLL) $(OBJS) $(LIBS) $(PTHREAD_LIBS) $(LDFLAGS)
105

    
106
$(DLL_TARGET_DIR)/$(DLL): $O/$(DLL)
107
!if "$(LIB_SUFFIX)"==".lib"
108
	copy $(O:/=\)\$(DLL) $(DLL_TARGET_DIR)
109
	- copy /b $(O:/=\)\$(DLL).manifest $(DLL_TARGET_DIR)
110
!endif
111

    
112
$(OBJS): $O
113

    
114
$O $L:
115
	md $(@:/=\)
116

    
117

    
118
missing-dependency:
119
	@echo '  *** Missing required dependency -- skipping build of UI support library.'
120
	@echo '  *** Install missing packages (probably SWIG and/or JDK), and edit configuser.vc.'
121

    
122
depend:
123
	$(MAKEDEPEND) $(INCLUDES) -fMakefile.vc -- *.cxx *.cc
124

    
125
clean:
126
	-del *.cxx  2>nul
127
	-rmdir /s /q $(O:/=\) 2>nul
128

    
129
# DO NOT DELETE THIS LINE -- make depend depends on it.
130