PATH := ..:.:${PATH}

SOURCES = $(shell ls *.c)

check:
	@echo "Testing deheader: no output is good news."
	@./setpython python2
	@-../deheader -v -v . >/tmp/regress
	@diff -u regress.chk /tmp/regress
	@./setpython python3
	@-../deheader -v -v . >/tmp/regress
	@diff -u regress.chk /tmp/regress
	@./setpython python
	@rm /tmp/regress 
checkfile:
	@-../deheader -v -v . >regress.chk

refine:
	for x in $(SOURCES); do echo "$$x"; ../deheader $$x || exit 1; done

# Verify that the test sources build correctly when unaltered
verify:
	for x in $(SOURCES:.c=.o); do make CFLAGS='-Werror -Wfatal-errors' $$x; done

clean:
	rm -f *.o *~
