]> git.scottworley.com Git - slidingtile/blame_incremental - Makefile
Clean Makefile.bak too
[slidingtile] / Makefile
... / ...
CommitLineData
1CXX = g++
2CXXFLAGS = -std=gnu++11 -Wall -Wextra -pedantic -O2
3LFLAGS =
4
5SRCS = sliding_tile.cc sliding_tile_lib.cc
6MAIN = sliding_tile
7LIBS =
8TESTLIBS = -lgtest_main -lgtest -lgmock
9
10OBJS = $(SRCS:.cc=.o)
11TEST_SRCS=$(wildcard *_test.cc)
12TESTS=$(subst .cc,,$(TEST_SRCS))
13
14.PHONY: depend clean test
15.INTERMEDIATE: $(OBJS)
16
17all: $(MAIN) $(TESTS)
18
19test: $(TESTS)
20 for t in ./*_test; do if ! $$t; then exit 1; fi ;done
21
22clean:
23 rm -f *.o $(MAIN) $(TESTS) Makefile.bak
24
25$(MAIN): $(OBJS)
26 $(CXX) $(CXXFLAGS) -o $@ $^ $(LFLAGS) $(LIBS)
27
28%_test: %_test.o %.o
29 $(CXX) $(CXXFLAGS) -o $@ $^ $(LFLAGS) $(LIBS) $(TESTLIBS)
30
31depend: $(SRCS)
32 makedepend $^
33
34# DO NOT DELETE THIS LINE -- make depend depends on it.
35
36sliding_tile.o: sliding_tile_lib.h