| 1 |
# and compiling extra libraries |
| 2 |
# ----------------------------------------- |
| 3 |
|
| 4 |
include cxxflags |
| 5 |
all-local: tetgen |
| 6 |
|
| 7 |
# Downloading and compiling Tetgen |
| 8 |
# ------------------------------ |
| 9 |
|
| 10 |
# Tetgen information |
| 11 |
DIRPKG=../pkg |
| 12 |
tetgen_VERSION=1.5.1-beta1 |
| 13 |
SRCDIR=tetgen$(tetgen_VERSION) |
| 14 |
PACKAGE=$(DIRPKG)/tetgen$(tetgen_VERSION).tar.gz |
| 15 |
|
| 16 |
# FFCS - 6/11/12 - curl is not able to follow redirections from http://tetgen.org/files |
| 17 |
#SERVER=http://wias-berlin.de/software/tetgen/files |
| 18 |
|
| 19 |
INSTALL=../.. |
| 20 |
|
| 21 |
tetgen: FAIRE |
| 22 |
|
| 23 |
|
| 24 |
FAIRE:install.done WHERE.done |
| 25 |
touch FAIRE |
| 26 |
|
| 27 |
|
| 28 |
# ALH - FFCS - 18/12/8 - need '-fPIC' on Linux64 because the .a will be used in a .so (by examples++-load/tetgen.cpp). |
| 29 |
|
| 30 |
# FFCS - 30/11/10 - need ranlib on Win64. The PATH is setup so that mingw/ranlib is called |
| 31 |
|
| 32 |
fait-tags.done:tar-tags.done cxxflags |
| 33 |
cd $(SRCDIR);$(CXX) $(CXXFLAGS) -O3 -fPIC -DSELF_CHECK -DNDEBUG -DTETLIBRARY -c tetgen.cxx |
| 34 |
cd $(SRCDIR);$(CXX) $(CXXFLAGS) -O0 -fPIC -DSELF_CHECK -DNDEBUG -DTETLIBRARY -c predicates.cxx |
| 35 |
touch fait-tags.done |
| 36 |
WHERE:WHERE.done |
| 37 |
WHERE.done: fait-tags.done |
| 38 |
echo tetgen LD -L@DIR@/lib -ltet >$(SRCDIR)/$(INSTALL)/lib/WHERE.tetgen |
| 39 |
echo tetgen INCLUDE -I@DIR@/include >> $(SRCDIR)/$(INSTALL)/lib/WHERE.tetgen |
| 40 |
touch $@ |
| 41 |
clean-local:: |
| 42 |
-rm WHERE.done |
| 43 |
|
| 44 |
# FFCS - avoid remaking install every time |
| 45 |
install.done:fait-tags.done |
| 46 |
cd $(SRCDIR);$(AR) $(ARFLAGS) $(INSTALL)/lib/libtet.a tetgen.o predicates.o |
| 47 |
ranlib $(SRCDIR)/$(INSTALL)/lib/libtet.a |
| 48 |
cp $(SRCDIR)/tetgen.h $(SRCDIR)/$(INSTALL)/include |
| 49 |
touch $@ |
| 50 |
clean-local:: |
| 51 |
-rm install.done |
| 52 |
|
| 53 |
|
| 54 |
tar-tags.done: $(PACKAGE) |
| 55 |
gunzip -c $(PACKAGE)|tar zxf - |
| 56 |
# FFCS: needs to patch tetgen because mingw64 has 4-byte longs |
| 57 |
touch tar-tags.done |
| 58 |
# cd tetgen1.4.2;patch -p1 <../tetgen1.4.2.patch |
| 59 |
|
| 60 |
$(PACKAGE): |
| 61 |
../getall -o TetGen -a |
| 62 |
|
| 63 |
clean-local:: |
| 64 |
-rm -rf tetgen1.?.* *.done |
| 65 |
clean: |
| 66 |
-rm $(SRCDIR) |
| 67 |
-rm *.done |
| 68 |
-rm -rf tetgen1.?.* cxxflags |
| 69 |
cxxflags: ../Makefile Makefile ../getall |
| 70 |
../getall -o TetGen -a |
| 71 |
-mv -f cxxflags cxxflags.old |
| 72 |
grep 'CXX *=' ../Makefile >cxxflags |
| 73 |
grep 'CC *=' ../Makefile >>cxxflags |
| 74 |
# FFCS - 10/5/12 - bug under Windows if -O3 is specified tetgen never returns. It could also be the case under |
| 75 |
# Ubuntu. All optimisation options are removed for safety. |
| 76 |
grep 'CXXFLAGS *=' ../Makefile | sed 's/ -O[0-9]* / /g' >>cxxflags |
| 77 |
grep 'WGET *=' ../Makefile >>cxxflags |
| 78 |
grep 'AR *=' ../Makefile >>cxxflags |
| 79 |
grep 'ARFLAGS *=' ../Makefile >>cxxflags |
| 80 |
../../bin/ff-md5 $(PACKAGE) >> cxxflags |
| 81 |
if diff -q cxxflags cxxflags.old ; then echo No Modif skip compile of tetgen ; mv -f cxxflags.old cxxflags; else touch -c tar-tags.done; fi |
| 82 |
|
| 83 |
.PHONY:$(SRCDIR)/$(INSTALL) |