Makefile (716B)
1 VPATH = doc 2 PREFIX ?= /usr/local 3 BINDIR ?= $(PREFIX)/bin 4 MANDIR ?= $(PREFIX)/share/man 5 GO ?= go 6 GOFLAGS ?= 7 8 TOOLS := \ 9 htmlattr \ 10 htmlindentheadings \ 11 htmlremove \ 12 htmlselect \ 13 htmltotext \ 14 htmlunwrap 15 DOCS := $(addsuffix .1, $(TOOLS)) 16 17 SRC := $(shell find . -name "*.go") 18 19 all: $(TOOLS) $(DOCS) 20 21 $(TOOLS): $(SRC) 22 $(GO) build $(GOFLAGS) entf.net/htmltools/cmd/$@ 23 24 %.1: %.1.scd 25 scdoc < $< > $@ 26 27 install: all 28 install -Dm755 $(TOOLS) -t "$(DESTDIR)$(BINDIR)" 29 install -Dm644 $(DOCS) -t "$(DESTDIR)$(MANDIR)/man1/" 30 31 uninstall: 32 -rm -- $(addprefix $(DESTDIR)$(BINDIR)/, $(TOOLS)) 33 -rm -- $(addprefix $(DESTDIR)$(MANDIR)/man1/, $(DOCS)) 34 35 clean: 36 -rm -- $(TOOLS) 37 -rm -- $(DOCS) 38 39 .PHONY: all install uninstall clean