summaryrefslogtreecommitdiff
path: root/math/tetgen/files/patch-makefile
blob: 0c256f486758673caae752a17fb46c3a3a232056 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
--- 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 *~