tGave a proper makefile to manpages - wmutils - X windows manipulation utilities
(HTM) git clone git://z3bra.org/wmutils
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) commit 9f23581ac80d8f05889277bb209a3d5e77990f01
(DIR) parent 8b01e1ca3d1d35c0640ec922c86a6ace5c15a943
(HTM) Author: z3bra <willy@mailoo.org>
Date: Sun, 14 Dec 2014 19:57:17 +0100
Gave a proper makefile to manpages
Diffstat:
M Makefile | 29 ++++++++++++++---------------
A config.mk | 10 ++++++++++
M man/Makefile | 13 +++++--------
3 files changed, 29 insertions(+), 23 deletions(-)
---
(DIR) diff --git a/Makefile b/Makefile
t@@ -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 = \
t@@ -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
t@@ -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
(DIR) diff --git a/config.mk b/config.mk
t@@ -0,0 +1,10 @@
+PREFIX:=/usr
+MANPREFIX:=$(PREFIX)/share/man
+
+CC := cc
+LD := $(CC)
+GZ := gzip
+
+CFLAGS += -std=c99 -pedantic -Wall -Os
+LDFLAGS += -lxcb
+
(DIR) diff --git a/man/Makefile b/man/Makefile
t@@ -1,7 +1,4 @@
-PREFIX:=/usr
-MANPREFIX:=$(PREFIX)/share/man
-
-GZ := gzip
+include ../config.mk
SRC = \
pfw.1 \
t@@ -26,7 +23,7 @@ MAN = $(SRC:.1=.1.gz)
all: $(MAN)
.1.1.gz:
- @echo "GZ $@"
+ @echo "GZ $<"
@$(GZ) -c $< > $@
install: $(MAN)
t@@ -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 :