Imported Upstream version 1.3.14
[debian/gzip] / msdos / Makefile.djg
1 # Makefile for gzip (GNU zip)    -*- Indented-Text -*-
2 # Copyright (C) 1992-1993 Jean-loup Gailly and the Free Software Foundation
3 # Modified for GNUish make/MS_SH200/DJGPP 1.09+ by Eric Backus
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 3, 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., 675 Mass Ave, Cambridge, MA 02139, USA.
18
19 #### Start of system configuration section. ####
20
21 .SUFFIXES: .o
22 LONGARGS = gcc:rm
23
24 srcdir = .
25 VPATH = .
26
27 CC = gcc
28 CPP = gcc -O -E
29
30 INSTALL = install -c
31 INSTALL_PROGRAM = $(INSTALL)
32 INSTALL_DATA = $(INSTALL) -m 644
33
34 # tailor.h defines things for DJGPP so nothing is needed here
35 DEFS =
36 LIBS =
37
38 # additional assembly sources for particular systems may be required.
39 OBJA = match.o
40
41 SEDCMD = 1d
42
43 CFLAGS = -O2 -finline-functions -fomit-frame-pointer
44 LDFLAGS = -s
45
46 X=.exe
47 # For OS/2 or MSDOS, use: X=.exe
48
49 O=.o
50 # For OS/2 or MSDOS, use: O=.obj
51
52 prefix = /usr/local
53 exec_prefix = $(prefix)
54
55 bindir = $(exec_prefix)/bin
56 datadir = $(prefix)/lib
57 libdir = $(prefix)/lib
58 infodir = $(prefix)/info
59
60 # Extension (not including `.') for the installed manual page filenames.
61 manext = 1
62 # Where to install the manual pages.
63 mandir = $(prefix)/man/man$(manext)
64
65 #### End of system configuration section. ####
66
67 SHELL = /bin/sh
68
69 LOADLIBES = $(LIBS)
70
71 TAR = tar
72
73 SRCS = gzip.c zip.c deflate.c trees.c bits.c unzip.c inflate.c util.c crypt.c\
74        lzw.c unlzw.c unpack.c unlzh.c makecrc.c getopt.c match.S
75
76 OBJ1 = gzip$(O) zip$(O) deflate$(O) trees$(O) bits$(O) unzip$(O) inflate$(O) \
77        util$(O)
78 OBJ2 = crypt$(O) lzw$(O) unlzw$(O) unpack$(O) unlzh$(O) getopt$(O) $(OBJA)
79
80 HDRS = gzip.h lzw.h tailor.h revision.h crypt.h getopt.h
81
82 .c$O:
83         $(CC) -c $(DEFS) $(CFLAGS) $<
84
85 #.PHONY: default all force test check
86
87 default:  all
88 all:    gzip$X zcmp zdiff zmore znew zforce gzexe
89 force:
90
91 install: all
92         for f in gzip$X zcmp zdiff zmore znew zforce gzexe; do \
93           $(INSTALL_PROGRAM) $${f} $(bindir)/$${f}; done
94         for f in gunzip$X zcat$X ; do \
95           rm -f $(bindir)/$${f}; ln $(bindir)/gzip$X $(bindir)/$${f}; done
96         -cd $(srcdir); \
97           for f in gzip gunzip zcat zcmp zmore znew zforce gzexe; do \
98           rm -f $(mandir)/$${f}.$(manext); \
99           $(INSTALL_DATA) $${f}.1 $(mandir)/$${f}.$(manext); done
100         -cd $(srcdir); for f in gzip.info* ; do $(INSTALL_DATA) $${f} \
101           $(infodir)/$${f}; done
102
103 uninstall: force
104         -cd $(bindir); rm -f gzip$X gunzip$X zcat$X \
105           zcmp zdiff zmore znew zforce gzexe
106         -for f in gzip gunzip zcat zcmp zmore znew gzexe; do \
107           rm -f $(mandir)/$${f}.$(manext); done
108         -cd $(infodir); rm -f gzip.info*
109
110 # install all files and replace compress (not recommended)
111 install_compress: install
112         -test -f $(bindir)/compress.old || \
113           mv $(bindir)/compress$X $(bindir)/compress.old
114         ln $(bindir)/gzip$X $(bindir)/compress$X
115         rm -f $(bindir)/uncompress$X
116         ln $(bindir)/gzip$X $(bindir)/uncompress$X
117
118 test: check
119 check:  all
120         ./gzip -5 < $(srcdir)/texinfo.tex > _gztest.z
121         # Either GNUish make or MS_SH has trouble with backquotes
122         #@if test `wc -c < _gztest.z` -ne 30890; then \
123         #   echo FAILED gzip test: incorrect size; rm -f _gztest*; exit 1; \
124         #   else :; fi
125         @echo Should be 30890:\\c
126         @wc -c < _gztest.z
127         rm -f _gztest
128         ./gzip -d _gztest.z
129         @if cmp _gztest $(srcdir)/texinfo.tex; then \
130            echo gzip test OK; \
131         else \
132            echo FAILED gzip test: incorrect decompress; \
133         fi
134         rm -f _gztest*
135
136 TAGS: $(SRCS) $(HDRS)
137         cd $(srcdir); etags $(SRCS) $(HDRS)
138
139 Makefile: Makefile.in ./config.status
140         ./config.status
141
142 ./config.status: configure
143         $(srcdir)/configure --srcdir=$(srcdir) --no-create
144
145 configure: configure.in
146         @echo Warning: configure is out of date
147 #       cd $(srcdir); autoconf
148
149 clean:
150         rm -f *$O gzip$X gunzip$X zcat$X a.out core gzip
151         rm -f zcmp zdiff zmore znew zforce gzexe _gztest*
152         rm -f *.aux *.cp *.cps *.dvi *.fn *.fns *.ky *.kys *.log
153         rm -f *.pg *.pgs *.toc *.tp *.tps *.vr *.vrs
154
155 mostlyclean: clean
156
157 distclean: clean
158         rm -f Makefile config.status
159
160 realclean: distclean
161         rm -f TAGS gzip.info*
162
163 # Actual build-related targets
164
165 gzip$X: gzip
166         aout2exe gzip
167
168 gzip:   $(OBJ1) $(OBJ2)
169         echo $(OBJ1) > gzip.rsp
170         echo $(OBJ2) $(LIBS) >> gzip.rsp
171         $(CC) $(LDFLAGS) -o $@ @gzip.rsp
172         del gzip.rsp
173
174 gzip$O zip$O deflate$O trees$O bits$O unzip$O inflate$O: gzip.h tailor.h
175 util$O lzw$O unlzw$O unpack$O unlzh$O crypt$O: gzip.h tailor.h
176
177 gzip$O unlzw$O: revision.h lzw.h
178
179 bits$O unzip$O util$O zip$O: crypt.h
180
181 gzip$O getopt$O: getopt.h
182
183 match$O: match.S
184         $(CC) -c match.S
185
186 zcmp: zcmp.in
187         sed "$(SEDCMD)" $(srcdir)/zcmp.in > zcmp
188         chmod 755 zcmp
189
190 zdiff: zdiff.in
191         sed "$(SEDCMD)" $(srcdir)/zdiff.in > zdiff
192         chmod 755 zdiff
193
194 zmore: zmore.in
195         sed "$(SEDCMD)" $(srcdir)/zmore.in > zmore
196         chmod 755 zmore
197
198 znew: znew.in
199         sed "$(SEDCMD)" $(srcdir)/znew.in > znew
200         chmod 755 znew
201
202 zforce: zforce.in
203         sed "$(SEDCMD)" $(srcdir)/zforce.in > zforce
204         chmod 755 zforce
205
206 gzexe: gzexe.in
207         sed "$(SEDCMD)" $(srcdir)/gzexe.in > gzexe
208         chmod 755 gzexe
209
210 gzip.info: gzip.texi
211         cd $(srcdir); makeinfo gzip.texi
212
213 gzip.dvi: gzip.texi
214         cd $(srcdir); texi2dvi gzip.texi
215
216 gzip.doc: gzip.1
217         cd $(srcdir); nroff -man gzip.1 | col -b | uniq > gzip.doc
218
219 # Prevent GNU make v3 from overflowing arg limit on SysV.
220 .NOEXPORT:
221
222 # end of file