-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile.in
113 lines (79 loc) · 3.6 KB
/
makefile.in
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
#==========================================================================#
# This is a 'makefile.in' template with '@CXX@' and '@CXXFLAGS@' parameters.
# This makefile requires GNU make.
#==========================================================================#
# The '../scripts/make-build-header.sh' script searches for the next two
# lines to figure out the compiler and compilation flags. This information
# is then used to generate corresponding macros in 'build.hpp'.
CXX=@CXX@
CXXFLAGS=@CXXFLAGS@
LIBS=@LIBS@
############################################################################
# It is usually not necessary to change anything below this line! #
############################################################################
APP=cadical.cpp mobical.cpp
SRC_MAIN=$(wildcard ../src/*.cpp)
SRC_SHA256=$(wildcard ../src/sha256/*.cpp)
SRC_1BIT=$(wildcard ../src/sha256/1_bit/*.cpp)
SRC_4BIT=$(wildcard ../src/sha256/4_bit/*.cpp)
SRC_LI2024=$(wildcard ../src/sha256/li2024/*.cpp)
SRC=$(sort $(SRC_MAIN) $(SRC_SHA256) $(SRC_1BIT) $(SRC_4BIT) $(SRC_LI2024))
SUB=$(subst ../src/,,$(SRC_MAIN)) \
$(subst ../src/sha256/,sha256/,$(SRC_SHA256)) \
$(subst ../src/sha256/1_bit/,sha256/1_bit/,$(SRC_1BIT)) \
$(subst ../src/sha256/4_bit/,sha256/4_bit/,$(SRC_4BIT)) \
$(subst ../src/sha256/li2024/,sha256/li2024/,$(SRC_LI2024))
LIB=$(filter-out $(APP),$(SUB))
OBJ=$(LIB:.cpp=.o)
DIR=../$(shell pwd|sed -e 's,.*/,,')
COMPILE=$(CXX) $(CXXFLAGS) -I$(DIR)
#--------------------------------------------------------------------------#
all: libcadical.a cadical mobical
#--------------------------------------------------------------------------#
.SUFFIXES: .cpp .o
%.o: ../src/%.cpp ../src/*.hpp makefile
$(COMPILE) -c $<
sha256/%.o: ../src/sha256/%.cpp ../src/sha256/*.hpp makefile
$(COMPILE) -c $< -o $@
sha256/1bit/%.o: ../src/sha256/1_bit/%.cpp ../src/sha256/1_bit/*.hpp makefile
$(COMPILE) -c $< -o $@
sha256/4bit/%.o: ../src/sha256/4_bit/%.cpp ../src/sha256/4_bit/*.hpp makefile
$(COMPILE) -c $< -o $@
sha256/li2024/%.o: ../src/sha256/li2024/%.cpp ../src/sha256/li2024/*.hpp makefile
$(COMPILE) -c $< -o $@
#--------------------------------------------------------------------------#
# Application binaries (the stand alone solver 'cadical' and the model based
# tester 'mobical') and the library are the main build targets.
cadical: cadical.o libcadical.a makefile
$(COMPILE) -o $@ $< -L. -lcadical $(LIBS)
mobical: mobical.o libcadical.a makefile $(LIBS)
$(COMPILE) -o $@ $< -L. -lcadical
libcadical.a: $(OBJ) makefile
ar rc $@ $(OBJ)
#--------------------------------------------------------------------------#
# Note that 'build.hpp' is generated and resides in the build directory.
build.hpp: always
../scripts/make-build-header.sh > build.hpp
version.o: build.hpp
update:
../scripts/update-version.sh
#--------------------------------------------------------------------------#
# These two 'C' interfaces include '.h' headers and thus require explicitly
# defined additional dependencies.
ccadical.o: ../src/ccadical.h
ipasir.o: ../src/ipasir.h ../src/ccadical.h
#--------------------------------------------------------------------------#
analyze: all
$(COMPILE) --analyze ../src/*.cpp
format:
clang-format -i ../*/*.[ch]pp
clang-format -i ../*/*.[ch]
clang-format -i ../test/*/*.[ch]pp
clang-format -i ../test/*/*.[ch]
clean:
rm -f *.o *.a cadical mobical makefile build.hpp
rm -f *.gcda *.gcno *.gcov gmon.out
test: all
CADICALBUILD="$(DIR)" $(MAKE) -j1 -C ../test
#--------------------------------------------------------------------------#
.PHONY: all always analyze clean test update format