X-Git-Url: http://plrg.eecs.uci.edu/git/?p=c11tester.git;a=blobdiff_plain;f=Makefile;h=c363876dfd3fef30a0f2a3ecef3832949854c023;hp=2bd61ce26c0c13b7f87798b671869fea9fc49a6d;hb=4159ba45e83f6542e3a3320e83bca9fbaf2da3ea;hpb=870ba814eceb1afee4eefb17dab3980549ca73e2 diff --git a/Makefile b/Makefile index 2bd61ce2..c363876d 100644 --- a/Makefile +++ b/Makefile @@ -3,15 +3,14 @@ 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 @@ -22,19 +21,20 @@ program_H_SRCS := $(wildcard *.h) $(wildcard include/*.h) program_C_SRCS := $(wildcard *.c) $(wildcard *.cc) DEPS = make.deps -all: $(LIB_SO) $(DEPS) tests +all: $(LIB_SO) tests +$(DEPS): build_deps := 1 $(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)) +ifeq ($(build_deps),1) include $(DEPS) endif debug: CPPFLAGS += -DCONFIG_DEBUG debug: all +PHONY += docs docs: *.c *.cc *.h doxygen @@ -42,20 +42,38 @@ $(LIB_SO): $(OBJECTS) $(CXX) $(SHARED) -o $(LIB_SO) $(OBJECTS) $(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 +%.o: %.cc $(DEPS) $(CXX) -fPIC -c $< $(CPPFLAGS) +PHONY += clean clean: rm -f *.o *.so $(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) + +BENCHMARKS := benchmarks + +PHONY += benchmarks +benchmarks: $(LIB_SO) + @if ! test -d $(BENCHMARKS); then \ + echo "Directory $(BENCHMARKS) does not exist" && \ + echo "Please clone the benchmarks repository" && \ + echo && \ + exit 1; \ + fi + $(MAKE) -C $(BENCHMARKS) + +.PHONY: $(PHONY)