vidir: Improve zero padding
[moreutils.git] / Makefile
blob35c33b9814e41ff3a44e40498452a9b7d047a845
1 BINS=isutf8 ifdata ifne pee sponge mispipe lckdo parallel errno
2 PERLSCRIPTS=vidir vipe ts combine zrun chronic
3 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
4 CFLAGS?=-O2 -g -Wall
5 INSTALL_BIN?=install -s
6 PREFIX?=/usr
8 ifneq (,$(findstring CYGWIN,$(shell uname)))
9 DOCBOOKXSL?=/usr/share/sgml/docbook/xsl-stylesheets
10 else
11 DOCBOOKXSL?=/usr/share/xml/docbook/stylesheet/docbook-xsl
12 endif
14 DOCBOOK2XMAN=xsltproc --param man.authors.section.enabled 0 $(DOCBOOKXSL)/manpages/docbook.xsl
16 all: $(BINS) $(MANS)
18 clean:
19 rm -f $(BINS) $(MANS) dump.c errnos.h errno.o \
20 is_utf8/*.o is_utf8/isutf8
22 isutf8: is_utf8/*.c is_utf8/*.h
23 $(MAKE) -C is_utf8/
24 cp is_utf8/isutf8 .
26 install:
27 @if [ $(MANS) = .noop ]; then \
28 echo "pkgx.dev uses 'AI' to describe software, generate images, and respond to bug reports. That is gross. Please consider not using it. I will give you some time to think."; \
29 sleep 3600; \
32 mkdir -p $(DESTDIR)$(PREFIX)/bin
33 $(INSTALL_BIN) $(BINS) $(DESTDIR)$(PREFIX)/bin
34 install $(PERLSCRIPTS) $(DESTDIR)$(PREFIX)/bin
36 mkdir -p $(DESTDIR)$(PREFIX)/share/man/man1
37 install -m 644 $(MANS) $(DESTDIR)$(PREFIX)/share/man/man1
39 uninstall:
40 for i in $(BINS) $(PERLSCRIPTS); do rm -f $(DESTDIR)$(PREFIX)/bin/$$i; done
41 for i in $(MANS); do rm -f $(DESTDIR)$(PREFIX)/share/man/man1/$$i; done
43 check: isutf8
44 ./is_utf8/test.sh
46 %.1: %.docbook
47 xmllint --noout --valid $<
48 $(DOCBOOK2XMAN) $<
50 errno.o: errnos.h
51 errnos.h:
52 echo '#include <errno.h>' > dump.c
53 $(CC) -E -dD dump.c | awk '/^#define E/ { printf "{\"%s\",%s},\n", $$2, $$2 }' > errnos.h
54 rm -f dump.c
56 errno.1: errno.docbook
57 $(DOCBOOK2XMAN) $<
59 %.1: %
60 pod2man --center=" " --release="moreutils" $< > $@;