wmutils

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

commit 9f23581ac80d8f05889277bb209a3d5e77990f01
parent 8b01e1ca3d1d35c0640ec922c86a6ace5c15a943
Author: z3bra <willy@mailoo.org>
Date:   Sun Dec 14 19:57:17 2014

Gave a proper makefile to manpages

Diffstat:
 Makefile     | 29 ++++++++++++++---------------
 config.mk    | 10 ++++++++++
 man/Makefile | 13 +++++--------
 3 files changed, 29 insertions(+), 23 deletions(-)

diff --git a/Makefile b/Makefile @@ -1,10 +1,4 @@ -PREFIX:=/usr -MANPREFIX:=$(PREFIX)/share/man - -CC := cc -LD := $(CC) -CFLAGS += -std=c99 -pedantic -Wall -Os -LDFLAGS += -lxcb +include config.mk HDR = arg.h util.h SRC = \ @@ -24,10 +18,17 @@ SRC = \ OBJ = $(SRC:.c=.o) BIN = $(SRC:.c=) +MAN = $(SRC:.c=.1.gz) .POSIX: +.SUFFIXES: .1 .1.gz + +all: binutils manpages + +binutils: $(BIN) -all: $(BIN) manpages +manpages: + cd man; $(MAKE) $(MFLAGS) $(OBJ): $(HDR) util.o @@ -39,20 +40,18 @@ $(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 + cd man; $(MAKE) $(MFLAGS) install uninstall: - @echo "uninstalling $(BIN)" - for util in $(BIN); do \ + @echo "uninstalling binaries" + @for util in $(BIN); do \ rm -f $(DESTDIR)$(PREFIX)/bin/$$util; \ done - make -C man uninstall + cd man; $(MAKE) $(MFLAGS) uninstall clean : rm -f $(OBJ) $(BIN) util.o + cd man; $(MAKE) $(MFLAGS) clean diff --git a/config.mk b/config.mk @@ -0,0 +1,10 @@ +PREFIX:=/usr +MANPREFIX:=$(PREFIX)/share/man + +CC := cc +LD := $(CC) +GZ := gzip + +CFLAGS += -std=c99 -pedantic -Wall -Os +LDFLAGS += -lxcb + diff --git a/man/Makefile b/man/Makefile @@ -1,7 +1,4 @@ -PREFIX:=/usr -MANPREFIX:=$(PREFIX)/share/man - -GZ := gzip +include ../config.mk SRC = \ pfw.1 \ @@ -26,7 +23,7 @@ MAN = $(SRC:.1=.1.gz) all: $(MAN) .1.1.gz: - @echo "GZ $@" + @echo "GZ $<" @$(GZ) -c $< > $@ install: $(MAN) @@ -34,9 +31,9 @@ install: $(MAN) cp -f $(MAN) $(DESTDIR)$(MANPREFIX)/man1/ uninstall: - @echo "removing manpages" - for util in $(MAN); do \ - rm -f $(DESTDIR)$(PREFIX)/man1/$$util; \ + @echo "uninstalling manpages" + @for page in $(MAN); do \ + rm -f $(DESTDIR)$(MANPREFIX)/man1/$$page; \ done clean :