summaryrefslogtreecommitdiffstats
path: root/contrib/diff/Makefile.in
blob: e8543ad6e4f89095031202bc99a4d3245ef97cc2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
# Makefile for GNU DIFF
# Copyright (C) 1988,1989,1991,1992,1993,1994 Free Software Foundation, Inc.
#
# This file is part of GNU DIFF.
#
# GNU DIFF is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# GNU DIFF is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GNU DIFF; see the file COPYING.  If not, write to
# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.

#### Start of system configuration section. ####

srcdir = @srcdir@
VPATH = @srcdir@

CC = @CC@
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
MAKEINFO = makeinfo
TEXI2DVI = texi2dvi

CPPFLAGS = @CPPFLAGS@
DEFS = @DEFS@
CFLAGS = @CFLAGS@
LDFLAGS = @LDFLAGS@
LIBS = @LIBS@
LIBOBJS = @LIBOBJS@

# Some System V machines do not come with libPW.
# If this is true for you, use the GNU alloca.o here.
ALLOCA = @ALLOCA@

prefix = @prefix@
exec_prefix = @exec_prefix@
edit_program_name = sed '@program_transform_name@'

bindir = $(exec_prefix)/bin

infodir = $(prefix)/info

DEFAULT_EDITOR_PROGRAM = ed
DIFF_PROGRAM = $(bindir)/`echo diff | $(edit_program_name)`
NULL_DEVICE = /dev/null
PR_PROGRAM = /bin/pr

#### End of system configuration section. ####

SHELL = /bin/sh

# The source files for all of the programs.
srcs=diff.c analyze.c cmpbuf.c cmpbuf.h io.c context.c ed.c normal.c ifdef.c \
	util.c dir.c memchr.c waitpid.c \
	version.c diff.h regex.c regex.h side.c system.h \
	diff3.c sdiff.c cmp.c error.c xmalloc.c getopt.c getopt1.c getopt.h \
	fnmatch.c fnmatch.h alloca.c
distfiles = $(srcs) README INSTALL NEWS diagmeet.note Makefile.in \
	stamp-h.in config.hin configure configure.in COPYING ChangeLog \
	diff.texi diff.info* texinfo.tex \
	install-sh mkinstalldirs

PROGRAMS = cmp diff diff3 sdiff

all: $(PROGRAMS) info

COMPILE = $(CC) -c $(CPPFLAGS) $(DEFS) -I. -I$(srcdir) $(CFLAGS)

.c.o:
	$(COMPILE) $<

diff_o = diff.o analyze.o cmpbuf.o dir.o io.o util.o \
	context.o ed.o ifdef.o normal.o side.o \
	fnmatch.o getopt.o getopt1.o regex.o version.o $(ALLOCA) $(LIBOBJS)
diff: $(diff_o)
	$(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(diff_o) $(LIBS)

diff3_o = diff3.o getopt.o getopt1.o version.o $(LIBOBJS)
diff3: $(diff3_o)
	$(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(diff3_o) $(LIBS)

sdiff_o = sdiff.o getopt.o getopt1.o version.o $(LIBOBJS)
sdiff: $(sdiff_o)
	$(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(sdiff_o) $(LIBS)

cmp_o = cmp.o cmpbuf.o error.o getopt.o getopt1.o xmalloc.o version.o $(LIBOBJS)
cmp: $(cmp_o)
	$(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(cmp_o) $(LIBS)

info: diff.info
diff.info: diff.texi
	$(MAKEINFO) $(srcdir)/diff.texi --output=$@

dvi: diff.dvi
diff.dvi: diff.texi
	$(TEXI2DVI) $(srcdir)/diff.texi

$(diff_o): diff.h system.h
cmp.o diff3.o sdiff.o: system.h
context.o diff.o regex.o: regex.h
cmp.o diff.o diff3.o sdiff.o getopt.o getopt1.o: getopt.h
diff.o fnmatch.o: fnmatch.h
analyze.o cmpbuf.o cmp.o: cmpbuf.h

cmp.o: cmp.c
	$(COMPILE) -DNULL_DEVICE=\"$(NULL_DEVICE)\" $(srcdir)/cmp.c

diff3.o: diff3.c
	$(COMPILE) -DDIFF_PROGRAM=\"$(DIFF_PROGRAM)\" $(srcdir)/diff3.c

sdiff.o: sdiff.c
	$(COMPILE) -DDEFAULT_EDITOR_PROGRAM=\"$(DEFAULT_EDITOR_PROGRAM)\" \
		-DDIFF_PROGRAM=\"$(DIFF_PROGRAM)\" $(srcdir)/sdiff.c

util.o: util.c
	$(COMPILE) -DPR_PROGRAM=\"$(PR_PROGRAM)\" $(srcdir)/util.c

TAGS: $(srcs)
	etags $(srcs)

clean:
	rm -f *.o $(PROGRAMS) core
	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.cache config.h config.log config.status stamp-h

realclean: distclean
	rm -f TAGS *.info*

install: all installdirs
	for p in $(PROGRAMS); do \
	  $(INSTALL_PROGRAM) $$p $(bindir)/`echo $$p | $(edit_program_name)`; \
	done
	{ test -f diff.info || cd $(srcdir); } && \
	for f in diff.info*; do \
	  $(INSTALL_DATA) $$f $(infodir)/$$f; \
	done

installdirs:
	$(SHELL) ${srcdir}/mkinstalldirs $(bindir) $(infodir)

# We need more tests.
check:
	./cmp cmp cmp
	./diff diff diff
	./diff3 diff3 diff3 diff3
	./sdiff sdiff sdiff

uninstall:
	for p in $(PROGRAMS); do \
	  rm -f $(bindir)/`echo $$p | $(edit_program_name)`; \
	done
	rm -f $(infodir)/diff.info*

configure: configure.in
	cd $(srcdir) && autoconf

# autoheader might not change config.hin.
config.hin: stamp-h.in
stamp-h.in: configure.in
	cd $(srcdir) && autoheader
	date > $(srcdir)/stamp-h.in

config.status: configure
	./config.status --recheck

# config.status might not change config.h, but it changes stamp-h.
config.h: stamp-h
stamp-h: config.hin config.status
	./config.status
Makefile: Makefile.in config.status
	./config.status

dist: $(distfiles)
	echo diffutils-`sed -e '/version_string/!d' -e 's/[^0-9]*\([0-9a-z.]*\).*/\1/' -e q version.c` > .fname
	rm -rf `cat .fname`
	mkdir `cat .fname`
	-ln $(distfiles) `cat .fname`
	for file in $(distfiles); do \
	  [ -r `cat .fname`/$$file ] || cp -p $$file `cat .fname` || exit; \
	done
	tar -chf - `cat .fname` | gzip >`cat .fname`.tar.gz
	rm -rf `cat .fname` .fname

# Prevent GNU make v3 from overflowing arg limit on SysV.
.NOEXPORT:
OpenPOWER on IntegriCloud