# Makefile for llist

all: check_llist_node check_llist

check_llist_node: check_llist_node.o llist_node.o
	gcc -g -o $@ $^ -lcheck

check_llist: check_llist.o llist.o llist_node.o
	gcc -g -o $@ $^ -lcheck

%.o: %.c
	gcc -g -c $^

check_llist_node.o llist_node.o: llist_node.h
check_llist.o: llist.h
llist.o: llist.h llist_node.h

clean:
	rm -rf check_llist_node check_llist
	rm -rf *.o *.gch *.dSYM

.PHONY: all

# this next line prevents `make` from deleting the .o files
.SECONDARY:
