freebsd-ports/sysutils/moreutils/files/patch-Makefile
Sunpoet Po-Chuan Hsieh 87310c79cb - Support STAGEDIR
2013-10-04 15:36:36 +00:00

76 lines
1.8 KiB
Text

--- Makefile.orig 2012-06-06 01:55:53.000000000 +0800
+++ Makefile 2013-02-24 13:23:52.068205829 +0800
@@ -1,14 +1,17 @@
-BINS=isutf8 ifdata ifne pee sponge mispipe lckdo parallel errno
+BINS=isutf8 ifne pee sponge mispipe lckdo errno
PERLSCRIPTS=vidir vipe ts combine zrun chronic
-MANS=sponge.1 vidir.1 vipe.1 isutf8.1 ts.1 combine.1 ifdata.1 ifne.1 pee.1 zrun.1 chronic.1 mispipe.1 lckdo.1 parallel.1 errno.1
-CFLAGS?=-O2 -g -Wall
+MANS=sponge.1 isutf8.1 ifne.1 pee.1 mispipe.1 lckdo.1 errno.1
+CFLAGS+=-Wall
INSTALL_BIN?=install -s
-PREFIX?=/usr
-DOCBOOK2XMAN=docbook2x-man
+.SUFFIXES: .1 .docbook
+
+DOCBOOK2XMAN=${LOCALBASE}/bin/docbook2man
all: $(BINS) $(MANS)
+bins: errnos.h ${BINS}
+
clean:
rm -f $(BINS) $(MANS) dump.c errnos.h errno.o
@@ -17,44 +20,19 @@
$(INSTALL_BIN) $(BINS) $(DESTDIR)$(PREFIX)/bin
install $(PERLSCRIPTS) $(DESTDIR)$(PREFIX)/bin
- mkdir -p $(DESTDIR)$(PREFIX)/share/man/man1
- install $(MANS) $(DESTDIR)$(PREFIX)/share/man/man1
-
check: isutf8
./check-isutf8
-isutf8.1: isutf8.docbook
- $(DOCBOOK2XMAN) $<
-
-ifdata.1: ifdata.docbook
- $(DOCBOOK2XMAN) $<
-
-ifne.1: ifne.docbook
- $(DOCBOOK2XMAN) $<
-
-pee.1: pee.docbook
- $(DOCBOOK2XMAN) $<
+.docbook.1:
+ $(DOCBOOK2XMAN) ${.IMPSRC}
-sponge.1: sponge.docbook
- $(DOCBOOK2XMAN) $<
-
-mispipe.1: mispipe.docbook
- $(DOCBOOK2XMAN) $<
-
-lckdo.1: lckdo.docbook
- $(DOCBOOK2XMAN) $<
-
-parallel.1: parallel.docbook
- $(DOCBOOK2XMAN) $<
-
errno.o: errnos.h
errnos.h:
echo '#include <errno.h>' > dump.c
$(CC) -E -dD dump.c | awk '/^#define E/ { printf "{\"%s\",%s},\n", $$2, $$2 }' > errnos.h
rm -f dump.c
-errno.1: errno.docbook
- $(DOCBOOK2XMAN) $<
-
-%.1: %
- pod2man --center=" " --release="moreutils" $< > $@;
+mans: ${PERLSCRIPTS}
+.for i in ${PERLSCRIPTS}
+ pod2man --center=" " --release="moreutils" ${i} > ${i}.1
+.endfor