My user-friendly symlinking tool `lns' is another thing that really
[sgt/utils] / lns / Makefile
diff --git a/lns/Makefile b/lns/Makefile
new file mode 100644 (file)
index 0000000..95849b8
--- /dev/null
@@ -0,0 +1,33 @@
+# for `make release' and `make html'
+DESTDIR = .
+
+# for `make install'
+PREFIX = /usr/local
+BINDIR = $(PREFIX)/bin
+MANDIR = $(PREFIX)/man/man1
+
+all: lns.1
+
+%.1: %.but
+       halibut --man=$@ $<
+
+clean:
+       rm -f *.1 *.html *.tar.gz
+
+html:
+       halibut --html=$(DESTDIR)/lns.html lns.but
+
+release: lns.1
+       mkdir -p reltmp/lns
+       ln -s ../../lns reltmp/lns
+       ln -s ../../lns.1 reltmp/lns
+       ln -s ../../lns.but reltmp/lns
+       ln -s ../../Makefile reltmp/lns
+       tar -C reltmp -chzf $(DESTDIR)/lns.tar.gz lns
+       rm -rf reltmp
+
+install: lns.1
+       mkdir -p $(BINDIR)
+       install lns $(BINDIR)/lns
+       mkdir -p $(MANDIR)
+       install -m 0644 lns.1 $(MANDIR)/lns.1