It's about time I brought my `nntpid' utility under version control,
[sgt/utils] / base64 / Makefile
index 44ec017..e174aa9 100644 (file)
@@ -1,3 +1,11 @@
+# for `make release' and `make html'
+DESTDIR = .
+
+# for `make install'
+PREFIX = /usr/local
+BINDIR = $(PREFIX)/bin
+MANDIR = $(PREFIX)/man/man1
+
 all: base64.1 base64
 
 base64: base64.c
@@ -7,4 +15,22 @@ base64: base64.c
        halibut --man=$@ $<
 
 clean:
-       rm -f *.1 base64
+       rm -f *.1 base64 *.html *.tar.gz
+
+html:
+       halibut --html=$(DESTDIR)/base64.html base64.but
+
+release: base64.1
+       mkdir -p reltmp/base64
+       ln -s ../../base64.c reltmp/base64
+       ln -s ../../base64.1 reltmp/base64
+       ln -s ../../base64.but reltmp/base64
+       ln -s ../../Makefile reltmp/base64
+       tar -C reltmp -chzf $(DESTDIR)/base64.tar.gz base64
+       rm -rf reltmp
+
+install: base64 base64.1
+       mkdir -p $(BINDIR)
+       install base64 $(BINDIR)/base64
+       mkdir -p $(MANDIR)
+       install -m 0644 base64.1 $(MANDIR)/base64.1