1 # Makefile to build occjava for Windows on Linux.
2 # Only tested on Debian Squeeze.
4 # - Install mingw packages:
5 # apt-get install mingw32 mingw32-binutils mingw32-runtime
6 # - Edit set CASROOT and JAVA variables bellow.
7 # - Run make -f Makefile.mingw
10 CASROOT?=/home/robert/occ6.3/opencascade/ros/
11 JAVA?=/home/robert/.wine/drive_c/Java/jdk1.6.0_21
13 LIBS := -L$(CASROOT)/mingw/lib -lTKBRep -lTKBool -lTKG2d -lTKG3d -lTKGeomBase -lTKIGES -lTKMath -lTKOffset -lTKXSBase -lTKernel -lTKSTEP -lTKPrim -lTKTopAlgo -lTKFillet -lTKMesh -lTKBO -lTKGeomAlgo -lTKShHealing -lTKSTEPBase
14 CXX := i586-mingw32msvc-g++
15 CC := i586-mingw32msvc-gcc
17 #strict-aliasing optimization break all Upcast swig function. The return upcasted pointer is always NULL. So we disable this optimization.
18 CXXFLAGS := -O2 -g -march=pentium3 -fno-strict-aliasing
19 LDFLAGS := -shared -Wl,--enable-auto-import -Wl,--enable-runtime-pseudo-reloc -Wl,-export-all-symbols -Wl,--add-stdcall-alias
20 CPPFLAGS := -I$(JAVA)/include -I$(JAVA)/include/win32 -I$(CASROOT)/inc -DWNT -D__MATH_WNT_H -DHAVE_NO_DLL
21 JAVAGENSRCDIR := src-java/org/jcae/opencascade/jni/
23 Release/OccJava.dll : src/OccJava_wrap.o src/jnistream.o
25 $(CXX) $(LDFLAGS) -o $@ $^ $(LIBS)
27 src/jnistream.o : src/jnistream.cxx
28 $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) -o $@ $^
30 src/OccJava_wrap.o : src/OccJava_wrap.cxx
31 $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) -o $@ $^
33 src/OccJava_wrap.cxx : $(wildcard src/*.i)
34 swig -c++ -v $(CPPFLAGS) -Wall -java -package org.jcae.opencascade.jni -outdir $(JAVAGENSRCDIR) -o $@ -Isrc src/OccJava.i