CC=g++ CCFLAGS=-Wall -std=gnu++0x -g -O0 ENABLE_MOVE=-D _USE_MOVE DISABLE_OPT= -fno-elide-constructors TARGETS=example example-sub example-test #---------------------------------------------------------------------- # run/check without enabling the move operations or constructor ellision example-sub: example-sub.h example-sub.cc example-main.cc $(CC) $(CCFLAGS) -fno-elide-constructors -o $@ example-sub.cc example-main.cc run: example-sub ./example-sub check: example-sub valgrind ./example-sub #---------------------------------------------------------------------- # run/check without enabling the move operations or constructor ellision example-move: example-sub.h example-sub.cc example-main.cc $(CC) $(CCFLAGS) ${ENABLE_MOVE} ${DISABLE_OPT} -o $@ example-sub.cc example-main.cc run-move: example-move ./example-move check-move: example-move valgrind ./example-move #---------------------------------------------------------------------- # run/check with move operations and allowing construcgor elision # this target doesn't use -fno-elide-constructors example-opt: example-sub.h example-sub.cc example-main.cc $(CC) $(CCFLAGS) ${ENABLE_MOVE} -o $@ example-sub.cc example-main.cc run-opt: example-opt ./example-opt check-opt: example-opt valgrind ./exxample-opt #---------------------------------------------------------------------- ps: example-sub make run >run.txt enscript -E -r -C -o outfile.ps run.txt makefile example-main.cc example-sub.h example-sub.cc clean: rm -f *.o *~ example-sub example-move example-opt