X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=Makefile;h=2d90c16b4e55ad7bcc2046395af266caa9d1f712;hb=6d9abf287d99279385cd858bd58602ab19654a8b;hp=de622ecb2b1e3eed7687165b2fa43b1ec88e1a2b;hpb=24ac8e855acce4248271ca4a13f0dad8e74a96a4;p=model-checker.git diff --git a/Makefile b/Makefile index de622ec..2d90c16 100644 --- a/Makefile +++ b/Makefile @@ -1,16 +1,56 @@ -CC=g++ -BIN=model -SOURCE=libthreads.cc schedule.cc libatomic.cc userprog.c model.cc malloc.c threads.cc -HEADERS=libthreads.h schedule.h common.h libatomic.h model.h threads_internal.h -FLAGS=-Wall -ldl -g +include common.mk -all: ${BIN} +MODEL_CC=libthreads.cc schedule.cc model.cc threads.cc librace.cc action.cc nodestack.cc clockvector.cc main.cc snapshot-interface.cc cyclegraph.cc datarace.cc impatomic.cc cmodelint.cc promise.cc +MODEL_O=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 promise.o +MODEL_H=libthreads.h schedule.h common.h model.h threads.h librace.h action.h nodestack.h clockvector.h snapshot-interface.h cyclegraph.h hashtable.h datarace.h config.h include/impatomic.h include/cstdatomic include/stdatomic.h cmodelint.h promise.h -${BIN}: ${SOURCE} ${HEADERS} - ${CC} -o ${BIN} ${SOURCE} ${FLAGS} +SHMEM_CC=snapshot.cc malloc.c mymemory.cc +SHMEM_O=snapshot.o malloc.o mymemory.o +SHMEM_H=snapshot.h snapshotimp.h mymemory.h config.h + +CPPFLAGS += -Iinclude -I. +LDFLAGS=-ldl -lrt +SHARED=-shared + +TESTS=test + +all: $(LIB_SO) tests + +debug: CPPFLAGS += -DCONFIG_DEBUG +debug: all + +mac: CPPFLAGS += -D_XOPEN_SOURCE -DMAC +mac: LDFLAGS=-ldl +mac: SHARED=-Wl,-undefined,dynamic_lookup -dynamiclib +mac: all + +docs: *.c *.cc *.h + doxygen + +$(LIB_SO): $(MODEL_O) $(MODEL_H) $(SHMEM_O) $(SHMEM_H) + $(CXX) $(SHARED) -o $(LIB_SO) $(MODEL_O) $(SHMEM_O) $(LDFLAGS) + +malloc.o: malloc.c + $(CC) -fPIC -c malloc.c -DMSPACES -DONLY_MSPACES $(CPPFLAGS) + +mymemory.o: mymemory.h snapshotimp.h snapshot.h mymemory.cc config.h + $(CXX) -fPIC -c mymemory.cc $(CPPFLAGS) + +snapshot.o: mymemory.h snapshot.h snapshotimp.h snapshot.cc config.h + $(CXX) -fPIC -c snapshot.cc $(CPPFLAGS) + +%.o: %.cc $(MODEL_H) + $(CXX) -fPIC -c $< $(CPPFLAGS) clean: - rm -f ${BIN} *.o + rm -f *.o *.so + $(MAKE) -C $(TESTS) clean + +mrclean: clean + rm -rf docs tags:: ctags -R + +tests:: $(LIB_SO) + $(MAKE) -C $(TESTS)