X-Git-Url: http://git.scottworley.com/slidingtile/blobdiff_plain/2bf3412d1ed0c9da3c83d9ca276a7c91e4356d6a..e86755d75f4040ae6619702a6501325ea81b03e1:/Makefile?ds=sidebyside diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..333a641 --- /dev/null +++ b/Makefile @@ -0,0 +1,36 @@ +CXX = g++ +CXXFLAGS = -std=gnu++11 -Wall -Wextra -pedantic -O2 +LFLAGS = + +SRCS = sliding_tile.cc sliding_tile_lib.cc +MAIN = sliding_tile +LIBS = +TESTLIBS = -lgtest_main -lgtest -lgmock + +OBJS = $(SRCS:.cc=.o) +TEST_SRCS=$(wildcard *_test.cc) +TESTS=$(subst .cc,,$(TEST_SRCS)) + +.PHONY: depend clean test +.INTERMEDIATE: $(OBJS) + +all: $(MAIN) $(TESTS) + +test: $(TESTS) + for t in ./*_test; do if ! $$t; then exit 1; fi ;done + +clean: + rm -f *.o $(MAIN) $(TESTS) + +$(MAIN): $(OBJS) + $(CXX) $(CXXFLAGS) -o $@ $^ $(LFLAGS) $(LIBS) + +%_test: %_test.o %.o + $(CXX) $(CXXFLAGS) -o $@ $^ $(LFLAGS) $(LIBS) $(TESTLIBS) + +depend: $(SRCS) + makedepend $^ + +# DO NOT DELETE THIS LINE -- make depend depends on it. + +sliding_tile.o: sliding_tile_lib.h