3 OBJECTS := libthreads.o schedule.o model.o threads.o librace.o action.o \
4 nodestack.o clockvector.o main.o snapshot-interface.o cyclegraph.o \
5 datarace.o impatomic.o cmodelint.o \
6 snapshot.o malloc.o mymemory.o common.o mutex.o conditionvariable.o \
7 context.o execution.o libannotate.o plugins.o pthread.o futex.o fuzzer.o
9 CPPFLAGS += -Iinclude -I.
10 LDFLAGS := -ldl -lrt -rdynamic
14 ifeq ($(UNAME), Darwin)
16 SHARED := -Wl,-undefined,dynamic_lookup -dynamiclib
21 MARKDOWN := doc/Markdown/Markdown.pl
23 all: $(LIB_SO) tests README.html
25 debug: CPPFLAGS += -DCONFIG_DEBUG
29 docs: *.c *.cc *.h README.html
32 README.html: README.md
36 $(CC) -fPIC -c malloc.c -DMSPACES -DONLY_MSPACES -DHAVE_MMAP=0 $(CPPFLAGS) -Wno-unused-variable
39 $(CXX) -fPIC -c futex.cc -std=c++11 $(CPPFLAGS)
43 $(CXX) -MMD -MF .$@.d -fPIC -c $< $(CPPFLAGS)
47 $(CXX) $(SHARED) -o $(LIB_SO) $+ $(LDFLAGS)
52 -include $(OBJECTS:%=.%.d)
56 rm -f *.o *.so .*.d *.pdf *.dot
57 $(MAKE) -C $(TESTS_DIR) clean
69 # $(MAKE) -C $(TESTS_DIR)
71 BENCH_DIR := benchmarks
75 @if ! test -d $(BENCH_DIR); then \
76 echo "Directory $(BENCH_DIR) does not exist" && \
77 echo "Please clone the benchmarks repository" && \
81 $(MAKE) -C $(BENCH_DIR)
84 pdfs: $(patsubst %.dot,%.pdf,$(wildcard *.dot))
88 # A 1-inch margin PDF generated by 'pandoc'
90 pandoc -o $@ $< -V header-includes='\usepackage[margin=1in]{geometry}'
93 uncrustify -c C.cfg --no-backup --replace *.cc
94 uncrustify -c C.cfg --no-backup --replace *.h