CC=gcc
CFLAGS=-g3 -Wall

# turns on test main routine #ifdef and sets up gcov
EXTRA_TEST_FLAGS=-DTEST_MAIN -fprofile-arcs -ftest-coverage

all:

test: testCounter
	./testCounter
	gcov counter.c

testCounter: counter.c counter.h
	# $< expands to first dependency only
	$(CC) $(CFLAGS) $(EXTRA_TEST_FLAGS) -o $@ $<

clean:
	$(RM) *.o testCounter *.gcov *.gcda *.gcno
