# nihdoc makefile CFLAGS = -g -O2 -Wall -Wpedantic -Wextra nihdoc: nihdoc.c $(CC) $(CFLAGS) -o $@ nihdoc.c .PHONY: check check: nihdoc @for f in test/*.txt; do \ printf "$$f ... "; \ base=$$(basename $$f txt)html; \ if [ -z $(GENBASE) ]; then \ ./nihdoc < $$f > /tmp/$$base; \ diff -u test/$$base /tmp/$$base; \ echo "success!"; \ else \ ./nihdoc < $$f > test/$$base; \ echo "generated!"; \ fi; \ done .PHONY: clean clean: rm -f nihdoc .PHONY: install install: nihdoc mkdir -p $(HOME)/bin $(HOME)/share/man/man1 install -m 555 nihdoc $(HOME)/bin install -m 444 nihdoc.1 $(HOME)/share/man/man1