通过编译
This commit is contained in:
parent
34f17a7b2e
commit
e74d0af54b
6
makefile
6
makefile
@ -5,20 +5,14 @@ SOURCES := $(shell find ./src -type f -name "*.cpp")
|
|||||||
OBJECTS := $(addprefix build/,$(SOURCES:%=%.o))
|
OBJECTS := $(addprefix build/,$(SOURCES:%=%.o))
|
||||||
|
|
||||||
# 声明编译器和编译选项
|
# 声明编译器和编译选项
|
||||||
CC := gcc
|
|
||||||
CXX := g++
|
CXX := g++
|
||||||
CFLAGS := -O3 -g -Wall -Wextra -MMD -MP -flto
|
|
||||||
CXXFLAGS := -O3 -g -Wall -Wextra -MMD -MP -flto
|
CXXFLAGS := -O3 -g -Wall -Wextra -MMD -MP -flto
|
||||||
|
|
||||||
# 默认目标,编译所有目标文件
|
# 默认目标,编译所有目标文件
|
||||||
atpg: $(OBJECTS)
|
atpg: $(OBJECTS)
|
||||||
$(CXX) $(CXXFLAGS) $^ -o $@
|
$(CXX) $(CXXFLAGS) $^ -o $@
|
||||||
|
|
||||||
# 生成目标文件的规则
|
|
||||||
build/%.o: % | build
|
build/%.o: % | build
|
||||||
$(CC) $(CFLAGS) -c $< -o $@
|
|
||||||
|
|
||||||
build/%.o: %.cpp | build
|
|
||||||
$(CXX) $(CXXFLAGS) -c $< -o $@
|
$(CXX) $(CXXFLAGS) -c $< -o $@
|
||||||
|
|
||||||
# 包含依赖文件
|
# 包含依赖文件
|
||||||
|
@ -5,6 +5,8 @@
|
|||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
#include <unordered_set>
|
#include <unordered_set>
|
||||||
#include <queue>
|
#include <queue>
|
||||||
|
#include <algorithm>
|
||||||
|
#include <assert.h>
|
||||||
|
|
||||||
using ll = long long;
|
using ll = long long;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user