-
Notifications
You must be signed in to change notification settings - Fork 184
/
Copy pathMakefile
43 lines (31 loc) · 926 Bytes
/
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
# User-customizable variables:
CXX ?= c++
CXX_STD ?= c++20
CXXFLAGS ?= -I relacy -I relacy/relacy/fakestd -O1 -std=$(CXX_STD) -I ../../include -I ../../test -g
DEPFLAGS ?= -MD -MF $(@).d -MP -MT $(@)
build_dir = build
.SECONDARY:
test_programs = split async_scope
test_exe_files = $(foreach name,$(test_programs),$(build_dir)/$(name))
exe_files = $(test_exe_files)
o_files = $(exe_files:=.cpp.o)
ansi_term_csi = [
ansi_term_bold = $(ansi_term_csi)1m
ansi_term_green = $(ansi_term_csi)32m
ansi_term_red = $(ansi_term_csi)31m
ansi_term_reset = $(ansi_term_csi)m
COMPILE.cpp = $(CXX) $(DEPFLAGS) $(CXXFLAGS) -c
LINK.cpp = $(CXX) $(CXXFLAGS)
.PHONY: all
all: tests
.PHONY: tests
tests: $(test_exe_files)
$(build_dir)/%: $(build_dir)/%.cpp.o
$(LINK.cpp) $(^) -o $(@)
$(build_dir)/%.cpp.o: %.cpp
@mkdir -p $(dir $(@))
$(COMPILE.cpp) -o $(@) $(<)
.PHONY: clean
clean:
rm -fr -- $(build_dir)/
-include $(o_files:=.d)