Permalink
Browse files

Generate the shared library containing python wrapper and libsimulator

  • Loading branch information...
j3k0 committed Dec 5, 2011
1 parent 6c3ef70 commit 6d8517e2913f263e7471c38d0abaa167adfc771a
Showing with 29 additions and 4 deletions.
  1. +12 −0 sim/compile.sh
  2. +14 −3 sim/libsimulator/compile.sh
  3. +3 −1 sim/swigtorcs/compile.sh
View
@@ -0,0 +1,12 @@
+mkdir -p build
+rm -f build/*.o
+
+DIRS="libsimulator swigtorcs"
+for i in $DIRS
+do
+ cd $i
+ ./compile.sh
+ cd ..
+done
+
+g++ -arch i386 -shared -ldl -lpython2.6 build/*.o -o libsimulator.so
@@ -1,8 +1,19 @@
-SOURCES="libsimulator.cpp plib/sg.cpp simuv2/aero.cpp simuv2/axle.cpp simuv2/brake.cpp simuv2/car.cpp simuv2/categories.cpp simuv2/collide.cpp simuv2/differential.cpp simuv2/engine.cpp simuv2/simu.cpp simuv2/simuitf.cpp simuv2/steer.cpp simuv2/susp.cpp simuv2/transmission.cpp simuv2/wheel.cpp tgf/directory.cpp tgf/hash.cpp tgf/module.cpp tgf/os.cpp tgf/params.cpp tgf/profiler.cpp tgf/tgf.cpp tgf/trace.cpp txml/xml.cpp"
+CPP_SOURCES="libsimulator.cpp plib/sg.cpp simuv2/aero.cpp simuv2/axle.cpp simuv2/brake.cpp simuv2/car.cpp simuv2/categories.cpp simuv2/collide.cpp simuv2/differential.cpp simuv2/engine.cpp simuv2/simu.cpp simuv2/simuitf.cpp simuv2/steer.cpp simuv2/susp.cpp simuv2/transmission.cpp simuv2/wheel.cpp tgf/directory.cpp tgf/hash.cpp tgf/module.cpp tgf/os.cpp tgf/params.cpp tgf/profiler.cpp tgf/tgf.cpp tgf/trace.cpp txml/xml.cpp"
+
+C_SOURCES="txml/gennmtab.c txml/hashtable.c txml/xmlparse.c txml/xmlrole.c txml/xmltok.c"
SRCDIR=`pwd`
cd ../build
-for i in $SOURCES
+
+for i in $C_SOURCES
+do
+ echo "C $i"
+ gcc -arch i386 -fpic -I../libsimulator/interfaces -I../libsimulator -I.. -c $SRCDIR/$i 2> /dev/null
+done
+
+for i in $CPP_SOURCES
do
- g++ -arch i386 -I../libsimulator/interfaces -I../libsimulator -I.. -c $SRCDIR/$i
+ echo "C $i"
+ g++ -arch i386 -fpic -I../libsimulator/interfaces -I../libsimulator -I.. -c $SRCDIR/$i 2> /dev/null
done
+
View
@@ -4,7 +4,9 @@ SWIG_SOURCES="swigtorcs.i swigcar.i swiggfparm.i swiggraphic.i swigmath.i swigra
PYTHON_FLAGS="-I/System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -I/System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386"
#python-config --cflags
+echo S swigtorcs.i
swig -Wall -python -c++ -I../libsimulator/interfaces -I../libsimulator -I.. -outdir . swigtorcs.i
SRCDIR=`pwd`
cd ../build
-g++ $PYTHON_FLAGS -I../libsimulator/interfaces -I../libsimulator -I.. -c $SRCDIR/swigtorcs_wrap.cxx
+echo C swigtorcs_wrap.cxx
+g++ $PYTHON_FLAGS -fpic -I../libsimulator/interfaces -I../libsimulator -I.. -c $SRCDIR/swigtorcs_wrap.cxx 2> /dev/null

0 comments on commit 6d8517e

Please sign in to comment.