]> Dogcows Code - chaz/vimcoder/blobdiff - src/com/dogcows/resources/C++Makefile
generate TAP output with the default C++ templates
[chaz/vimcoder] / src / com / dogcows / resources / C++Makefile
index 68c794a6fb2034293e5ebcffc75c9583c5a45d9b..3406fb0cef4a2f1ae9a6b377e416bee397c427ad 100644 (file)
@@ -1,26 +1,42 @@
 
+# Set the command for your C++ compiler, and specify any compiler flags you
+# want to use (e.g. -g -Werror).
 CXX            = g++
-CXXFLAGS       = -O0 -ggdb -Wall
+CXXFLAGS       = -ggdb -Wall
 
-all: driver
+# The driver outputs TAP (Test Anything Protocol), so it can also be used with
+# any TAP test harness (e.g. prove).  Set the path to your test harness here,
+# then use the `prove' target to run the tests with that harness.
+PROVE          = prove
+PROVEFLAGS     = -e ""
 
-run: all
-       ./driver
 
-test: all
-       ./driver -exit_on_fail
+ifeq ($(OS),Windows_NT)
+EXEEXT = .exe
+endif
 
-driver.o: $CLASSNAME$.o
 
-driver: driver.o
-       $(CXX) $(CXXFLAGS) $< -o $@ $(LDFLAGS) $(LDLIBS)
+all: driver$(EXEEXT)
 
 clean:
-       rm -f $CLASSNAME$.o driver.o driver
+       rm -f driver$(EXEEXT)
 
 distclean: clean
        rm -f $CLASSNAME$
 
-.PHONY: all run test clean distclean
+run: all
+       ./driver$(EXEEXT)
+
+test: all
+       ./driver$(EXEEXT) --abort-on-fail
+
+prove: all
+       $(PROVE) $(PROVEFLAGS) ./driver$(EXEEXT)
+
+
+%$(EXEEXT): %.cc
+       $(LINK.cc) $^ $(LOADLIBES) $(LDLIBS) -o $@
+
+.PHONY: all clean distclean run test prove
 
 # vim:ft=make:noet:ts=8
This page took 0.017981 seconds and 4 git commands to generate.