ports/math/tetgen/files/patch-makefile
Hiroki Sato e23bb909e7 - Update to 1.5.1.
- Add -fPIC.
2019-12-29 15:26:37 +00:00

68 lines
1.8 KiB
Text

--- makefile.orig 2013-11-06 20:26:24 UTC
+++ makefile
@@ -11,7 +11,7 @@
# CXX should be set to the name of your favorite C++ compiler.
# ===========================================================
-CXX = g++
+#CXX = g++
#CXX = icpc
#CXX = CC
@@ -19,11 +19,12 @@ CXX = g++
# -O2, -O3 ... to find the best optimization level.
# ===================================================================
-CXXFLAGS = -O3
+CXXFLAGS ?= -O3
+ARFLAGS ?= -crD
# PREDCXXFLAGS is for compiling J. Shewchuk's predicates.
-PREDCXXFLAGS = -O0
+PREDCXXFLAGS? = -O0
# SWITCHES is a list of switches to compile TetGen.
# =================================================
@@ -36,7 +37,7 @@ PREDCXXFLAGS = -O0
# down the speed of TetGen. They can be skipped by define the -DNDEBUG
# switch.
-SWITCHES =
+SWITCHES = -DNDEBUG
# RM should be set to the name of your favorite rm (file deletion program).
@@ -44,19 +45,20 @@ RM = /bin/rm
# The action starts here.
-tetgen: tetgen.cxx predicates.o
- $(CXX) $(CXXFLAGS) $(SWITCHES) -o tetgen tetgen.cxx predicates.o -lm
-
-tetlib: tetgen.cxx predicates.o
- $(CXX) $(CXXFLAGS) $(SWITCHES) -DTETLIBRARY -c tetgen.cxx
- ar r libtet.a tetgen.o predicates.o
-
+LIBS= -lm
+tetgen: tetgen.o predicates.o
+ $(CXX) $(CXXFLAGS) $(LDFLAGS) -o ${.TARGET} ${.ALLSRC} ${LIBS}
+tetgen.o: tetgen.cxx
+ $(CXX) $(CXXFLAGS) $(SWITCHES) -c -o ${.TARGET} ${.ALLSRC}
predicates.o: predicates.cxx
- $(CXX) $(PREDCXXFLAGS) -c predicates.cxx
+ $(CXX) $(CXXFLAGS) $(PREDCXXFLAGS) $(SWITCHES) -c -o ${.TARGET} ${.ALLSRC}
-clean:
- $(RM) *.o *.a tetgen *~
+tetgen_lib.o: tetgen.cxx
+ $(CXX) $(CXXFLAGS) $(SWITCHES) -DTETLIBRARY -c -o ${.TARGET} ${.ALLSRC}
+libtet.a: tetgen_lib.o predicates.o
+ $(AR) $(ARFLAGS) ${.TARGET} ${.ALLSRC}
+tetlib: libtet.a
-
-
+clean:
+ $(RM) -f *.o *.a tetgen *~