-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
executable file
·59 lines (45 loc) · 2.04 KB
/
makefile
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
# assume Linux, use gcc, g++
GMPLIBDIR = /usr/local/lib
#COVERAGE_LIBS = -lgcov
#COVERAGE = -fprofile-arcs -ftest-coverage
#COVERAGE_OPT = -pg
COVERAGE_LIBS =
COVERAGE =
COVERAGE_OPT =
LIBS = -L/usr/lib64 -L/usr/local/lib $(COVERAGE_LIBS) -lgmp -lpthread -ltcmalloc_minimal -static-libstdc++
#LIBS = -L/usr/lib64 -L/usr/local/lib $(COVERAGE_LIBS) -lgmp -lpthread -static-libstdc++
INCLUDES = -I/usr/local/include
OPT = -O3
#CCFLAGS = -Wall -g $(OPT) $(PROFILE) $(ARCH) -std=c++14 -fno-operator-names -Wno-non-template-friend -Wno-uninitialized -DUSING_GCC -Dlinux
CCFLAGS = -Wall -g $(COVERAGE_OPT) $(COVERAGE) $(OPT) $(PROFILE) $(ARCH) -std=c++14
CFLAGS = -Wall -g $(COVERAGE_OPT) $(COVERAGE) $(OPT) $(PROFILE) $(ARCH)
CC = g++
cc = gcc
OBJEXT = .o
OUTPUTOPTION = -o
.SUFFIXES = $(OBJEXT) .cpp .c
.cpp$(OBJEXT):
$(CC) -c $(CCFLAGS) $<
.c$(OBJEXT):
$(cc) -c $(CFLAGS) $<
%.d: %.cpp
set -e; g++ -MM $(CPPFLAGS) $< \
| sed 's/\($*\)\.o[ :]*/\1.o $@ : /g' > $@; [ -s $@ ] || rm -f $@
%.d: %.c
set -e; gcc -MM $(CPPFLAGS) $< \
| sed 's/\($*\)\.o[ :]*/\1.o $@ : /g' > $@; [ -s $@ ] || rm -f $@
ALL_PROGRAMS : factorpoly
all : $(ALL_PROGRAMS)
ALL_HEADERS = crt.h discriminant.h gcd.h legendre.h lip.h lippar.h LongModular.h mod.h MPFloat.h mt19937int.h Polynomial.h pow.h Quotient.h VeryLong.h VeryLongModular.h Combinations.h Matrix.h lll.h timings.h
ALL_CPPS = factorpoly.cpp discriminant.cpp LongModular.cpp Polynomial.cpp VeryLong.cpp VeryLongModular.cpp lll.cpp timings.cpp
ALL_CS = lip.c mt19937int.c
ALL_SRCS = $(ALL_CPPS) $(ALL_CS) $(ALL_HEADERS)
ALL_OBJS = $(ALL_CPPS:.cpp=$(OBJEXT)) $(C_SRCS:.c=$(OBJEXT))
FACTOR_POLYNO_CPP_SRCS = factorpoly.cpp Polynomial.cpp VeryLong.cpp VeryLongModular.cpp LongModular.cpp discriminant.cpp lll.cpp timings.cpp
C_SRCS = mt19937int.c lip.c
include $(FACTOR_POLYNO_CPP_SRCS:.cpp=.d)
FACTOR_POLYNO_OBJS = $(FACTOR_POLYNO_CPP_SRCS:.cpp=$(OBJEXT)) $(C_SRCS:.c=$(OBJEXT))
factorpoly : $(FACTOR_POLYNO_OBJS)
$(CC) $(CCFLAGS) $(OUTPUTOPTION) factorpoly $(FACTOR_POLYNO_OBJS) $(LIBS)
clean:
rm -rf factorpoly *$(OBJEXT) *.d