1 # Makefile for GNU DIFF
2 # Copyright (C) 1988,1989,1991,1992,1993,1994 Free Software Foundation, Inc.
4 # This file is part of GNU DIFF.
6 # GNU DIFF is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2, or (at your option)
11 # GNU DIFF is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with GNU DIFF; see the file COPYING. If not, write to
18 # the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
20 #### Start of system configuration section. ####
27 INSTALL_PROGRAM = @INSTALL_PROGRAM@
28 INSTALL_DATA = @INSTALL_DATA@
39 # Some System V machines do not come with libPW.
40 # If this is true for you, use the GNU alloca.o here.
44 exec_prefix = @exec_prefix@
45 edit_program_name = sed '@program_transform_name@'
47 bindir = $(exec_prefix)/bin
49 infodir = $(prefix)/info
51 DEFAULT_EDITOR_PROGRAM = ed
52 DIFF_PROGRAM = $(bindir)/`echo diff | $(edit_program_name)`
53 NULL_DEVICE = /dev/null
56 #### End of system configuration section. ####
60 # The source files for all of the programs.
61 srcs=diff.c analyze.c cmpbuf.c cmpbuf.h io.c context.c ed.c normal.c ifdef.c \
62 util.c dir.c memchr.c waitpid.c \
63 version.c diff.h regex.c regex.h side.c system.h \
64 diff3.c sdiff.c cmp.c error.c xmalloc.c getopt.c getopt1.c getopt.h \
65 fnmatch.c fnmatch.h alloca.c
66 distfiles = $(srcs) README INSTALL NEWS diagmeet.note Makefile.in \
67 stamp-h.in config.hin configure configure.in COPYING ChangeLog \
68 diff.texi diff.info* texinfo.tex \
69 install-sh mkinstalldirs
71 PROGRAMS = cmp diff diff3 sdiff
75 COMPILE = $(CC) -c $(CPPFLAGS) $(DEFS) -I. -I$(srcdir) $(CFLAGS)
80 diff_o = diff.o analyze.o cmpbuf.o dir.o io.o util.o \
81 context.o ed.o ifdef.o normal.o side.o \
82 fnmatch.o getopt.o getopt1.o regex.o version.o $(ALLOCA) $(LIBOBJS)
84 $(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(diff_o) $(LIBS)
86 diff3_o = diff3.o getopt.o getopt1.o version.o $(LIBOBJS)
88 $(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(diff3_o) $(LIBS)
90 sdiff_o = sdiff.o getopt.o getopt1.o version.o $(LIBOBJS)
92 $(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(sdiff_o) $(LIBS)
94 cmp_o = cmp.o cmpbuf.o error.o getopt.o getopt1.o xmalloc.o version.o $(LIBOBJS)
96 $(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(cmp_o) $(LIBS)
100 $(MAKEINFO) $(srcdir)/diff.texi --output=$@
104 $(TEXI2DVI) $(srcdir)/diff.texi
106 $(diff_o): diff.h system.h
107 cmp.o diff3.o sdiff.o: system.h
108 context.o diff.o regex.o: regex.h
109 cmp.o diff.o diff3.o sdiff.o getopt.o getopt1.o: getopt.h
110 diff.o fnmatch.o: fnmatch.h
111 analyze.o cmpbuf.o cmp.o: cmpbuf.h
114 $(COMPILE) -DNULL_DEVICE=\"$(NULL_DEVICE)\" $(srcdir)/cmp.c
117 $(COMPILE) -DDIFF_PROGRAM=\"$(DIFF_PROGRAM)\" $(srcdir)/diff3.c
120 $(COMPILE) -DDEFAULT_EDITOR_PROGRAM=\"$(DEFAULT_EDITOR_PROGRAM)\" \
121 -DDIFF_PROGRAM=\"$(DIFF_PROGRAM)\" $(srcdir)/sdiff.c
124 $(COMPILE) -DPR_PROGRAM=\"$(PR_PROGRAM)\" $(srcdir)/util.c
130 rm -f *.o $(PROGRAMS) core
131 rm -f *.aux *.cp *.cps *.dvi *.fn *.fns *.ky *.kys *.log
132 rm -f *.pg *.pgs *.toc *.tp *.tps *.vr *.vrs
137 rm -f Makefile config.cache config.h config.log config.status stamp-h
142 install: all installdirs
143 for p in $(PROGRAMS); do \
144 $(INSTALL_PROGRAM) $$p $(bindir)/`echo $$p | $(edit_program_name)`; \
146 { test -f diff.info || cd $(srcdir); } && \
147 for f in diff.info*; do \
148 $(INSTALL_DATA) $$f $(infodir)/$$f; \
152 $(SHELL) ${srcdir}/mkinstalldirs $(bindir) $(infodir)
154 # We need more tests.
158 ./diff3 diff3 diff3 diff3
162 for p in $(PROGRAMS); do \
163 rm -f $(bindir)/`echo $$p | $(edit_program_name)`; \
165 rm -f $(infodir)/diff.info*
167 configure: configure.in
168 cd $(srcdir) && autoconf
170 # autoheader might not change config.hin.
171 config.hin: stamp-h.in
172 stamp-h.in: configure.in
173 cd $(srcdir) && autoheader
174 date > $(srcdir)/stamp-h.in
176 config.status: configure
177 ./config.status --recheck
179 # config.status might not change config.h, but it changes stamp-h.
181 stamp-h: config.hin config.status
183 Makefile: Makefile.in config.status
187 echo diffutils-`sed -e '/version_string/!d' -e 's/[^0-9]*\([0-9a-z.]*\).*/\1/' -e q version.c` > .fname
190 -ln $(distfiles) `cat .fname`
191 for file in $(distfiles); do \
192 [ -r `cat .fname`/$$file ] || cp -p $$file `cat .fname` || exit; \
194 tar -chf - `cat .fname` | gzip >`cat .fname`.tar.gz
195 rm -rf `cat .fname` .fname
197 # Prevent GNU make v3 from overflowing arg limit on SysV.