summaryrefslogtreecommitdiff
blob: ac75160341473007d1f05ba2db8e439ea5134e4d (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
 src/Makefile          | 34 +++++++++++++++++-----------------
 src/lasieve4/Makefile |  6 +++---
 src/pol5/Makefile     |  8 ++++----
 3 files changed, 24 insertions(+), 24 deletions(-)

diff --git a/src/Makefile b/src/Makefile
index 01f66be..59b433f 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -1,15 +1,15 @@
 # Workaround for PPC
 # Due to unknown reason -march isn't supported there
 ifeq ($(ARCH),970)
-    ALLOPT=-mcpu=$(ARCH) -m64 -pipe
+    ALLOPT=
 else
-    ALLOPT=-march=$(ARCH) -pipe
+    ALLOPT=
 endif
 
 INC=-I. -I.. -I../include $(LOCALINC)
 LIBS=-lgmp -lm
 BINDIR=../bin
-LIBFLAGS=$(LOCALLIB)
+LDFLAGS+=$(LOCALLIB)
 
 MATBUILD_TPIE=0
 TPIE_DIR=../../tpie
@@ -17,7 +17,7 @@ TPIE_DIR=../../tpie
 # Turn on\off workaround for GMP 4.2 bug
 # Consult http://swox.com/list-archives/gmp-bugs/2006-May/000475.html
 # for more info
-GMP_BUG=1
+GMP_BUG=0
 
 ifeq ($(HOST),generic)
     ALLOPT+= -DGGNFS_HOST_GENERIC
@@ -32,10 +32,10 @@ ifeq ($(ARCH),prescott)
     ALLOPT+= -DL2_CACHE_SIZE=1024
 endif
 
-DEBUGOPT=-W -Wall -g -pg
+DEBUGOPT=-W -Wall
 
-CFLAGS=-DNDEBUG -O3 -funroll-loops -finline-functions \
-       -ftracer -fomit-frame-pointer -W -Wall $(ALLOPT)
+CFLAGS+=-DNDEBUG \
+       -W -Wall $(ALLOPT)
 # CFLAGS=$(DEBUGOPT) $(ALLOPT)
 # -ffast-math removed since -funsafe-math-optimizations seems to cause occasional problems, especially in sqrt
 
@@ -71,7 +71,7 @@ endif
 ifeq ($(MATBUILD_TPIE),1)
   BINS+= $(BINDIR)/matbuild-tpie
   INC+= -I$(TPIE_DIR)/include
-  LIBFLAGS+= -L$(TPIE_DIR)/lib
+  LDFLAGS+= -L$(TPIE_DIR)/lib
   LIBS+=-ltpie
 endif
 
@@ -97,35 +97,35 @@ bins : $(BINS)
 	$(CC) $(CFLAGS) -o $@ -c $*.S
 
 $(BINDIR)/sieve : sieve.c clsieve.c $(OBJS) makefb.o
-	$(CC) $(INC) $(CFLAGS) $(LIBFLAGS) -o $@ $^ $(LIBS)
+	$(CC) $(INC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS)
 
 $(BINDIR)/makefb : makefb.c $(OBJS)
-	$(CC) $(INC) $(CFLAGS) $(LIBFLAGS) -D_MAKEFB_STANDALONE -o $@ \
+	$(CC) $(INC) $(CFLAGS) $(LDFLAGS) -D_MAKEFB_STANDALONE -o $@ \
 	makefb.c $(OBJS) $(LIBS)
 
 $(BINDIR)/procrels : procrels.c $(OBJS)
-	$(CC) $(INC) $(CFLAGS) $(LIBFLAGS) -o $@ procrels.c $(OBJS) $(LIBS)
+	$(CC) $(INC) $(CFLAGS) $(LDFLAGS) -o $@ procrels.c $(OBJS) $(LIBS)
 
 $(BINDIR)/matbuild : matbuild.c $(OBJS)
-	$(CC) $(INC) $(CFLAGS) $(LIBFLAGS) -o $@ matbuild.c combparts.c \
+	$(CC) $(INC) $(CFLAGS) $(LDFLAGS) -o $@ matbuild.c combparts.c \
 	  $(OBJS) $(LIBS)
 
 $(BINDIR)/matbuild-tpie : matbuild.c $(OBJS)
-	$(CPP) $(INC) $(CFLAGS) $(LIBFLAGS) -DGGNFS_TPIE -o $@ matbuild.c \
+	$(CPP) $(INC) $(CFLAGS) $(LDFLAGS) -DGGNFS_TPIE -o $@ matbuild.c \
 	  experimental/combparts_tpie.cpp experimental/llist_tpie.cpp \
 	  $(OBJS) $(LIBS)
 
 $(BINDIR)/matprune : matprune.c $(OBJS)
-	$(CC) $(INC) $(CFLAGS) $(LIBFLAGS) -o $@ matprune.c $(OBJS) $(LIBS)
+	$(CC) $(INC) $(CFLAGS) $(LDFLAGS) -o $@ matprune.c $(OBJS) $(LIBS)
 
 $(BINDIR)/matsolve : matsolve.c $(OBJS)
-	$(CC) $(INC) $(CFLAGS) $(LIBFLAGS) -o $@ matsolve.c $(OBJS) $(LIBS)
+	$(CC) $(INC) $(CFLAGS) $(LDFLAGS) -o $@ matsolve.c $(OBJS) $(LIBS)
 
 $(BINDIR)/sqrt : sqrt.c $(OBJS)
-	$(CC) $(INC) $(CFLAGS) $(LIBFLAGS) -o $@ sqrt.c $(OBJS) $(LIBS)
+	$(CC) $(INC) $(CFLAGS) $(LDFLAGS) -o $@ sqrt.c $(OBJS) $(LIBS)
 
 $(BINDIR)/polyselect : polyselect.c $(OBJS)
-	$(CC) $(INC) $(CFLAGS) $(LIBFLAGS) -o $@ polyselect.c $(OBJS) $(LIBS)
+	$(CC) $(INC) $(CFLAGS) $(LDFLAGS) -o $@ polyselect.c $(OBJS) $(LIBS)
 
 latsiever :
 	$(MAKE) -C lasieve4
diff --git a/src/lasieve4/Makefile b/src/lasieve4/Makefile
index 31e05a9..6886b16 100644
--- a/src/lasieve4/Makefile
+++ b/src/lasieve4/Makefile
@@ -10,8 +10,8 @@
 # 6/13/04: Hacked up for use in GGNFS by Chris Monico.
 
 INC=-I.. -I../../include $(LOCALINC)
-LIBFLAGS=-L. $(LOCALLIB)
-CFLAGS+=-Os
+LDFLAGS+=-L. $(LOCALLIB)
+CFLAGS+=
 
 BINDIR=../../bin
 FACT=prho.o
@@ -58,7 +58,7 @@ gnfs-lasieve4eI%.o: gnfs-lasieve4e.c lasieve.h asm/siever-config.h
 
 $(BINDIR)/gnfs-lasieve4I%e: gnfs-lasieve4eI%.o $(OBJS) libgmp-aux.a \
                              asm/liblasieve.a asm/liblasieveI%.a $(FACT)
-	$(CC) $(CFLAGS) $(INC) $(LIBFLAGS) -o $@ $^ $(LIBS)
+	$(CC) $(CFLAGS) $(INC) $(LDFLAGS) -o $@ $^ $(LIBS)
 
 asm/lib%.a:
 	$(MAKE) -C asm
diff --git a/src/pol5/Makefile b/src/pol5/Makefile
index 44b08be..e474ffb 100644
--- a/src/pol5/Makefile
+++ b/src/pol5/Makefile
@@ -1,6 +1,6 @@
 BINDIR=../../bin
 INC=-I.. -I../../include $(LOCALINC)
-LIBFLAGS=$(LOCALLIB)
+LDFLAGS+=$(LOCALLIB)
 LIBS=-lm -lgmp
 CFLAGS2=
 
@@ -46,13 +46,13 @@ all: $(BINS)
 	$(CC) $(INC) -c $(CFLAGS) $(CFLAGS2) $^
 
 $(BINDIR)/pol51m0b: pol51m0b.o $(OBJS) $(OBJS2)
-	$(CC) $(INC) -o $@ $(CFLAGS) $(CFLAGS2) $^ $(LIBFLAGS) $(LIBS)
+	$(CC) $(INC) $(LDFLAGS) -o $@ $(CFLAGS) $(CFLAGS2) $^ $(LIBS)
 
 $(BINDIR)/pol51m0n: pol51m0n.o $(OBJS) $(OBJS3)
-	$(CC) $(INC) $(CFLAGS) $(CFLAGS2) -o $@ $^ $(LIBFLAGS) $(LIBS)
+	$(CC) $(INC) $(CFLAGS) $(CFLAGS2) $(LDFLAGS) -o $@ $^ $(LIBS)
 
 $(BINDIR)/pol51opt: pol51opt.o $(OBJS) $(OBJS4)
-	$(CC) $(INC) $(CFLAGS) $(CFLAGS2) -o $@ $^ $(LIBFLAGS) $(LIBS)
+	$(CC) $(INC) $(CFLAGS) $(CFLAGS2) $(LDFLAGS) -o $@ $^ $(LIBS)
 
 clean : ;
 	rm -f $(BINS) *.o core