CFLAGS=-Wall -g

FILES = *.c *.h Makefile

default: node-expt node-utest

node-utest: node.c utest.o
	$(CC) $(CFLAGS) -DUNIT_TESTS -o $@ $^

node-expt: node.c
	$(CC) $(CFLAGS) -DEXPERIMENTS -o $@ $^

list1-expt: list1.o list-expt.o node.o 
	$(CC) $(CFLAGS) -o $@ $^

.PHONY: clean
clean:
	rm -f *.o 

.PHONY: distclean
distclean: clean
	rm -f node.utest node.expt list1.expt

.PHONY: tarball
tarball: linkedlists.tar

linkedlists.tar: $(FILES)
	tar cvf $@ $(FILES)
