3 OBJECTS := libthreads.o schedule.o model.o threads.o librace.o action.o \
4 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 \
8 sleeps.o history.o funcnode.o funcinst.o predicate.o printf.o newfuzzer.o \
9 concretepredicate.o waitobj.o hashfunction.o
11 CPPFLAGS += -Iinclude -I.
12 LDFLAGS := -ldl -lrt -rdynamic -lpthread
16 ifeq ($(UNAME), Darwin)
18 SHARED := -Wl,-undefined,dynamic_lookup -dynamiclib
23 MARKDOWN := doc/Markdown/Markdown.pl
25 all: $(LIB_SO) tests README.html
27 debug: CPPFLAGS += -DCONFIG_DEBUG
31 docs: *.c *.cc *.h README.html
34 README.html: README.md
38 $(CC) -fPIC -c malloc.c -DMSPACES -DONLY_MSPACES -DHAVE_MMAP=1 $(CPPFLAGS) -Wno-unused-variable
41 $(CC) -fPIC -c printf.c $(CPPFLAGS)
44 $(CXX) -fPIC -c futex.cc -std=c++11 $(CPPFLAGS)
47 $(CXX) -MMD -MF .$@.d -fPIC -c $< $(CPPFLAGS)
51 $(CXX) $(SHARED) -o $(LIB_SO) $+ $(LDFLAGS)
56 -include $(OBJECTS:%=.%.d)
60 rm -f *.o *.so .*.d *.pdf *.dot
61 $(MAKE) -C $(TESTS_DIR) clean
73 # $(MAKE) -C $(TESTS_DIR)
75 BENCH_DIR := benchmarks
79 @if ! test -d $(BENCH_DIR); then \
80 echo "Directory $(BENCH_DIR) does not exist" && \
81 echo "Please clone the benchmarks repository" && \
85 $(MAKE) -C $(BENCH_DIR)
88 pdfs: $(patsubst %.dot,%.pdf,$(wildcard *.dot))
92 # A 1-inch margin PDF generated by 'pandoc'
94 pandoc -o $@ $< -V header-includes='\usepackage[margin=1in]{geometry}'
97 uncrustify -c C.cfg --no-backup --replace *.cc
98 uncrustify -c C.cfg --no-backup --replace *.h
99 uncrustify -c C.cfg --no-backup --replace include/*