
VERSION = ndoc-1.0

COPTS = -Wall

ndoc:   ndoc.c
	$(CC) $(COPTS) ndoc.c -o ndoc

clean:
	rm -f ndoc ndoc.txt test/test.out
	rm -rf dist

ndoc.txt:       ndoc.ndoc ndoc
	./ndoc -j72 -i2 -p0 <ndoc.ndoc >ndoc.txt

check:  ndoc
	( cd test ; ../ndoc -j72 -i2 -p0 <test.ndoc >test.out ; \
	  diff test.ref test.out )

#	Rebuild master against which we check.  Note that
#	this performs a check and ignores any errors.

ref:    ndoc
	-make check
	cp -p test/test.out test/test.ref

dist:
	rm -rf dist
	mkdir dist
	mkdir dist/$(VERSION)
	cp -pr ndoc.c Makefile ndoc.ndoc test dist/$(VERSION)
	rm -f dist/$(VERSION)/test/test.out
	( cd dist ; tar cfvz $(VERSION).tar.gz $(VERSION) )
	rm -rf dist/$(VERSION)
