summaryrefslogtreecommitdiff
path: root/Makefile.in
blob: 6c43cc58b2fe7a9097cb573df4dd01d785e84f81 (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
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
# Makefile for GNU patch.

# Copyright (C) 1993, 1997, 1998, 1999, 2001, 2002, 2003 Free Software
# Foundation, Inc.

# This program 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.

# This program 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 this program; see the file COPYING.
# If not, write to the Free Software Foundation,
# 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.

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

srcdir = @srcdir@
VPATH = @srcdir@

@SET_MAKE@

CC = @CC@
ed_PROGRAM = @ed_PROGRAM@
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
transform = @program_transform_name@

CFLAGS = @CFLAGS@
CPPFLAGS = @CPPFLAGS@
DEFS = @DEFS@
EXEEXT = @EXEEXT@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
OBJEXT = @OBJEXT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_VERSION = @PACKAGE_VERSION@

prefix = @prefix@
exec_prefix = @exec_prefix@

bindir = $(exec_prefix)/bin

# Where to put the manual pages.
mandir = @mandir@
man1dir = $(mandir)/man1
# Extension (including `.') for the manual page filenames.
man1ext = .1

# Hook for nonstandard builds.
CONFIG_STATUS = config.status

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

SHELL = /bin/sh

LIBSRCS = error.c malloc.c memchr.c mkdir.c \
	realloc.c rmdir.c strcasecmp.c strncasecmp.c
SRCS = $(LIBSRCS) \
	addext.c argmatch.c backupfile.c \
	basename.c dirname.c \
	getopt.c getopt1.c inp.c \
	maketime.c partime.c \
	patch.c pch.c \
	quote.c quotearg.c quotesys.c \
	util.c version.c xmalloc.c
OBJS = $(LIBOBJS) \
	addext.$(OBJEXT) argmatch.$(OBJEXT) backupfile.$(OBJEXT) \
	basename.$(OBJEXT) dirname.$(OBJEXT) \
	getopt.$(OBJEXT) getopt1.$(OBJEXT) inp.$(OBJEXT) \
	maketime.$(OBJEXT) partime.$(OBJEXT) \
	patch.$(OBJEXT) pch.$(OBJEXT) \
	quote.$(OBJEXT) quotearg.$(OBJEXT) quotesys.$(OBJEXT) \
	util.$(OBJEXT) version.$(OBJEXT) xmalloc.$(OBJEXT)
HDRS = argmatch.h backupfile.h common.h dirname.h \
	error.h getopt.h gettext.h \
	inp.h maketime.h partime.h pch.h \
	quote.h quotearg.h quotesys.h \
	unlocked-io.h util.h version.h xalloc.h
MISC = AUTHORS COPYING ChangeLog INSTALL Makefile.in NEWS README \
	aclocal.m4 \
	config.hin configure configure.ac \
	install-sh mkinstalldirs patch.man stdbool.h.in
DISTFILES = $(MISC) $(SRCS) $(HDRS)
DISTFILES_M4 = $(ACINCLUDE_INPUTS)
DISTFILES_PC = pc/chdirsaf.c
DISTFILES_PC_DJGPP = pc/djgpp/README pc/djgpp/config.sed \
	pc/djgpp/configure.bat pc/djgpp/configure.sed

patch_name = `echo patch | sed '$(transform)'`

all:: patch$(EXEEXT)

info::
check::
installcheck::

COMPILE = $(CC) -c $(CPPFLAGS) $(DEFS) -Ded_PROGRAM=\"$(ed_PROGRAM)\" \
	-I. -I$(srcdir) $(CFLAGS)

.c.$(OBJEXT):
	$(COMPILE) $<

patch$(EXEEXT): $(OBJS)
	$(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(OBJS) $(LIBS)

install:: all installdirs
	$(INSTALL_PROGRAM) patch$(EXEEXT) $(bindir)/$(patch_name)$(EXEEXT)
	-$(INSTALL_DATA) $(srcdir)/patch.man $(man1dir)/$(patch_name)$(man1ext)

installdirs::
	$(SHELL) $(srcdir)/mkinstalldirs $(bindir) $(man1dir)

install-strip::
	$(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' install

uninstall::
	rm -f $(bindir)/$(patch_name)$(EXEEXT)
	rm -f $(man1dir)/$(patch_name)$(man1ext)

Makefile: Makefile.in $(CONFIG_STATUS)
	$(SHELL) $(CONFIG_STATUS)
config.status: configure
	$(SHELL) $(CONFIG_STATUS) --recheck
configure: configure.ac $(srcdir)/aclocal.m4
	cd $(srcdir) && autoconf
config.hin: configure.ac $(srcdir)/aclocal.m4
	cd $(srcdir) && rm -f config.hin && autoheader
stdbool.h: stdbool.h.in
	sed -e 's/@''HAVE__BOOL''@/@HAVE__BOOL@/g' \
	  <$(srcdir)/stdbool.h.in >stdbool.h

M4DIR = $(srcdir)/m4
ACINCLUDE_INPUTS = \
  $(M4DIR)/backupfile.m4 \
  $(M4DIR)/d-ino.m4 \
  $(M4DIR)/dirname.m4 \
  $(M4DIR)/dos.m4 \
  $(M4DIR)/error.m4 \
  $(M4DIR)/getopt.m4 \
  $(M4DIR)/malloc.m4 \
  $(M4DIR)/mbrtowc.m4 \
  $(M4DIR)/mbstate_t.m4 \
  $(M4DIR)/memchr.m4 \
  $(M4DIR)/mkdir.m4 \
  $(M4DIR)/onceonly.m4 \
  $(M4DIR)/quote.m4 \
  $(M4DIR)/quotearg.m4 \
  $(M4DIR)/realloc.m4 \
  $(M4DIR)/rmdir.m4 \
  $(M4DIR)/setmode.m4 \
  $(M4DIR)/stdbool.m4 \
  $(M4DIR)/unlocked-io.m4 \
  $(M4DIR)/utimbuf.m4 \
  $(M4DIR)/xalloc.m4

$(srcdir)/aclocal.m4: $(ACINCLUDE_INPUTS)
	cat $(ACINCLUDE_INPUTS) >$(srcdir)/aclocal.m4

TAGS: $(HDRS) $(SRCS)
	etags $(HDRS) $(SRCS)

mostlyclean::
	rm -f core* *core *.$(OBJEXT) *_.c stdbool.h

clean:: mostlyclean
	rm -f patch$(EXEEXT)

distclean:: clean
	rm -f Makefile config.cache config.log config.status config.h

maintainer-clean::
	@echo "This command is intended for maintainers to use;"
	@echo "rebuilding the deleted files requires special tools."
	$(MAKE) distclean
	rm -f TAGS

PV = $(PACKAGE_NAME)-$(PACKAGE_VERSION)

dist:: $(DISTFILES) $(DISTFILES_M4) $(DISTFILES_PC) $(DISTFILES_PC_DJGPP)
	rm -rf $(PV)
	mkdir $(PV) $(PV)/m4 $(PV)/pc $(PV)/pc/djgpp
	cp -p $(DISTFILES) $(PV)
	cp -p $(DISTFILES_M4) $(PV)/m4
	cp -p $(DISTFILES_PC) $(PV)/pc
	cp -p $(DISTFILES_PC_DJGPP) $(PV)/pc/djgpp
	tar -chf - $(PV) | gzip -9 >$(PV).tar.gz
	rm -rf $(PV)

$(OBJS): config.h
COMMON = common.h @STDBOOL_H@
addext.$(OBJEXT): backupfile.h dirname.h
argmatch.$(OBJEXT): argmatch.h gettext.h error.h \
	quote.h quotearg.h unlocked-io.h
backupfile.$(OBJEXT): argmatch.h backupfile.h dirname.h
basename.$(OBJEXT): dirname.h
dirname.$(OBJEXT): dirname.h xalloc.h
error.$(OBJEXT): error.h gettext.h unlocked-io.h
getopt.$(OBJEXT) getopt1.$(OBJEXT): getopt.h
inp.$(OBJEXT): backupfile.h $(COMMON) inp.h pch.h quotearg.h util.h xalloc.h
maketime.$(OBJEXT): maketime.h partime.h
mkdir.$(OBJEXT): dirname.h xalloc.h
partime.$(OBJEXT): partime.h
patch.$(OBJEXT): argmatch.h backupfile.h $(COMMON) getopt.h inp.h \
	pch.h quotearg.h util.h version.h xalloc.h
pch.$(OBJEXT): backupfile.h $(COMMON) dirname.h inp.h pch.h quotearg.h util.h
quote.$(OBJECT): quote.h quotearg.h
quotearg.$(OBJEXT): gettext.h quotearg.h xalloc.h
quotesys.$(OBJEXT): quotesys.h
strncasecmp.$(OBJEXT): strcasecmp.c
util.$(OBJEXT): backupfile.h $(COMMON) dirname.h maketime.h \
	partime.h quotearg.h quotesys.h util.h version.h xalloc.h
version.$(OBJEXT): $(COMMON) version.h
xmalloc.$(OBJEXT): error.h gettext.h xalloc.h