Makefile 1.24 KB
Newer Older
David Speck's avatar
David Speck committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
CXX = g++ -g -O3 -Wall -std=c++11 -DNDEBUG
TEST_BINARIES = $(basename $(wildcard *Test.cc))
HEADER = $(wildcard *.h)
OBJECTS = $(addsuffix .o, $(basename $(filter-out %Test.cc, $(wildcard *.cc))))
CPPLINT_PATH = ./cpplint.py

FILES = ../meddly_extensions/genericBinaryOperator.h \
	../meddly_extensions/intersectionMax.h \
	../meddly_extensions/unionMin.h \
	../meddly_extensions/userDefiniedOperators.h \
	../meddly_extensions/restrict.h \
	../meddly_extensions/swapVarPrimed.h \
	../meddly_extensions/swapToPrimedVar.h \
	../meddly_extensions/partialComplement.h \
	../meddly_extensions/minVar.h \
        ../meddly_extensions/minStates.h \

.PRECIOUS: %.o

all: copyfiles compile test

compile: $(basename $(wildcard *Test.cc))

copyfiles:
	cp $(FILES) .
	cp $(FILES:.h=.cc) .

removecopiedfiles:
	rm -f $(notdir $(FILES))
	rm -f $(notdir $(FILES:.h=.cc))

test: $(basename $(wildcard *Test.cc)) 
	for T in $(basename $(wildcard *Test.cc)); do ./$$T; done

clean: removecopiedfiles
	rm -f *.o
	rm -f $(basename $(wildcard *Test.cc)) 
	rm -f *.class
	rm -f *Test.TMP.*
	rm -f core

%Test: %Test.o $(addsuffix .o, $(basename $(filter-out %Test.cc, $(wildcard *.cc))))
	$(CXX) -o $@ $^ -lgtest -lgtest_main -lpthread -lmeddly

%.o: %.cc $(wildcard *.h)
	$(CXX) -c $<