summaryrefslogtreecommitdiff
blob: 51ab913b48cf426f30c5d89e08a7431350909ba2 (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
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
 src/Makefile | 59 ++++++++++++++++++++++++++++++-----------------------------
 1 file changed, 30 insertions(+), 29 deletions(-)

diff --git a/src/Makefile b/src/Makefile
index 607ab45..b23ec23 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -52,15 +52,16 @@ TESTOPTS=
 WINMAKE=mingw32-make
 
 LDLIBS     = -lm
-AR         = ar
-CC         = gcc
-CPP        = g++
-O_OPTS     = -O2
-CC_OPTS    = -g -Wall -D__USE_FIXED_PROTOTYPES__
-P_DEFINES  =
+AR         ?= ar
+CC         ?= gcc
+CXX        ?= g++
+O_OPTS     ?= 
+CC_OPTS    ?= -Wall -D__USE_FIXED_PROTOTYPES__
+P_DEFINES  ?=
 
-CFLAGS  = $(CC_OPTS) $(O_OPTS)
-LDFLAGS = -g
+CFLAGS    += $(CC_OPTS) $(O_OPTS)
+CXXFLAGS  += $(CC_OPTS) $(O_OPTS)
+LDFLAGS   +=
 # Note, for profiling, use
 # make O_OPTS='-pg -O0' LDFLAGS='-g -pg'
 
@@ -127,85 +128,85 @@ $(LIBOLIGOTM): oligotm.o
 	$(RANLIB) $@
 
 $(LIBOLIGOTM_LIB): oligotm.o
-	$(CC) -shared -W1,-soname,liboligotm.so.1 -o $(LIBOLIGOTM_DYN) oligotm.o
+	$(CC) $(LDFLAGS) -shared -W1,-soname,liboligotm.so.1 -o $(LIBOLIGOTM_DYN) oligotm.o
 
 $(LIBDPAL): dpal_primer.o
 	$(AR) rv $@ dpal_primer.o
 	$(RANLIB) $@
 
 $(LIBDPAL_DYN): dpal_primer.o
-	$(CC) -shared -W1,-soname,libdpal.so.1 -o $(LIBDPAL_DYN_LIB) dpal_primer.o
+	$(CC) $(LDFLAGS) -shared -W1,-soname,libdpal.so.1 -o $(LIBDPAL_DYN_LIB) dpal_primer.o
 
 $(LIBTHAL): thal_primer.o
 	$(AR) rv $@ thal_primer.o
 	$(RANLIB) $@
 
 $(LIBTHAL_DYN): thal_primer.o
-	$(CC) -shared -W1,-soname,libthal.so.1 -o $(LIBTHAL_DYN_LIB) thal_primer.o
+	$(CC) $(LDFLAGS) -shared -W1,-soname,libthal.so.1 -o $(LIBTHAL_DYN_LIB) thal_primer.o
 
 $(LIBPRIMER3): libprimer3.o p3_seq_lib.o
 	$(AR) rv $@ libprimer3.o p3_seq_lib.o
 	$(RANLIB) $@
 
 $(LIBPRIMER3_DYN): libprimer3.o p3_seq_lib.o
-	$(CC) -shared -W1,-soname,liprimer3.so.1 -o $(LIBPRIMER3_DYN) libprimer3.o p3_seq_lib.o
+	$(CC) $(LDFLAGS) -shared -W1,-soname,liprimer3.so.1 -o $(LIBPRIMER3_DYN) libprimer3.o p3_seq_lib.o
 
 $(PRIMER_EXE): $(PRIMER_OBJECTS)
-	$(CPP) $(LDFLAGS) -o $@ $(PRIMER_OBJECTS) $(LIBOPTS) $(LDLIBS)
+	$(CXX) $(LDFLAGS) -o $@ $(PRIMER_OBJECTS) $(LIBOPTS) $(LDLIBS)
 
 libprimer3.o: libprimer3.c libprimer3.h p3_seq_lib.h dpal.h thal.h oligotm.h
-	$(CPP) -c $(CFLAGS) -Wno-deprecated $(P_DEFINES) -o $@ libprimer3.c
+	$(CXX) -c $(CXXFLAGS) -Wno-deprecated $(P_DEFINES) -o $@ libprimer3.c
 
 $(NTDPAL_EXE): ntdpal_main.o dpal.o
-	$(CPP) $(LDFLAGS) -o $@ ntdpal_main.o dpal.o
+	$(CXX) $(LDFLAGS) -o $@ ntdpal_main.o dpal.o
 
 $(NTTHAL_EXE): thal_main.o thal.o
-	$(CPP) $(LDFLAGS) -o $@ thal_main.o thal.o $(LDLIBS)
+	$(CXX) $(LDFLAGS) -o $@ thal_main.o thal.o $(LDLIBS)
 
 $(OLIGOTM_EXE): oligotm_main.c oligotm.h $(LIBOLIGOTM)
-	$(CPP) $(CFLAGS) -o $@ oligotm_main.c $(LIBOLIGOTM) $(LIBOPTS) $(LDLIBS)
+	$(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ oligotm_main.c $(LIBOLIGOTM) $(LIBOPTS) $(LDLIBS)
 
 $(LONG_SEQ_EXE): long_seq_tm_test_main.c oligotm.o
-	$(CPP) $(CFLAGS) -o $@ long_seq_tm_test_main.c oligotm.o $(LIBOPTS) $(LDLIBS)
+	$(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ long_seq_tm_test_main.c oligotm.o $(LIBOPTS) $(LDLIBS)
 
 read_boulder.o: read_boulder.c read_boulder.h libprimer3.h dpal.h thal.h p3_seq_lib.h 
-	$(CPP) -c $(CFLAGS) $(P_DEFINES) -o $@ read_boulder.c
+	$(CXX) -c $(CXXFLAGS) $(P_DEFINES) -o $@ read_boulder.c
 
 print_boulder.o: print_boulder.c print_boulder.h libprimer3.h p3_seq_lib.h 
-	$(CPP) -c $(CFLAGS) $(P_DEFINES) -o $@ print_boulder.c
+	$(CXX) -c $(CXXFLAGS) $(P_DEFINES) -o $@ print_boulder.c
 
 dpal.o: dpal.c dpal.h
-	$(CPP) -c $(CFLAGS) -o $@ dpal.c
+	$(CXX) -c $(CXXFLAGS) -o $@ dpal.c
 
 # We use '-ffloat-store' on windows to prevent undesirable
 # precision which may lead to differences in floating point results.
 thal.o: thal.c thal.h
-	$(CPP) -c $(CFLAGS) -ffloat-store -o $@ thal.c
+	$(CXX) -c $(CXXFLAGS) -ffloat-store -o $@ thal.c
 
 p3_seq_lib.o: p3_seq_lib.c p3_seq_lib.h libprimer3.h
-	$(CPP) -c $(CFLAGS) -o $@ p3_seq_lib.c
+	$(CXX) -c $(CXXFLAGS) -o $@ p3_seq_lib.c
 
 dpal_primer.o: dpal.c dpal.h
-	$(CPP) -c $(CFLAGS) $(P_DEFINES) -o $@ dpal.c
+	$(CXX) -c $(CXXFLAGS) $(P_DEFINES) -o $@ dpal.c
 
 thal_primer.o: thal.c thal.h
-	$(CPP) -c $(CFLAGS) -ffloat-store $(P_DEFINES) -o $@ thal.c
+	$(CXX) -c $(CXXFLAGS) -ffloat-store $(P_DEFINES) -o $@ thal.c
 
 format_output.o: format_output.c format_output.h libprimer3.h dpal.h thal.h p3_seq_lib.h 
-	$(CPP) -c $(CFLAGS) $(P_DEFINES) -o $@ format_output.c
+	$(CXX) -c $(CXXFLAGS) $(P_DEFINES) -o $@ format_output.c
 
 ntdpal_main.o: ntdpal_main.c dpal.h
-	$(CPP) -c $(CC_OPTS) -o $@ ntdpal_main.c
+	$(CXX) -c $(CXXFLAGS) -o $@ ntdpal_main.c
 
 thal_main.o: thal_main.c thal.h
-	$(CPP) -c $(CFLAGS) -o $@ thal_main.c
+	$(CXX) -c $(CXXFLAGS) -o $@ thal_main.c
 # We use CC_OPTS above rather than CFLAGS because
 # gcc 2.7.2 crashes while compiling ntdpal_main.c with -O2
 
 oligotm.o: oligotm.c oligotm.h
 
 primer3_boulder_main.o: primer3_boulder_main.c libprimer3.h dpal.h thal.h oligotm.h format_output.h print_boulder.h read_boulder.h
-	$(CPP) -c $(CFLAGS) $(P_DEFINES) primer3_boulder_main.c
+	$(CXX) -c $(CXXFLAGS) $(P_DEFINES) primer3_boulder_main.c
 
 primer_test: test