2023-03-26 19:15:17 +08:00
|
|
|
# 定义源文件列表
|
|
|
|
SOURCES := $(wildcard *.cpp) $(wildcard preprocess/*.cpp) $(wildcard utils/*.cpp) $(wildcard workers/*.cpp)
|
|
|
|
|
|
|
|
# 将源文件列表转换为目标文件列表
|
|
|
|
OBJECTS := $(addprefix build/,$(SOURCES:%=%.o))
|
|
|
|
|
|
|
|
# 声明编译器和编译选项
|
|
|
|
CXX := g++
|
2023-03-27 14:15:00 +08:00
|
|
|
CXXFLAGS := -O0 -Wall -Wextra -MMD -MP -g
|
2023-03-26 19:15:17 +08:00
|
|
|
|
|
|
|
LIBS := -lkissat -L../kissat-inc/build -I ../kissat-inc/ \
|
|
|
|
-lm4ri -Lpreprocess/m4ri-20140914/.libs -I preprocess/m4ri-20140914/ \
|
|
|
|
-lpthread -pthread -lz -lm -lboost_thread -lboost_date_time -lboost_system -static
|
|
|
|
|
|
|
|
# 默认目标,编译所有目标文件
|
|
|
|
build/light-solver: $(OBJECTS)
|
|
|
|
$(CXX) $(CXXFLAGS) $^ -o $@ $(LIBS)
|
|
|
|
|
|
|
|
build/%.o: % | build
|
|
|
|
$(CXX) $(CXXFLAGS) -c $< -o $@ $(LIBS)
|
|
|
|
|
|
|
|
# 包含依赖文件
|
|
|
|
-include $(OBJECTS:.o=.d)
|
|
|
|
|
|
|
|
# 如果需要,则递归创建源文件的目录结构
|
|
|
|
build:
|
|
|
|
mkdir -p $(sort $(dir $(OBJECTS)))
|
|
|
|
|
|
|
|
# 清除所有目标文件和build目录
|
|
|
|
clean:
|
|
|
|
rm -rf build $(OBJECTS)
|
|
|
|
|
|
|
|
.PHONY: clean all
|