The base/count bounds checking was insufficient, leading to a kernel memory
[dragonfly.git] / contrib / patch / Makefile.in
1 # Makefile for GNU patch.
2 # Copyright 1993, 1997 Free Software Foundation, Inc.
3
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2, or (at your option)
7 # any later version.
8
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 # GNU General Public License for more details.
13
14 # You should have received a copy of the GNU General Public License
15 # along with this program; see the file COPYING.
16 # If not, write to the Free Software Foundation,
17 # 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
18
19 #### Start of system configuration section. ####
20
21 srcdir = @srcdir@
22 VPATH = @srcdir@
23
24 @SET_MAKE@
25
26 CC = @CC@
27 ed_PROGRAM = @ed_PROGRAM@
28 INSTALL = @INSTALL@
29 INSTALL_PROGRAM = @INSTALL_PROGRAM@
30 INSTALL_DATA = @INSTALL_DATA@
31 transform = @program_transform_name@
32
33 CFLAGS = @CFLAGS@
34 CPPFLAGS = @CPPFLAGS@
35 DEFS = @DEFS@
36 LDFLAGS = @LDFLAGS@
37 LIBOBJS = @LIBOBJS@
38 LIBS = @LIBS@
39 PACKAGE = @PACKAGE@
40 VERSION = @VERSION@
41
42 prefix = @prefix@
43 exec_prefix = @exec_prefix@
44
45 bindir = $(exec_prefix)/bin
46
47 # Where to put the manual pages.
48 man1dir = $(prefix)/man/man1
49 # Extension (including `.') for the manual page filenames.
50 man1ext = .1
51
52 # Hook for nonstandard builds.
53 CONFIG_STATUS = config.status
54
55 #### End of system configuration section. ####
56
57 SHELL = /bin/sh
58
59 LIBSRCS = getopt.c getopt1.c memchr.c rename.c
60 SRCS = addext.c argmatch.c backupfile.c basename.c inp.c maketime.c \
61         partime.c patch.c pch.c quotearg.c util.c version.c $(LIBSRCS)
62 OBJS = addext.o argmatch.o backupfile.o basename.o inp.o maketime.o \
63         partime.o patch.o pch.o quotearg.o util.o version.o $(LIBOBJS)
64 HDRS = argmatch.h backupfile.h common.h getopt.h \
65         inp.h maketime.h partime.h pch.h quotearg.h util.h version.h
66 MISC = COPYING ChangeLog INSTALL Makefile.in NEWS README \
67         acconfig.h config.hin configure configure.in \
68         install-sh mkinstalldirs patch.man
69 DISTFILES = $(MISC) $(SRCS) $(HDRS)
70 DISTFILES_PC = pc/chdirsaf.c
71 DISTFILES_PC_DJGPP = pc/djgpp/README pc/djgpp/config.sed \
72         pc/djgpp/configure.bat pc/djgpp/configure.sed
73
74 patch_name = `echo patch | sed '$(transform)'`
75
76 all:: patch
77
78 info::
79 check::
80 installcheck::
81
82 COMPILE = $(CC) -c $(CPPFLAGS) $(DEFS) -Ded_PROGRAM=\"$(ed_PROGRAM)\" \
83         -I. -I$(srcdir) $(CFLAGS)
84
85 .c.o:
86         $(COMPILE) $<
87
88 patch: $(OBJS)
89         $(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(OBJS) $(LIBS)
90
91 install:: all installdirs
92         $(INSTALL_PROGRAM) patch $(bindir)/$(patch_name)
93         -$(INSTALL_DATA) $(srcdir)/patch.man $(man1dir)/$(patch_name)$(man1ext)
94
95 installdirs::
96         $(SHELL) $(srcdir)/mkinstalldirs $(bindir) $(man1dir)
97
98 install-strip::
99         $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' install
100
101 uninstall::
102         rm -f $(bindir)/$(patch_name) $(man1dir)/$(patch_name)$(man1ext)
103
104 Makefile: Makefile.in $(CONFIG_STATUS)
105         $(SHELL) $(CONFIG_STATUS)
106 config.status: configure
107         $(SHELL) $(CONFIG_STATUS) --recheck
108 configure: configure.in
109         cd $(srcdir) && autoconf
110 config.hin: configure.in acconfig.h
111         cd $(srcdir) && rm -f config.hin && autoheader
112
113 patchlevel.h: Makefile
114         echo '#define PATCH_VERSION "$(VERSION)"' >patchlevel.h
115
116 TAGS: $(HDRS) patchlevel.h $(SRCS)
117         etags $(HDRS) patchlevel.h $(SRCS)
118
119 clean::
120         rm -f patch core* *core *.o
121
122 mostlyclean:: clean
123
124 distclean:: clean
125         rm -f Makefile config.cache config.log config.status config.h
126         rm -f patchlevel.h
127
128 maintainer-clean::
129         @echo "This command is intended for maintainers to use;"
130         @echo "rebuilding the deleted files requires special tools."
131         $(MAKE) distclean
132         rm -f TAGS
133
134 PV = $(PACKAGE)-$(VERSION)
135
136 dist:: $(DISTFILES) $(DISTFILES_PC) $(DISTFILES_PC_DJGPP)
137         rm -rf $(PV)
138         mkdir $(PV) $(PV)/pc $(PV)/pc/djgpp
139         cp -p $(DISTFILES) $(PV)
140         cp -p $(DISTFILES_PC) $(PV)/pc
141         cp -p $(DISTFILES_PC_DJGPP) $(PV)/pc/djgpp
142         tar -chf - $(PV) | gzip -9 >$(PV).tar.gz
143         rm -rf $(PV)
144
145 $(OBJS): config.h
146 addext.o: backupfile.h
147 argmatch.o: argmatch.h
148 backupfile.o: argmatch.h backupfile.h
149 basename.o: backupfile.h
150 getopt.o getopt1.o: getopt.h
151 maketime.o: maketime.h partime.h
152 inp.o: backupfile.h common.h inp.h pch.h util.h
153 partime.o: partime.h
154 patch.o: argmatch.h backupfile.h common.h getopt.h inp.h pch.h util.h version.h
155 pch.o: common.h inp.h pch.h util.h
156 quotearg.o: quotearg.h
157 util.o: backupfile.h common.h maketime.h partime.h quotearg.h util.h version.h
158 version.o: common.h patchlevel.h util.h version.h