X-Git-Url: http://plrg.eecs.uci.edu/git/?p=c11tester.git;a=blobdiff_plain;f=Makefile;h=b653e7699c4c055dbfa99b68fab57c5fd95d303c;hp=2bd61ce26c0c13b7f87798b671869fea9fc49a6d;hb=91154c0e76e77ff53c968f3aa7ad7626fae19acb;hpb=870ba814eceb1afee4eefb17dab3980549ca73e2 diff --git a/Makefile b/Makefile index 2bd61ce2..b653e769 100644 --- a/Makefile +++ b/Makefile @@ -3,59 +3,73 @@ 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 + snapshot.o malloc.o mymemory.o common.o mutex.o promise.o conditionvariable.o CPPFLAGS += -Iinclude -I. -LDFLAGS = -ldl -lrt +LDFLAGS = -ldl -lrt -rdynamic SHARED = -shared # Mac OSX options ifeq ($(UNAME), Darwin) -CPPFLAGS += -D_XOPEN_SOURCE -DMAC LDFLAGS = -ldl SHARED = -Wl,-undefined,dynamic_lookup -dynamiclib endif TESTS_DIR = test -program_H_SRCS := $(wildcard *.h) $(wildcard include/*.h) -program_C_SRCS := $(wildcard *.c) $(wildcard *.cc) -DEPS = make.deps - -all: $(LIB_SO) $(DEPS) tests - -$(DEPS): $(program_C_SRCS) $(program_H_SRCS) - $(CXX) -MM $(program_C_SRCS) $(CPPFLAGS) > $(DEPS) - -# Only include, rebuild make.deps when it's going to be used -ifeq ($(MAKECMDGOALS),$(DEPS)) -include $(DEPS) -endif +all: $(LIB_SO) tests debug: CPPFLAGS += -DCONFIG_DEBUG debug: all +PHONY += docs docs: *.c *.cc *.h doxygen $(LIB_SO): $(OBJECTS) - $(CXX) $(SHARED) -o $(LIB_SO) $(OBJECTS) $(LDFLAGS) + $(CXX) $(SHARED) -o $(LIB_SO) $+ $(LDFLAGS) malloc.o: malloc.c - $(CC) -fPIC -c malloc.c -DMSPACES -DONLY_MSPACES $(CPPFLAGS) + $(CC) -fPIC -c malloc.c -DMSPACES -DONLY_MSPACES -DHAVE_MMAP=0 $(CPPFLAGS) -Wno-unused-variable %.o: %.cc - $(CXX) -fPIC -c $< $(CPPFLAGS) + $(CXX) -MMD -MF .$@.d -fPIC -c $< $(CPPFLAGS) + +%.pdf: %.dot + dot -Tpdf $< -o $@ +-include $(OBJECTS:%=.%.d) + +PHONY += clean clean: - rm -f *.o *.so + rm -f *.o *.so .*.d *.pdf *.dot $(MAKE) -C $(TESTS_DIR) clean +PHONY += mrclean mrclean: clean rm -rf docs -tags:: +PHONY += tags +tags: ctags -R -tests:: $(LIB_SO) +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)