--- stack/Makefile 2002/03/07 03:28:29 1.5 +++ stack/Makefile 2002/03/17 12:44:02 1.12 @@ -25,19 +25,38 @@ .SUFFIXES: .SUFFIXES: .c .o + +srcdir = . ## -CFLAGS=-Wall -g +CFLAGS=-Wall -g -O0 -pg -fprofile-arcs -ftest-coverage +#CFLAGS=-Wall -g -O0 +## Linux LDFLAGS=-ldl -lmcheck -Xlinker --export-dynamic +## Other junk +#LDFLAGS=-Xlinker --export-dynamic + +all: stack TAGS + +stack stack.bb stack.bbg: stack.c stack.h + $(CC) -I$(srcdir) $(LDFLAGS) $(CFLAGS) stack.c -o stack + +check: stack + [ $(shell $(srcdir)/fib.st) = 6765 ] -all: stack +TAGS: $(shell find $(srcdir) -path $(srcdir)/CVS -prune -o -name "*.[ch]" -print) + etags $^ -stack: stack.c stack.h - $(CC) -I$(srcdir) $(CFLAGS) $(LDFLAGS) stack.c -o $@ +clean: + rm -f mtrace.log stack.bb stack.bbg stack.da stack.c.gcov stack TAGS mtrace: stack MALLOC_TRACE=mtrace.log ./stack mtrace stack mtrace.log -check: stack - [ $(shell ./fib.st) = 832040 ] +gcov: stack.c.gcov + +stack.c.gcov: stack.da + gcov $(srcdir)/stack.c + +stack.da: check