summaryrefslogtreecommitdiff
path: root/cad/tochnog/files/patch-makefile
blob: c6d77afd049f83980d21891aa48afcb7e9a0fce5 (plain) (blame)
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
--- makefile.orig	Sun Aug 19 12:31:52 2001
+++ makefile	Wed Jun 18 12:57:01 2003
@@ -1,6 +1,7 @@
 #  ***********  fortran 2 c *******************
 # Set F2C (for unix -lf2c and for MS windows to f2c.lib)
-F2C=
+F2C= -lf2c -L%%LOCALBASE%%/lib
+F2C_INCLUDE= -I%%LOCALBASE%%/include
 
 #  ***********  hypoplasticity ****************
 # For hypoplasticity:
@@ -8,8 +9,8 @@
 #    set HYPO_USE to 1 in tnhypo.h
 #    set HYPO_SRC to hypo.c below
 #    set HYPO_OBJ to hypo.o below
-HYPO_SRC=hypo_dum.c
-HYPO_OBJ=hypo_dum.o
+HYPO_SRC=hypo.c
+HYPO_OBJ=hypo.o
 
 #  ***********  profiler ***********************
 # for the gnu profiler, use as follows:
@@ -26,11 +27,11 @@
 SYS_FILE=sysother
 BCPP=-P
 VCPP=
-COMPILER_C=bcc32
-COMPILER_CPP=bcc32
-COMPILER_FLAGS= -c -O2 -w-
+COMPILER_C=$(CC)
+COMPILER_CPP=$(CXX)
+COMPILER_FLAGS=$(CXXFLAGS) -c
 OBJ=obj
-LINK_FLAGS_BEFORE= -l$(F2C)
+LINK_FLAGS_BEFORE= -l$(F2C) -L%%LOCALBASE%%/lib
 LINK_FLAGS_AFTER=
 
 #  ***********  SUPERLU library *******************
@@ -39,9 +40,9 @@
 #      Set SUPERLU_MT_USE to 1 in tnsuplu.h for the multi threaded version
 #      Set SUPERLU_DIST_USE to 1 in tnsuplu.h for the distributed MPI version
 #   2. Activate and adjust the next three lines
-# SUPERLU=/home/programs/src/SuperLU
-# SUPERLU_LIB=$(SUPERLU)/superlu.a $(SUPERLU)/blas.a
-# SUPERLU_INCLUDE=-I$(SUPERLU)/SRC
+SUPERLU=%%LOCALBASE%%
+SUPERLU_LIB=$(SUPERLU)/lib/lib%%SUPERLU%%.a %%BLAS_LIBS%%
+SUPERLU_INCLUDE=-I$(SUPERLU)/include/%%SUPERLU%%
 #   3. For SuperLU_MT be sure to compile a multi threaded version
 #      of Tochnog (sparc_parallel, alpha_parallel, linux, etc.)
 
@@ -65,7 +66,7 @@
 ALL_LIB= $(PETSC_LIB) $(SUPERLU_LIB) $(F2C)
 
 #  ***********  default platform  *******************
-default: linux_old
+default: freebsd_old
 
 # single and multi-processor windows; borland c++ compiler
 # set SYS_FILE above to syswin32 for multi-processor
@@ -101,18 +102,23 @@
 	"LINK_FLAGS_AFTER= /link $(F2C) $(PROFILE) /OUT:tochnog.exe"
 
 # single processor linux; gnu gcc compiler
-linux_old: 
+freebsd_old: 
 	make tochnog \
 	"SYS_FILE=sysother" \
 	"OBJ=o" \
-	"BCPP=" \
-	"VCPP=" \
-	"COMPILER_C=gcc" \
-	"COMPILER_CPP=g++" \
-	"COMPILER_FLAGS= -ansi -c -O2 -Wall $(PROFILE) $(ALL_INCLUDE)" \
+	"COMPILER_FLAGS= -c ${CXXFLAGS} $(ALL_INCLUDE)" \
 	"LINK_FLAGS_BEFORE=" \
 	"LINK_FLAGS_AFTER= $(PROFILE) $(ALL_LIB) -static -lm -o tochnog"
 
+# Multithreaded FreeBSD
+freebsd_parallel:
+	make tochnog \
+	"SYS_FILE=sysposix" \
+	"OBJ=o" \
+	"COMPILER_FLAGS= -c ${CXXFLAGS} %%PTHREAD_CFLAGS%% -D_REENTRANT $(ALL_INCLUDE)" \
+	"LINK_FLAGS_BEFORE=" \
+	"LINK_FLAGS_AFTER=  $(ALL_LIB) %%PTHREAD_LIBS%% -static -lm -o tochnog"
+
 # multi processor linux; gnu gcc compiler
 linux: 
 	make tochnog \
@@ -375,7 +381,7 @@
 	$(COMPILER_CPP) $(COMPILER_FLAGS) $(BCPP) $(VCPP)hyperela.$(SRC_CPP)
 
 $(HYPO_OBJ): $(HYPO_SRC)
-	$(COMPILER_C) $(COMPILER_FLAGS) $(HYPO_SRC)
+	$(COMPILER_C) $(COMPILER_FLAGS) $(HYPO_SRC) $(F2C_INCLUDE)
 
 hypoplas.$(OBJ): hypoplas.$(SRC_CPP) tochnog.h
 	$(COMPILER_CPP) $(COMPILER_FLAGS) $(BCPP) $(VCPP)hypoplas.$(SRC_CPP)