wmutils

X windows manipulation utilities
git clone git://z3bra.org/wmutils
Log | Files | Refs | LICENSE

commit 52c9f5f258ed17fb873e054a0902f3dd3f550e4e
parent 68f9cf71d12a3d5f75818678f8fc9752012f2a78
Author: z3bra <willy@mailoo.org>
Date:   Fri Dec 12 20:22:52 2014

Makefile for manpage: install/uninstall is broken, please fix

Diffstat:
 Makefile     |  7 ++++++-
 man/Makefile | 43 +++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 49 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile @@ -27,7 +27,7 @@ BIN = $(SRC:.c=) .POSIX: -all: $(BIN) +all: $(BIN) manpages $(OBJ): $(HDR) util.o @@ -39,15 +39,20 @@ $(OBJ): $(HDR) util.o @echo "CC $<" @$(CC) -c $< -o $@ $(CFLAGS) +manpages: + make -C man + install: $(BIN) mkdir -p $(DESTDIR)$(PREFIX)/bin/ cp -f $(BIN) $(DESTDIR)$(PREFIX)/bin/ + make -C man install uninstall: @echo "uninstalling $(BIN)" for util in $(BIN); do \ rm -f $(DESTDIR)$(PREFIX)/bin/$$util; \ done + make -C man uninstall clean : rm -f $(OBJ) $(BIN) util.o diff --git a/man/Makefile b/man/Makefile @@ -0,0 +1,43 @@ +PREFIX:=/usr +MANPREFIX:=$(PREFIX)/share/man + +GZ := gzip + +SRC = \ + pfw.1 \ + lsw.1 \ + mapw.1 \ + killw.1 \ + wattr.1 \ + wtp.1 \ + wmv.1 \ + chwso.1 \ + wtf.1 \ + wrs.1 \ + chwb.1 \ + ignw.1 \ + wname.1 + +MAN = $(SRC:.1=.1.gz) + +.POSIX: +.SUFFIXES: .1 .1.gz + +all: $(MAN) + +.1.1.gz: + @echo "GZ $@" + @$(GZ) -c $< > $@ + +install: $(MAN) + mkdir -p $(DESTDIR)$(MANPREFIX)/bin/ + cp -f $(BIN) $(DESTDIR)$(MANPREFIX)/man1/ + +uninstall: + @echo "removing manpages" + for util in $(MAN); do \ + rm -f $(DESTDIR)$(PREFIX)/man1/$$util; \ + done + +clean : + rm -f $(MAN)