sponge: Fix bug in -a mode that doubled original content of file
[moreutils.git] / Makefile
blob1e92f61cafa421314e36fd80143cbcaed203182f
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 mkdir -p $(DESTDIR)$(PREFIX)/bin
28 $(INSTALL_BIN) $(BINS) $(DESTDIR)$(PREFIX)/bin
29 install $(PERLSCRIPTS) $(DESTDIR)$(PREFIX)/bin
31 mkdir -p $(DESTDIR)$(PREFIX)/share/man/man1
32 install $(MANS) $(DESTDIR)$(PREFIX)/share/man/man1
34 check: isutf8
35 ./is_utf8/test.sh
37 %.1: %.docbook
38 xmllint --noout --valid $<
39 $(DOCBOOK2XMAN) $<
41 errno.o: errnos.h
42 errnos.h:
43 echo '#include <errno.h>' > dump.c
44 $(CC) -E -dD dump.c | awk '/^#define E/ { printf "{\"%s\",%s},\n", $$2, $$2 }' > errnos.h
45 rm -f dump.c
47 errno.1: errno.docbook
48 $(DOCBOOK2XMAN) $<
50 %.1: %
51 pod2man --center=" " --release="moreutils" $< > $@;