# memory makefile
CC = g++
SRC = Makefile readme index classpool.cpp classpool.h testmem.cpp \
leak.cpp linked.cpp noleak.cpp \
stack.cpp teststack.cpp \
thread.cpp thread.h thread.html xgmem.cpp xgmem.h
EXE = testmem xgmem stack linked leak noleak
all :: ${EXE}
noleak : noleak.cpp
$(CC) ${CFLAGS} -o noleak noleak.cpp
leak : leak.cpp
$(CC) ${CFLAGS} -o leak leak.cpp
stack : stack.cpp
$(CC) ${CFLAGS} -o stack stack.cpp
linked : linked.cpp
$(CC) ${CFLAGS} -o linked linked.cpp
testmem : testmem.cpp classpool.o
$(CC) ${CFLAGS} -o testmem testmem.cpp classpool.o
classpool.o : classpool.cpp classpool.h
$(CC) ${CFLAGS} -c classpool.cpp
# example of global memory redefined to throw an exception
xgmem : xgmem.cpp xgmem.h
$(CC) ${CFLAGS} -o xgmem xgmem.cpp
clean ::
rm *.o ${EXE} *~ memory.tgz memory.zip
dist ::
tar -zcvf memory.tgz ${SRC}
zip memory.zip ${SRC}
help :
@echo "make help screen"
@echo "targets ... purpose"
@echo ""
@echo "all ... compile everything"
@echo ".o ... compile this intermediate file"
@echo " ... classpool.o and xgmem.o"
@echo " ... compile the executable"
@echo ""
@echo "Executables: ${EXE}"
@echo ""
@echo "Source: ${SRC}"
@echo ""
@echo "clean ... delete all intermediate files"
@echo "dist ... create a tgz and zip files"
@echo ""