Have the install scripts distinguish BINDIR from SCRIPTDIR. Handy
[sgt/utils] / base64 / Makefile
CommitLineData
1166ff62 1# for `make release' and `make html'
8a48d402 2DESTDIR = .
3
1166ff62 4# for `make install'
5PREFIX = /usr/local
6BINDIR = $(PREFIX)/bin
c51c76d1 7SCRIPTDIR = $(PREFIX)/bin
1166ff62 8MANDIR = $(PREFIX)/man/man1
f6cacff9 9INSTALL = install
10IPROG =# flags for installing programs (default none)
11IDATA = -m 0644 # flags for installing data
1166ff62 12
9acadc2b 13all: base64.1 base64
14
15base64: base64.c
16 $(CC) $(CFLAGS) -o $@ $<
17
18%.1: %.but
19 halibut --man=$@ $<
20
21clean:
8a48d402 22 rm -f *.1 base64 *.html *.tar.gz
23
24html:
25 halibut --html=$(DESTDIR)/base64.html base64.but
26
27release: base64.1
28 mkdir -p reltmp/base64
29 ln -s ../../base64.c reltmp/base64
30 ln -s ../../base64.1 reltmp/base64
31 ln -s ../../base64.but reltmp/base64
32 ln -s ../../Makefile reltmp/base64
ef397e72 33 tar -C reltmp -chzf $(DESTDIR)/base64.tar.gz base64
8a48d402 34 rm -rf reltmp
1166ff62 35
36install: base64 base64.1
37 mkdir -p $(BINDIR)
f6cacff9 38 $(INSTALL) $(IPROG) base64 $(BINDIR)/base64
1166ff62 39 mkdir -p $(MANDIR)
f6cacff9 40 $(INSTALL) $(IDATA) base64.1 $(MANDIR)/base64.1