forked from WWFUG/ClauSSat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
176 lines (137 loc) · 3.65 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
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
# ./configure --enable-dddmp --enable-obj --enable-static
#DBG=1
# Choose solver (MiniSat or Glucose)
USE_GL=1
# Choose version (minisat_simp, glucose_parallel for USE_SIMP=0)
USE_SIMP=1
CSRCS = $(wildcard ./src/*.cc)
NSRCS = $(wildcard *.nw)
YACC = $(wildcard *.y)
LEX = $(wildcard *.l)
COBJS = $(CSRCS:.cc=.o) $(YACC:.y=.tab.o) $(LEX:.l=.o)
DEPENDS = ${COBJS:.o=.d}
PDFS = $(NSRCS:.nw=.pdf)
LIBD =
LIBS =
EXE = claussat
CXX?=g++
CC=g++
CFLAGS+=-I.
ifdef PROF
CFLAGS+=-fprofile-arcs -ftest-coverage
CFLAGS+=-pg
CFLAGS+=-g
LNFLAGS+=-fprofile-arcs
LNFLAGS+=-pg
LNFLAGS+=-g
endif
ifdef DBG
CFLAGS+=-O0
CFLAGS+=-ggdb
CFLAGS+=-DDBG
CFLAGS+=-g3
MSAT=libd
else
CFLAGS+=-DNDEBUG
CFLAGS+=-O3
MSAT=libr
endif
ifdef NOO
CFLAGS+=-O0
endif
CFLAGS += -Wall -DBUILDDATE='"$(BUILDDATE)"' -DDISTDATE='"$(DISTDATE)"'
CFLAGS += -DCHANGESET='"$(CHANGESET)"' -DRELDATE='"$(RELDATE)"'
CFLAGS+=-D __STDC_LIMIT_MACROS -D __STDC_FORMAT_MACROS -Wno-parentheses -Wno-deprecated -Wno-misleading-indentation -D _MSC_VER
CFLAGS+=-std=c++14
#CFLAGS+=-std=c++0x
CFLAGS+=-MMD
CFLAGS+=-MP
LIBS+=-lz
# Glucose: No core version after glucose 4.0
ifdef USE_GL
EXTERNAL+=gl
CFLAGS+=-I./src/glucose-4.1/
LIBD+=-L./src/glucose-4.1/simp
LIBD+=-L./src/glucose-4.1/parallel
LIBS+=-lglucose_simp
LIBS+=-lglucose_parallel
CFLAGS+=-DUSE_GL
else
EXTERNAL+=m
LIBS+=-lminisat
LIBS+=-lminisat_simp
LIBD+=-L./src/minisat/core
LIBD+=-L./src/minisat/simp
CFLAGS+=-I./src/minisat/
endif
EXTERNAL+=cudd
CFLAGS+=-I./src/cudd/cudd
CFLAGS+=-I./src/cudd/util
CFLAGS+=-I./src/cudd/
LIBD+=-L./src/cudd/cudd/.libs/
LIBS+=-lcudd
# LIBS+=-lmtr
# LIBS+=-libst
LIBS+=-lgmpxx
LIBS+=-lgmp
ifdef EXPERT # allow using giving options, without options the solver's fairly dumb
CFLAGS+=-DEXPERT
endif
ifdef STATIC
CFLAGS+=-static
LNFLAGS+=-static
endif
ifdef USE_SIMP
CFLAGS+=-DUSE_SIMP
endif
ifdef NON_INCR
CFLAGS+=-DNON_INCR
endif
## Filter used to typeset C++
NW_FILTER=-filter C++.filter
.PHONY: cudd m gl all doc
all:
make $(EXE)
$(EXE): $(COBJS) $(EXTERNAL)
@echo Linking: $@
@$(CXX) -o $@ $(COBJS) $(LNFLAGS) $(LIBD) $(LIBS)
m:
@export MROOT=`pwd`/src/minisat ; cd ./src/minisat/core; make CXX=$(CXX) LIB=minisat $(MSAT)
@export MROOT=`pwd`/src/minisat ; cd ./src/minisat/simp; make CXX=$(CXX) LIB=minisat_simp $(MSAT)
gl:
@export MROOT=`pwd`/src/glucose-4.1 ; cd ./src/glucose-4.1/simp; make CXX=$(CXX) LIB=glucose_simp $(MSAT)
@export MROOT=`pwd`/src/glucose-4.1 ; cd ./src/glucose-4.1/parallel; make CXX=$(CXX) LIB=glucose_parallel $(MSAT)
cudd:
@export MROOT=`pwd`/src/cudd/; cd ./src/cudd; make;
sources: $(GENF)
main.o: main.cc
%.o: %.cc
@echo Compiling: $@
@$(CXX) $(CFLAGS) -c -o $@ $<
%.o: %.c Makefile
@echo Compiling: $@
@$(CXX) $(CFLAGS) -c -o $@ $<
%.tab.h %.tab.c: %.y
@echo Generating: $*
@bison $<
%.c: %.l Makefile
@echo Generating: $*
@flex -o$@ $<
./src/Options.hh ./src/Options.cc: src/option_generation
@echo Generating: $@
./src/option_generation >./src/Options.hh 2>./src/Options.cc
clean:
@rm -f $(DEPENDS)
@rm -f $(GENF)
@rm -f $(EXE) $(EXE).exe $(COBJS) *.tab.[ch]
@export MROOT=`pwd`/src/minisat ; cd ./src/minisat/core; make CXX=$(CXX) clean
@export MROOT=`pwd`/src/minisat ; cd ./src/minisat/simp; make CXX=$(CXX) clean
@export MROOT=`pwd`/src/glucose-4.1 ; cd ./src/glucose-4.1/simp ; make CXX=$(CXX) clean
@export MROOT=`pwd`/src/glucose-4.1 ; cd ./src/glucose-4.1/parallel; make CXX=$(CXX) clean
@export MROOT=`pwd`/src/cudd/; cd ./src/cudd/; make clean;
doc: $(PDFS)
%.pdf: doc/%.tex
@latexmk -pdf $<
doc/%.tex: doc/%.nw doc/texheader.tex Makefile
@noweave -x $(NW_FILTER) $< | sed 's/\\begin{document}/\\input{doc/texheader.tex}\\begin{document}/' >$@
-include ${DEPENDS}