-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathMakefile
More file actions
85 lines (62 loc) · 1.73 KB
/
Makefile
File metadata and controls
85 lines (62 loc) · 1.73 KB
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
include common.mk
OBJECTS := libthreads.o schedule.o model.o threads.o librace.o action.o \
nodestack.o clockvector.o main.o snapshot-interface.o cyclegraph.o \
datarace.o impatomic.o cmodelint.o \
snapshot.o malloc.o mymemory.o common.o mutex.o promise.o conditionvariable.o \
context.o scanalysis.o execution.o plugins.o
CPPFLAGS += -Iinclude -I.
LDFLAGS := -ldl -lrt -rdynamic
SHARED := -shared
# Mac OSX options
ifeq ($(UNAME), Darwin)
LDFLAGS := -ldl
SHARED := -Wl,-undefined,dynamic_lookup -dynamiclib
endif
TESTS_DIR := test
MARKDOWN := doc/Markdown/Markdown.pl
all: $(LIB_SO) tests README.html
debug: CPPFLAGS += -DCONFIG_DEBUG
debug: all
PHONY += docs
docs: *.c *.cc *.h README.html
doxygen
README.html: README.md
$(MARKDOWN) $< > $@
$(LIB_SO): $(OBJECTS)
$(CXX) $(SHARED) -o $(LIB_SO) $+ $(LDFLAGS)
malloc.o: malloc.c
$(CC) -fPIC -c malloc.c -DMSPACES -DONLY_MSPACES -DHAVE_MMAP=0 $(CPPFLAGS) -Wno-unused-variable
%.o: %.cc
$(CXX) -MMD -MF .$@.d -fPIC -c $< $(CPPFLAGS)
%.pdf: %.dot
dot -Tpdf $< -o $@
-include $(OBJECTS:%=.%.d)
PHONY += clean
clean:
rm -f *.o *.so .*.d *.pdf *.dot
$(MAKE) -C $(TESTS_DIR) clean
PHONY += mrclean
mrclean: clean
rm -rf docs
PHONY += tags
tags:
ctags -R
PHONY += tests
tests: $(LIB_SO)
$(MAKE) -C $(TESTS_DIR)
BENCH_DIR := benchmarks
PHONY += benchmarks
benchmarks: $(LIB_SO)
@if ! test -d $(BENCH_DIR); then \
echo "Directory $(BENCH_DIR) does not exist" && \
echo "Please clone the benchmarks repository" && \
echo && \
exit 1; \
fi
$(MAKE) -C $(BENCH_DIR)
PHONY += pdfs
pdfs: $(patsubst %.dot,%.pdf,$(wildcard *.dot))
.PHONY: $(PHONY)
# A 1-inch margin PDF generated by 'pandoc'
%.pdf: %.md
pandoc -o $@ $< -V header-includes='\usepackage[margin=1in]{geometry}'