From 4595d554dc30154d46e2e6740ffb122006b2f78e Mon Sep 17 00:00:00 2001 From: "Stephen M. McQuay" Date: Wed, 2 May 2012 07:13:39 -0600 Subject: [PATCH] added a directory to copy when creating examples --- stub/Makefile | 26 ++++++++++++++++++++++++++ stub/main.cc | 13 +++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 stub/Makefile create mode 100644 stub/main.cc diff --git a/stub/Makefile b/stub/Makefile new file mode 100644 index 0000000..5ce1430 --- /dev/null +++ b/stub/Makefile @@ -0,0 +1,26 @@ +CXX=clang++ +CPPFLAGS=-Wall -g -std=c++0x +SOURCES=main.cc +OBJECTS=$(SOURCES:.cc=.o) +EXE=app + +all: $(EXE) + +main.o: main.cc + +$(EXE): $(OBJECTS) + $(CXX) $(LDFLAGS) $(OBJECTS) -o $@ + +run: $(EXE) + ./$(EXE) + +clean: + @rm -vf *.o + @rm -rvf *.dSYM + @rm -vf $(EXE) + +debug: $(EXE) + gdb $(EXE) + +valgrind: $(EXE) + valgrind --tool=memcheck --leak-check=yes ./$(EXE) diff --git a/stub/main.cc b/stub/main.cc new file mode 100644 index 0000000..1b0fe30 --- /dev/null +++ b/stub/main.cc @@ -0,0 +1,13 @@ +#include +using namespace std; + +const string usage = "usage: regex"; + +int main(int argc, char * argv []) { + if(argc != 1) { + cerr << usage << endl; + return 1; + } + cout << "hello cruel world" << endl; + return 0; +}