-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
52 lines (40 loc) · 1.25 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
CC := g++
exe := main
#obj := main.o statistic.o evaluate.o utility.o
CFLAGS := -std=c++17 -O3 -Wall -Wextra -g
SANITIZE := -fsanitize=undefined -fsanitize=address
DEFINE := -DINF -DDBG
LINK := -lm -ldl -lreadline -ltinfo
LIB := lib/libabc.a lib/libkissat.a lib/aiger.o lib/libcadical.a
#INCLUDES :=
src_dir = ./src
obj_dir = ./obj
src = $(wildcard $(src_dir)/*.cpp)
header = $(wildcard $(src_dir)/*.h)
obj = $(patsubst $(src_dir)/%.cpp, $(obj_dir)/%.o, $(src))
all:$(obj) $(LIB) $(header)
$(CC) $(DEFINE) $(CFLAGS) -o $(exe) $(obj) $(LIB) $(LINK)
initDir:
mkdir -p $(obj_dir)
$(obj_dir)/%.o: $(src_dir)/%.cpp $(header) initDir
$(CC) $(DEFINE) $(CFLAGS) -c $< -o $@
lib/libabc.a:
$(MAKE) -j -C "lib/abc/" libabc.a ABC_USE_NO_PTHREADS=1 ABC_USE_NO_READLINE=1
mv lib/abc/libabc.a lib/
lib/libkissat.a:
$(MAKE) -j -C "lib/SATsolver/build" libkissat.a
mv lib/SATsolver/build/libkissat.a lib/
$(MAKE) -C "lib/SATsolver/build" clean
lib/aiger.o:
gcc -c lib/aiger/aiger.c -o lib/aiger.o
lib/libcadical.a:
cd lib/cadical && ./configure -q && make -j
mv lib/cadical/build/libcadical.a lib/
test:$(obj) $(LIB) $(header)
echo $(header)
clean:
rm -rf $(obj) $(exe)
run: all
./main input.txt output.txt
rm -f *.aig *.aag stdoutOutput.txt *.cnf
rm -rf optimizeAIG