summaryrefslogtreecommitdiff
blob: f7fb44743968be22c030c62ef83c0841e7722931 (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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
 kmer/Make.rules   |  4 ++--
 kmer/configure.sh | 20 +++++++++----------
 src/c_make.as     | 58 +++++++++++++++++++++++++++----------------------------
 src/c_make.gen    |  4 ++--
 4 files changed, 43 insertions(+), 43 deletions(-)

diff --git a/kmer/Make.rules b/kmer/Make.rules
index f904b13..5c2d477 100644
--- a/kmer/Make.rules
+++ b/kmer/Make.rules
@@ -139,12 +139,12 @@ ${ALL_CXX_DEPS}:%.d:%
 ## EXE targets
 ALL_C_EXES   :=$(strip $(foreach x,${//},${${x:.=.C_EXES}}))
 ${ALL_C_EXES}:
-	${-CC} ${CLD} ${CLDFLAGS} -o $@ $+ ${CLIBS}
+	${-CC} ${CLD} ${CLDFLAGS} ${LDFLAGS} -o $@ $+ ${CLIBS}
 __SUBGOALS__+=$${${1:.=.C_EXES}}
 
 ALL_CXX_EXES :=$(strip $(foreach x,${//},${${x:.=.CXX_EXES}}))
 ${ALL_CXX_EXES}:
-	${-CXX} ${CXXLD} ${CXXLDFLAGS} -o $@ $+ ${CXXLIBS}
+	${-CXX} ${CXXLD} ${CXXLDFLAGS} ${LDFLAGS} -o $@ $+ ${CXXLIBS}
 __SUBGOALS__+=$${${1:.=.CXX_EXES}}
 
 define .RULE-install-copy-C-CXX-EXES
diff --git a/kmer/configure.sh b/kmer/configure.sh
index 2f0d5ea..9daf89f 100755
--- a/kmer/configure.sh
+++ b/kmer/configure.sh
@@ -254,13 +254,13 @@ EOF
 # -*- makefile -*-
 #  Linux, optimized
 CC                := $CC
-SHLIB_FLAGS       := -shared
-CFLAGS_COMPILE    := -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_REENTRANT -O3 -D_THREAD_SAFE -pthread -fmessage-length=0 -Wall -Wno-char-subscripts -funroll-loops -fexpensive-optimizations -finline-functions -fomit-frame-pointer
-CLDFLAGS          := -L/usr/local/lib
+SHLIB_FLAGS       := -shared ${LDFLAGS}
+CFLAGS_COMPILE    := -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_REENTRANT -D_THREAD_SAFE -pthread -fmessage-length=0 -Wall -Wno-char-subscripts
+CLDFLAGS          := 
 CLIBS             := -pthread -ldl
 CXX               := $CXX
-CXXFLAGS_COMPILE  := -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_REENTRANT -O3 -D_THREAD_SAFE -pthread -fmessage-length=0 -Wall -Wno-char-subscripts -funroll-loops -fexpensive-optimizations -finline-functions -fomit-frame-pointer
-CXXLDFLAGS        := -L/usr/local/lib
+CXXFLAGS_COMPILE  := -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_REENTRANT -O3 -D_THREAD_SAFE -pthread -fmessage-length=0 -Wall -Wno-char-subscripts
+CXXLDFLAGS        := 
 CXXLIBS           := -pthread -ldl
 ARFLAGS           := ruvs
 INSTALL/          := $target/
@@ -272,13 +272,13 @@ EOF
 # -*- makefile -*-
 #  Linux64, optimized
 CC                := $CC
-SHLIB_FLAGS       := -shared
-CFLAGS_COMPILE    := -m64 -fPIC -D_REENTRANT -O3 -D_THREAD_SAFE -pthread -fmessage-length=0 -Wall -Wno-char-subscripts -funroll-loops -fexpensive-optimizations -finline-functions -fomit-frame-pointer
-CLDFLAGS          := -L/usr/local/lib
+SHLIB_FLAGS       := -shared ${LDFLAGS}
+CFLAGS_COMPILE    := -fPIC -D_REENTRANT -D_THREAD_SAFE -pthread -fmessage-length=0 -Wall -Wno-char-subscripts
+CLDFLAGS          := 
 CLIBS             := -pthread -ldl
 CXX               := $CXX
-CXXFLAGS_COMPILE  := -m64 -fPIC -D_REENTRANT -O3 -D_THREAD_SAFE -pthread -fmessage-length=0 -Wall -Wno-char-subscripts -funroll-loops -fexpensive-optimizations -finline-functions -fomit-frame-pointer
-CXXLDFLAGS        := -L/usr/local/lib
+CXXFLAGS_COMPILE  := -fPIC -D_REENTRANT -D_THREAD_SAFE -pthread -fmessage-length=0 -Wall -Wno-char-subscripts
+CXXLDFLAGS        := 
 CXXLIBS           := -pthread -ldl
 ARFLAGS           := ruvs
 INSTALL/          := $target/
diff --git a/src/c_make.as b/src/c_make.as
index 0172807..4304589 100644
--- a/src/c_make.as
+++ b/src/c_make.as
@@ -64,27 +64,27 @@ include $(LOCAL_WORK)/src/c_make.gen
 
 ifeq ($(OSTYPE), Linux)
   ifeq ($(MACHINETYPE), i686)
-    ARCH_LDFLAGS  += -pthread -lm
-    ARCH_CFLAGS   += -pthread -Wall -Wimplicit -Wno-write-strings -Wno-unused -Wno-char-subscripts -Wno-sign-compare -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DX86_GCC_LINUX
+    LINK_LIBS  += -pthread -lm
+    ARCH_CFLAGS   += -pthread -Wall  -Wno-write-strings -Wno-unused -Wno-char-subscripts -Wno-sign-compare -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DX86_GCC_LINUX
     ARCH_LIB       = /usr/X11R6/lib
   endif
   ifeq ($(MACHINETYPE), amd64)
-    ARCH_LDFLAGS  += -pthread -lm
-    ARCH_CFLAGS   += -pthread -Wall -Wimplicit -Wno-write-strings -Wno-unused -Wno-char-subscripts -Wno-sign-compare -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DX86_GCC_LINUX
+    LINK_LIBS  += -pthread -lm
+    ARCH_CFLAGS   += -pthread -Wall  -Wno-write-strings -Wno-unused -Wno-char-subscripts -Wno-sign-compare -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DX86_GCC_LINUX
     ARCH_LIB       = /usr/lib64 /usr/X11R6/lib64
   endif
   ifeq ($(MACHINETYPE), ia64)
-    ARCH_LDFLAGS  += -pthread -lm
-    ARCH_CFLAGS   += -pthread -Wall -Wimplicit -Wno-write-strings -Wno-unused -Wno-char-subscripts -Wno-sign-compare -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
+    LINK_LIBS  += -pthread -lm
+    ARCH_CFLAGS   += -pthread -Wall  -Wno-write-strings -Wno-unused -Wno-char-subscripts -Wno-sign-compare -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
     ARCH_LIB       = /usr/X11R6/lib
   endif
 
   ifeq ($(BUILDDEBUG), 1)
-    ARCH_CFLAGS  += -g 
-    ARCH_LDFLAGS +=
+    ARCH_CFLAGS  +=  
+    LINK_LIBS +=
   else
-    ARCH_CFLAGS  += -O2
-    ARCH_LDFLAGS += -Wl,-O1
+    ARCH_CFLAGS  += 
+    LINK_LIBS += 
   endif
 endif
 
@@ -94,19 +94,19 @@ endif
 
 ifeq ($(OSTYPE), FreeBSD)
   ifeq ($(MACHINETYPE), i386)
-    ARCH_LDFLAGS    += -pthread -lthr -lm
-    ARCH_CFLAGS      = -pthread -Wall -Wimplicit -Wno-write-strings -Wno-unused -Wno-char-subscripts -Wno-sign-compare
-    ARCH_CFLAGS      = -pthread       -Wimplicit -Wno-write-strings -Wno-unused -Wno-char-subscripts -Wno-sign-compare
+    LINK_LIBS    += -pthread -lthr -lm
+    ARCH_CFLAGS      = -pthread -Wall  -Wno-write-strings -Wno-unused -Wno-char-subscripts -Wno-sign-compare
+    ARCH_CFLAGS      = -pthread        -Wno-write-strings -Wno-unused -Wno-char-subscripts -Wno-sign-compare
   endif
   ifeq ($(MACHINETYPE), amd64)
-    ARCH_LDFLAGS    += -pthread -lthr -lm
-    ARCH_CFLAGS      =  -pthread               -Wimplicit -Wno-write-strings -Wno-unused -Wno-char-subscripts -Wno-sign-compare -Wformat
-    ARCH_CFLAGS      =  -pthread -Wall -Wextra -Wimplicit -Wno-write-strings -Wno-unused -Wno-char-subscripts -Wno-sign-compare -Wformat
+    LINK_LIBS    += -pthread -lthr -lm
+    ARCH_CFLAGS      =  -pthread                -Wno-write-strings -Wno-unused -Wno-char-subscripts -Wno-sign-compare -Wformat
+    ARCH_CFLAGS      =  -pthread -Wall -Wextra  -Wno-write-strings -Wno-unused -Wno-char-subscripts -Wno-sign-compare -Wformat
   endif
 
   ifeq ($(BUILDCOVERAGE), 1)
     ARCH_CFLAGS   += -g -fprofile-arcs -ftest-coverage
-    ARCH_LDFLAGS  += -lgcov
+    LINK_LIBS  += -lgcov
   else
     ifeq ($(BUILDDEBUG), 1)
       ARCH_CFLAGS   += -g
@@ -140,14 +140,14 @@ ifeq ($(OSTYPE), Darwin)
 
   ifeq ($(MACHINETYPE), i386)
     ifeq ($(BUILDDEBUG), 1)
-      ARCH_CFLAGS   += -fPIC -m64 -fmessage-length=0 -D_THREAD_SAFE -Wall -Wimplicit -Wno-write-strings -Wno-unused -Wno-char-subscripts -Wno-sign-compare -g
-      ARCH_LDFLAGS  += -m64 -lm
+      ARCH_CFLAGS   += -fPIC -m64 -fmessage-length=0 -D_THREAD_SAFE -Wall  -Wno-write-strings -Wno-unused -Wno-char-subscripts -Wno-sign-compare -g
+      LINK_LIBS  += -m64 -lm
     else
 #  Wow, -Wshorten-64-to-32  is tough
-      ARCH_CFLAGS   += -fPIC -m64 -fmessage-length=0 -D_THREAD_SAFE       -Wimplicit -Wno-write-strings -Wno-unused -Wno-char-subscripts -Wno-sign-compare -fast
+      ARCH_CFLAGS   += -fPIC -m64 -fmessage-length=0 -D_THREAD_SAFE        -Wno-write-strings -Wno-unused -Wno-char-subscripts -Wno-sign-compare -fast
 #     ARCH_CFLAGS   += -Wextra
 #     ARCH_CFLAGS   += -pedantic  (see above about pedantic)
-      ARCH_LDFLAGS  += -m64 -lm
+      LINK_LIBS  += -m64 -lm
     endif
   endif
 
@@ -161,23 +161,23 @@ endif
 ifeq ($(OSTYPE), SunOS)
   ifeq ($(MACHINETYPE), i86pc)
     ARCH_CFLAGS    = -DBYTE_ORDER=LITTLE_ENDIAN -DANSI_C -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -pthreads
-    ARCH_LDFLAGS  += -lm
+    LINK_LIBS  += -lm
   endif
 
   ifeq ($(MACHINETYPE), sparc32)
     ARCH_CFLAGS    = -DANSI_C -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -pthreads
-    ARCH_LDFLAGS  += -lm -lnsl -lsocket
+    LINK_LIBS  += -lm -lnsl -lsocket
   endif
 
   ifeq ($(MACHINETYPE), sparc64)
     ARCH_CFLAGS    = -m64 -DANSI_C -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -pthreads
-    ARCH_LDFLAGS  += -m64 -lm -lnsl -lsocket
+    LINK_LIBS  += -lm -lnsl -lsocket
   endif
 
   ifeq ($(BUILDDEBUG), 1)
-    ARCH_CFLAGS   += -g
+    ARCH_CFLAGS   +=
   else
-    ARCH_CFLAGS   += -O
+    ARCH_CFLAGS   +=
   endif
 endif
 
@@ -186,14 +186,14 @@ endif
 
 ifeq ($(BUILDPROFILE), 1)
   ARCH_CFLAGS  += -pg
-  ARCH_LDFLAGS += -pg
+  LINK_LIBS += -pg
 endif
 
 # One can argue that CXXFLAGS should be separate.  For now, we only
 # add to the flags.
 
 CFLAGS          += $(ARCH_CFLAGS)
-CXXFLAGS        += $(ARCH_CFLAGS) $(ARCH_CXXFLAGS)
+CXXFLAGS        += $(ARCH_CXXFLAGS)
 LDFLAGS         += $(ARCH_LDFLAGS)
 
 INC_IMPORT_DIRS += $(LOCAL_WORK)/src $(patsubst %, $(LOCAL_WORK)/src/%, $(strip $(SUBDIRS)))
@@ -205,7 +205,7 @@ LIB_IMPORT_DIRS += $(ARCH_LIB)
 OBJ_SEARCH_PATH  = $(LOCAL_OBJ)
 
 ifeq ($(SITE_NAME), JCVI)
-  LDFLAGS += -lcurl
+  LINK_LIBS += -lcurl
 endif
 
 #  The order of compilation here is very carefully chosen to be the
diff --git a/src/c_make.gen b/src/c_make.gen
index 7b5227c..c27b777 100644
--- a/src/c_make.gen
+++ b/src/c_make.gen
@@ -396,12 +396,12 @@ $(LIBRARIES):
 $(C_PROGS):
 	@ echo "++++++++++++++++++++ " $@ "++++++++++++++++++++++";
 	cd $(LOCAL_OBJ); \
-	  $(CC) -o $(LOCAL_BIN)/$(notdir $@) $(filter-out lib%.a, $+) $(patsubst lib%.a, -l%, $(filter lib%.a, $+)) $(LD_DIRS) $(LDFLAGS)
+	  $(CC) $(LDFLAGS) -o $(LOCAL_BIN)/$(notdir $@) $(filter-out lib%.a, $+) $(patsubst lib%.a, -l%, $(filter lib%.a, $+)) $(LD_DIRS) $(LINK_LIBS)
 
 $(CXX_PROGS):
 	@ echo "++++++++++++++++++++ " $@ "++++++++++++++++++++++";
 	cd $(LOCAL_OBJ); \
-          $(CXX) -o $(LOCAL_BIN)/$(notdir $@) $(filter-out lib%.a, $+) $(patsubst lib%.a, -l%, $(filter lib%.a, $+)) $(LD_DIRS) $(LDFLAGS)
+          $(CXX) $(LDFLAGS) -o $(LOCAL_BIN)/$(notdir $@) $(filter-out lib%.a, $+) $(patsubst lib%.a, -l%, $(filter lib%.a, $+)) $(LD_DIRS) $(LINK_LIBS)
 
 $(SCRIPT_PROGS): %.sh:
 	@echo "++++++++++++++++++++ " $@ "++++++++++++++++++++++";