school/cs142/smcquay/midterm2/Makefile
2016-04-06 20:45:34 -07:00

30 lines
442 B
Makefile

CXX=g++
CPPFLAGS=-Wall -g -std=c++0x
SOURCES=main.cc util.cc
OBJECTS=$(SOURCES:.cc=.o)
EXE=app
all: $(EXE) test
main.o: main.cc util.o
util.o: util.h util.cc
unittest: util.o unittest.cc
$(EXE): $(OBJECTS)
$(CXX) $(LDFLAGS) $(OBJECTS) -o $@
clean:
@rm -vf *.o
@rm -rvf *.dSYM
@rm -vf $(EXE)
@rm -vf unittest
test: unittest
./unittest
debug: $(EXE)
gdb $(EXE)
valgrind: $(EXE)
valgrind --tool=memcheck --leak-check=yes ./$(EXE)