aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile16
1 files changed, 13 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index b9a7829..e24cb3a 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,14 @@
-SOURCES=$(wildcard *.go) $(wildcard */*.go)
+SOURCES=$(wildcard *.go) $(wildcard cmd/*.go)
NAME=wx
-BINDIR=/usr/bin
+PREFIX?=/usr/local
+BINDIR=$(PREFIX)/bin
+MANDIR=$(PREFIX)/share/man
+
+.PHONY: all
+all: $(NAME) $(NAME).1
+
+$(NAME).1: doc/$(NAME).1.scd
+ scdoc < $< > $@
$(NAME): $(SOURCES)
go build -o $(NAME) .
@@ -8,7 +16,9 @@ $(NAME): $(SOURCES)
.PHONY: clean
clean:
rm -f $(NAME)
+ rm -f $(NAME).1
.PHONY: install
-install:
+install: $(NAME) $(NAME).1
install -m755 $(NAME) $(BINDIR)
+ install -m644 $(NAME).1 $(MANDIR)/man1