(install-exec-hook): If hard links fail, try symlinks.
[debian/gzip] / Makefile.am
1 # Make gzip (GNU zip).
2
3 ## Copyright 1999 Free Software Foundation
4
5 ## This program is free software; you can redistribute it and/or modify
6 ## it under the terms of the GNU General Public License as published by
7 ## the Free Software Foundation; either version 2, or (at your option)
8 ## any later version.
9
10 ## This program is distributed in the hope that it will be useful,
11 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 ## GNU General Public License for more details.
14
15 ## You should have received a copy of the GNU General Public License
16 ## along with this program; if not, write to the Free Software
17 ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
18 ## 02111-1307, USA.
19
20 AUTOMAKE_OPTIONS = gnits dist-shar
21
22 man_MANS = gunzip.1 gzexe.1 gzip.1 \
23   zcat.1 zcmp.1 zdiff.1 zforce.1 zgrep.1 zless.1 zmore.1 znew.1
24
25 # The following hack works around a bug in automake 1.4.
26 M4DIR = $(srcdir)/m4
27 ACINCLUDE_INPUTS = \
28   $(M4DIR)/ccstdc.m4 $(M4DIR)/isc-posix.m4 $(M4DIR)/largefile.m4
29 $(srcdir)/acinclude.m4 : $(ACINCLUDE_INPUTS)
30         cat $(ACINCLUDE_INPUTS) >$(srcdir)/acinclude.m4
31
32 EXTRA_DIST = $(ACINCLUDE_INPUTS) $(man_MANS) \
33   algorithm.doc amiga/match.a amiga/Makefile.gcc amiga/Makefile.sasc \
34   amiga/tailor.c amiga/utime.h atari/Makefile.st crypt.h getopt.h \
35   gzexe.in gzip.doc gzip.h lzw.h msdos/match.asm msdos/tailor.c \
36   msdos/gzip.prj msdos/doturboc.bat msdos/Makefile.msc msdos/Makefile.bor \
37   msdos/Makefile.djg nt/Makefile.nt os2/gzip.def os2/Makefile.os2 \
38   os2/gzip16.def primos/include/errno.h primos/include/fcntl.h \
39   primos/include/stdlib.h primos/include/sysStat.h \
40   primos/include/sysTypes.h primos/build.cpl primos/readme \
41   primos/primos.c primos/ci.opts revision.h sample/makecrc.c \
42   sample/ztouch sample/add.c sample/sub.c sample/zread.c sample/zfile \
43   tailor.h vms/Makefile.mms vms/gzip.hlp vms/vms.c vms/Readme.vms \
44   vms/Makefile.vms vms/Makefile.gcc vms/makegzip.com zdiff.in \
45   zforce.in zgrep.in zless.in zmore.in znew.in
46
47 bin_PROGRAMS = gzip
48 bin_SCRIPTS = gzexe zdiff zgrep zforce zless zmore znew
49 gzip_SOURCES = \
50   bits.c crypt.c deflate.c getopt.c getopt1.c gzip.c inflate.c lzw.c \
51   trees.c unlzh.c unlzw.c unpack.c unzip.c util.c zip.c
52 gzip_LDADD = @LIBOBJS@
53
54 info_TEXINFOS = gzip.texi
55
56 ASCPP = @ASCPP@
57
58 match.$(OBJEXT): match.c
59         $(ASCPP) $(srcdir)/match.c >_match.s
60         $(CC) -c $(CFLAGS) _match.s
61         mv _match.$(OBJEXT) match.$(OBJEXT)
62         rm -f _match.s
63
64 gzip.doc: gzip.1
65         groff -man -Tascii $(srcdir)/gzip.1 | col -b | uniq >$@
66
67 SUFFIXES = .in
68 .in:
69         sed -e '$(SEDCMD)' -e 's|BINDIR|$(bindir)|' $(srcdir)/$@.in >$@
70         chmod a+x $@
71
72 install-exec-hook:
73         cd $(bindir) && rm -f gunzip zcat zcmp zegrep zfgrep
74         ln $(bindir)/gzip $(bindir)/gunzip || ln -s gzip $(bindir)/gunzip
75         ln $(bindir)/gzip $(bindir)/zcat || ln -s gzip $(bindir)/zcat
76         ln $(bindir)/zdiff $(bindir)/zcmp || ln -s zdiff $(bindir)/zcmp
77         ln $(bindir)/zgrep $(bindir)/zegrep || ln -s zgrep $(bindir)/zegrep
78         ln $(bindir)/zgrep $(bindir)/zfgrep || ln -s zgrep $(bindir)/zfgrep
79
80 MAINTAINERCLEANFILES = gzip.doc
81
82 MOSTLYCLEANFILES = _match.s gzexe zdiff zforce zgrep zless zmore znew