srcdir = @srcdir@
VPATH = @srcdir@
CC = @CC@
ASCPP = @ASCPP@
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
DEFS = @DEFS@
LIBS = @LIBS@
OBJA = @OBJA@
SEDCMD = @SEDCMD@
CFLAGS = @CFLAGS@
LDFLAGS = $(CFLAGS)
G=@G@
ZCAT=@ZCAT@
X=
O=.o
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = $(prefix)/bin
scriptdir = $(bindir)
infodir = @infodir@
manext = 1
mandir = @mandir@
manlinks = ln
htmldir = $(prefix)/share/html/gzip
TEXI2HTML = texi2html
alldirs = $(bindir) $(scriptdir) $(mandir)/man$(manext) $(htmldir)
SHELL = /bin/sh
LOADLIBES = $(LIBS)
TAR = tar
SRCS = gzip.c zip.c deflate.c trees.c bits.c unzip.c inflate.c util.c crypt.c\
lzw.c unlzw.c unpack.c unlzh.c getopt.c match.S
OBJS = gzip$O zip$O deflate$O trees$O bits$O unzip$O inflate$O util$O \
crypt$O lzw$O unlzw$O unpack$O unlzh$O getopt$O $(OBJA)
HDRS = gzip.h lzw.h tailor.h revision.h crypt.h getopt.h
GENFILES = README NEWS INSTALL Makefile.in configure.in configure COPYING \
TODO THANKS ChangeLog $(SRCS) $(HDRS) zmore.in znew.in zdiff.in zgrep.in \
zforce.in gzexe.in gzip.1 zdiff.1 zgrep.1 zmore.1 znew.1 gzexe.1 zforce.1 \
gzip.doc algorithm.doc gzip.texi texinfo.tex gpl.texinfo gzip.info
sampleFILES = sample/makecrc.c sample/zread.c sample/add.c sample/sub.c \
sample/ztouch sample/zfile
msdosFILES = msdos/tailor.c msdos/match.asm msdos/gzip.prj msdos/doturboc.bat \
msdos/Makefile.msc msdos/Makefile.bor msdos/Makefile.djg
os2FILES = os2/Makefile.os2 os2/gzip.def os2/gzip16.def
ntFILES = nt/Makefile.nt
vmsFILES = vms/Readme.vms vms/Makefile.vms vms/Makefile.gcc vms/makegzip.com \
vms/Makefile.mms vms/vms.c vms/gzip.hlp
amigaFILES = amiga/Makefile.sasc amiga/Makefile.gcc amiga/tailor.c \
amiga/utime.h amiga/match.a
atariFILES = atari/Makefile.st
primosFILES = primos/readme primos/primos.c primos/ci.opts \
primos/build.cpl primos/include/errno.h primos/include/fcntl.h \
primos/include/stdlib.h primos/include/sysStat.h primos/include/sysTypes.h
DISTFILES = $(GENFILES) $(sampleFILES) $(msdosFILES) $(os2FILES) $(ntFILES)\
$(vmsFILES) $(amigaFILES) $(atariFILES) $(primosFILES)
SCRIPTS = $(G)zdiff $(G)zgrep $(G)zmore $(G)znew $(G)zforce gzexe
.c$O:
$(CC) -c $(DEFS) $(CFLAGS) $<
#.PHONY: default all force test check
default: gzip$X
all: gzip$X $(G)zdiff $(G)zgrep $(G)zmore $(G)znew $(G)zforce gzexe
force:
next:
$(MAKE) all CFLAGS="-O -bsd -DASMV" \
DEFS="-DNO_STDLIB_H -DNO_STRING_H -DNO_UTIME_H -DSYSDIR -DRETSIGTYPE=int"
next-fat:
$(MAKE) all OBJA=match-next.o \
CFLAGS="-O2 -bsd -DASMV -fno-builtin -arch m68k -arch i386" \
DEFS="-DNO_STDLIB_H -DNO_STRING_H -DNO_UTIME_H -DSYSDIR -DRETSIGTYPE=int"
match-next.o: match.S
cat $(srcdir)/match.S > match-next.s
$(CC) -arch m68k -arch i386 -c match-next.s
rm -f match-next.s
os2_gcc:
$(MAKE) all CC=gcc CFLAGS="-O -DOS2" X=".exe"
xenix_286:
$(MAKE) all CFLAGS="-LARGE -M2l"
coherent:
$(MAKE) all OBJA=match.o DEFS=\
"-DASMV -DSTDC_HEADERS=1 -DHAVE_UNISTD_H=1 -DDIRENT=1"
install: installdirs installbin installman
installbin: all
$(INSTALL_PROGRAM) gzip$X $(bindir)/gzip$X
for f in $(SCRIPTS); do \
$(INSTALL_PROGRAM) $${f} $(scriptdir)/$${f}; done
rm -f $(scriptdir)/$(G)zcmp; \
ln $(scriptdir)/$(G)zdiff $(scriptdir)/$(G)zcmp
for f in gunzip$X ungzip$X $(ZCAT)$X ; do \
rm -f $(bindir)/$${f}; done
@if echo $(DEFS) | grep GNU_STANDARD > /dev/null; then \
echo 'exec gzip -d $${1+"$$@"}' > $(bindir)/gunzip$X; \
echo 'exec gzip -dc $${1+"$$@"}' > $(bindir)/$(ZCAT)$X; \
chmod 755 $(bindir)/gunzip$X $(bindir)/$(ZCAT)$X; \
else \
ln $(bindir)/gzip$X $(bindir)/gunzip$X; \
ln $(bindir)/gzip$X $(bindir)/$(ZCAT)$X; \
fi
installman: gzip_1.html for f in gzip gunzip $(ZCAT) $(SCRIPTS) $(G)zcmp; do \
rm -f $(mandir)/man$(manext)/$${f}.$(manext); done
-cd $(srcdir); for f in gzip gzexe; do \
$(INSTALL_DATA) $${f}.1 $(mandir)/man$(manext)/$${f}.$(manext); done
-cd $(srcdir); for f in zdiff zgrep zmore znew zforce; do \
$(INSTALL_DATA) $${f}.1 $(mandir)/man$(manext)/$(G)$${f}.$(manext); done
-cd $(mandir)/man$(manext); if test $(manlinks) = so; then \
echo .so man$(manext)/gzip.$(manext) > $(ZCAT).$(manext);\
echo .so man$(manext)/$(G)zdiff.$(manext) > $(G)zcmp.$(manext);\
echo .so man$(manext)/gzip.$(manext) > gunzip.$(manext);\
chmod 644 $(ZCAT).$(manext) $(G)zcmp.$(manext) gunzip.$(manext);\
else \
ln gzip.$(manext) $(ZCAT).$(manext);\
ln $(G)zdiff.$(manext) $(G)zcmp.$(manext);\
ln gzip.$(manext) gunzip.$(manext);\
fi
for f in gzip*.html ; do $(INSTALL_DATA) $${f} \
$(htmldir)/$${f}; done
install-strip:
$(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' install
uninstall: force
-cd $(bindir); rm -f gzip$X gunzip$X $(ZCAT)$X
-cd $(scriptdir); rm -f $(SCRIPTS) $(G)zcmp
-for f in gzip gunzip $(ZCAT) $(SCRIPTS) $(G)zcmp; do \
rm -f $(mandir)/man$(manext)/$${f}.$(manext); done
-cd $(infodir); rm -f gzip.info*
-cd $(htmldir); rm -f gzip*.html
install_compress: install
-test -f $(bindir)/compress.old || \
mv $(bindir)/compress$X $(bindir)/compress.old
ln $(bindir)/gzip$X $(bindir)/compress$X
rm -f $(bindir)/uncompress$X
ln $(bindir)/gzip$X $(bindir)/uncompress$X
installdirs:
-if test ! -d $(mandir)/man$(manext); then \
mkdir -p $(mandir)/man$(manext); fi
-for dir in $(alldirs) ; do \
if test ! -d $${dir}; then \
mkdir -p $${dir}; fi; \
done
test: check
check: gzip$X
./gzip -6 < $(srcdir)/texinfo.tex > _gztest.gz
@LANG=""; export LANG; if test `wc -c < _gztest.gz` -eq 30890; then \
true; \
else \
echo FAILED gzip test: incorrect size; \
fi
rm -f _gztest
./gzip -d _gztest.gz
@if cmp _gztest $(srcdir)/texinfo.tex; then \
echo gzip test OK; \
else \
echo FAILED gzip test: incorrect decompress; \
fi
rm -f _gztest*
TAGS: $(SRCS) $(HDRS)
cd $(srcdir); etags $(SRCS) $(HDRS)
Makefile: Makefile.in ./config.status
./config.status
./config.status: configure
$(srcdir)/configure --srcdir=$(srcdir) --no-create
configure: configure.in
@echo Warning: configure is out of date
clean:
rm -f *$O gzip$X gunzip$X ungzip$X $(ZCAT)$X add$X sub$X a.out core
rm -f $(G)zcmp $(SCRIPTS) _gztest*
rm -f *.aux *.cp *.cps *.dvi *.fn *.fns *.ky *.kys *.log
rm -f *.pg *.pgs *.toc *.tp *.tps *.vr *.vrs
mostlyclean: clean
distclean: clean
rm -f Makefile config.status
realclean: distclean
rm -f TAGS gzip.info* gzip.doc
dist: $(DISTFILES) Makefile
d=gzip-`sed -e '/VERSION/!d' -e 's/[^0-9.]*\([0-9.]*\).*/\1/' \
-e q revision.h` ; \
rm -f ../$$d; \
ln -s `pwd` ../$$d; \
cd ..; \
files=""; \
for f in $(DISTFILES); do files="$$files $$d/$$f"; done; \
GZIP=-9 $(TAR) chofz $$d/$$d.tar.gz $$files; \
rm -f $$d
zipdist: $(DISTFILES) Makefile
zip -u9T gzip`sed -e '/VERSION/!d' -e 's/[^0-9.]*\([0-9.]*\).*/\1/' \
-e s/[.]//g -e q revision.h` $(DISTFILES)
gzip$X: Makefile $(OBJS)
$(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
rm -f gunzip$X $(ZCAT)$X
ln gzip$X gunzip$X
ln gzip$X $(ZCAT)$X
gzip$O zip$O deflate$O trees$O bits$O unzip$O inflate$O: gzip.h tailor.h
util$O lzw$O unlzw$O unpack$O unlzh$O crypt$O: gzip.h tailor.h
gzip$O unlzw$O: revision.h lzw.h
bits$O unzip$O util$O zip$O: crypt.h
gzip$O getopt$O: getopt.h
match$O: match.S
$(ASCPP) $(srcdir)/match.S > _match.s
$(CC) $(CFLAGS) -c _match.s
mv _match$O match$O
rm -f _match.s
$(G)zdiff: zdiff.in
sed -e "$(SEDCMD)" -e "s|BINDIR|/usr/bin/|" $< > $@
chmod 755 $@
$(G)zgrep: zgrep.in
sed -e "$(SEDCMD)" -e "s|BINDIR|/usr/bin/|" $< > $@
chmod 755 $@
$(G)zmore: zmore.in
sed -e "$(SEDCMD)" -e "s|BINDIR|/usr/bin/|" $< > $@
chmod 755 $@
$(G)znew: znew.in
sed -e "$(SEDCMD)" -e "s|BINDIR|/usr/bin/|" $< > $@
chmod 755 $@
$(G)zforce: zforce.in
sed -e "$(SEDCMD)" -e "s|BINDIR|/usr/bin/|" $< > $@
chmod 755 $@
gzexe: gzexe.in
sed -e "$(SEDCMD)" -e "s|BINDIR|/usr/bin/|" $< > $@
chmod 755 $@
gzip.info: gzip.texi
makeinfo $<
gzip.dvi: gzip.texi
texi2dvi $<
gzip_1.html: gzip.texi
$(TEXI2HTML) -split_chapter $<
gzip.doc: gzip.1
nroff -man $< | col -b | uniq > gzip.doc
.NOEXPORT: