| 1 | # Makefile for GNU patch.
 | 
|---|
| 2 | 
 | 
|---|
| 3 | # Copyright (C) 1993, 1997, 1998, 1999, 2001, 2002, 2003 Free Software
 | 
|---|
| 4 | # Foundation, Inc.
 | 
|---|
| 5 | 
 | 
|---|
| 6 | # This program 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)
 | 
|---|
| 9 | # any later version.
 | 
|---|
| 10 | 
 | 
|---|
| 11 | # This program 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.
 | 
|---|
| 15 | 
 | 
|---|
| 16 | # You should have received a copy of the GNU General Public License
 | 
|---|
| 17 | # along with this program; see the file COPYING.
 | 
|---|
| 18 | # If not, write to the Free Software Foundation,
 | 
|---|
| 19 | # 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 | 
|---|
| 20 | 
 | 
|---|
| 21 | #### Start of system configuration section. ####
 | 
|---|
| 22 | 
 | 
|---|
| 23 | srcdir = @srcdir@
 | 
|---|
| 24 | VPATH = @srcdir@
 | 
|---|
| 25 | 
 | 
|---|
| 26 | @SET_MAKE@
 | 
|---|
| 27 | 
 | 
|---|
| 28 | CC = @CC@
 | 
|---|
| 29 | ed_PROGRAM = @ed_PROGRAM@
 | 
|---|
| 30 | INSTALL = @INSTALL@
 | 
|---|
| 31 | INSTALL_PROGRAM = @INSTALL_PROGRAM@
 | 
|---|
| 32 | INSTALL_DATA = @INSTALL_DATA@
 | 
|---|
| 33 | transform = @program_transform_name@
 | 
|---|
| 34 | 
 | 
|---|
| 35 | CFLAGS = @CFLAGS@
 | 
|---|
| 36 | CPPFLAGS = @CPPFLAGS@
 | 
|---|
| 37 | DEFS = @DEFS@
 | 
|---|
| 38 | EXEEXT = @EXEEXT@
 | 
|---|
| 39 | LDFLAGS = @LDFLAGS@
 | 
|---|
| 40 | LIBOBJS = @LIBOBJS@
 | 
|---|
| 41 | LIBS = @LIBS@
 | 
|---|
| 42 | OBJEXT = @OBJEXT@
 | 
|---|
| 43 | PACKAGE_NAME = @PACKAGE_NAME@
 | 
|---|
| 44 | PACKAGE_VERSION = @PACKAGE_VERSION@
 | 
|---|
| 45 | 
 | 
|---|
| 46 | prefix = @prefix@
 | 
|---|
| 47 | exec_prefix = @exec_prefix@
 | 
|---|
| 48 | 
 | 
|---|
| 49 | bindir = $(exec_prefix)/bin
 | 
|---|
| 50 | 
 | 
|---|
| 51 | # Where to put the manual pages.
 | 
|---|
| 52 | mandir = @mandir@
 | 
|---|
| 53 | man1dir = $(mandir)/man1
 | 
|---|
| 54 | # Extension (including `.') for the manual page filenames.
 | 
|---|
| 55 | man1ext = .1
 | 
|---|
| 56 | 
 | 
|---|
| 57 | # Hook for nonstandard builds.
 | 
|---|
| 58 | CONFIG_STATUS = config.status
 | 
|---|
| 59 | 
 | 
|---|
| 60 | #### End of system configuration section. ####
 | 
|---|
| 61 | 
 | 
|---|
| 62 | SHELL = /bin/sh
 | 
|---|
| 63 | 
 | 
|---|
| 64 | LIBSRCS = error.c malloc.c memchr.c mkdir.c \
 | 
|---|
| 65 |         realloc.c rmdir.c strcasecmp.c strncasecmp.c
 | 
|---|
| 66 | SRCS = $(LIBSRCS) \
 | 
|---|
| 67 |         addext.c argmatch.c backupfile.c \
 | 
|---|
| 68 |         basename.c dirname.c \
 | 
|---|
| 69 |         getopt.c getopt1.c inp.c \
 | 
|---|
| 70 |         maketime.c partime.c \
 | 
|---|
| 71 |         patch.c pch.c \
 | 
|---|
| 72 |         quote.c quotearg.c quotesys.c \
 | 
|---|
| 73 |         util.c version.c xmalloc.c
 | 
|---|
| 74 | OBJS = $(LIBOBJS) \
 | 
|---|
| 75 |         addext.$(OBJEXT) argmatch.$(OBJEXT) backupfile.$(OBJEXT) \
 | 
|---|
| 76 |         basename.$(OBJEXT) dirname.$(OBJEXT) \
 | 
|---|
| 77 |         getopt.$(OBJEXT) getopt1.$(OBJEXT) inp.$(OBJEXT) \
 | 
|---|
| 78 |         maketime.$(OBJEXT) partime.$(OBJEXT) \
 | 
|---|
| 79 |         patch.$(OBJEXT) pch.$(OBJEXT) \
 | 
|---|
| 80 |         quote.$(OBJEXT) quotearg.$(OBJEXT) quotesys.$(OBJEXT) \
 | 
|---|
| 81 |         util.$(OBJEXT) version.$(OBJEXT) xmalloc.$(OBJEXT)
 | 
|---|
| 82 | HDRS = argmatch.h backupfile.h common.h dirname.h \
 | 
|---|
| 83 |         error.h getopt.h gettext.h \
 | 
|---|
| 84 |         inp.h maketime.h partime.h pch.h \
 | 
|---|
| 85 |         quote.h quotearg.h quotesys.h \
 | 
|---|
| 86 |         unlocked-io.h util.h version.h xalloc.h
 | 
|---|
| 87 | MISC = AUTHORS COPYING ChangeLog INSTALL Makefile.in NEWS README \
 | 
|---|
| 88 |         aclocal.m4 \
 | 
|---|
| 89 |         config.hin configure configure.ac \
 | 
|---|
| 90 |         install-sh mkinstalldirs patch.man stdbool.h.in
 | 
|---|
| 91 | DISTFILES = $(MISC) $(SRCS) $(HDRS)
 | 
|---|
| 92 | DISTFILES_M4 = $(ACINCLUDE_INPUTS)
 | 
|---|
| 93 | DISTFILES_PC = pc/chdirsaf.c
 | 
|---|
| 94 | DISTFILES_PC_DJGPP = pc/djgpp/README pc/djgpp/config.sed \
 | 
|---|
| 95 |         pc/djgpp/configure.bat pc/djgpp/configure.sed
 | 
|---|
| 96 | 
 | 
|---|
| 97 | patch_name = `echo patch | sed '$(transform)'`
 | 
|---|
| 98 | 
 | 
|---|
| 99 | all:: patch$(EXEEXT)
 | 
|---|
| 100 | 
 | 
|---|
| 101 | info::
 | 
|---|
| 102 | check::
 | 
|---|
| 103 | installcheck::
 | 
|---|
| 104 | 
 | 
|---|
| 105 | COMPILE = $(CC) -c $(CPPFLAGS) $(DEFS) -Ded_PROGRAM=\"$(ed_PROGRAM)\" \
 | 
|---|
| 106 |         -I. -I$(srcdir) $(CFLAGS)
 | 
|---|
| 107 | 
 | 
|---|
| 108 | .c.$(OBJEXT):
 | 
|---|
| 109 |         $(COMPILE) $<
 | 
|---|
| 110 | 
 | 
|---|
| 111 | patch$(EXEEXT): $(OBJS)
 | 
|---|
| 112 |         $(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(OBJS) $(LIBS)
 | 
|---|
| 113 | 
 | 
|---|
| 114 | install:: all installdirs
 | 
|---|
| 115 |         $(INSTALL_PROGRAM) patch$(EXEEXT) $(bindir)/$(patch_name)$(EXEEXT)
 | 
|---|
| 116 |         -$(INSTALL_DATA) $(srcdir)/patch.man $(man1dir)/$(patch_name)$(man1ext)
 | 
|---|
| 117 | 
 | 
|---|
| 118 | installdirs::
 | 
|---|
| 119 |         $(SHELL) $(srcdir)/mkinstalldirs $(bindir) $(man1dir)
 | 
|---|
| 120 | 
 | 
|---|
| 121 | install-strip::
 | 
|---|
| 122 |         $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' install
 | 
|---|
| 123 | 
 | 
|---|
| 124 | uninstall::
 | 
|---|
| 125 |         rm -f $(bindir)/$(patch_name)$(EXEEXT)
 | 
|---|
| 126 |         rm -f $(man1dir)/$(patch_name)$(man1ext)
 | 
|---|
| 127 | 
 | 
|---|
| 128 | Makefile: Makefile.in $(CONFIG_STATUS)
 | 
|---|
| 129 |         $(SHELL) $(CONFIG_STATUS)
 | 
|---|
| 130 | config.status: configure
 | 
|---|
| 131 |         $(SHELL) $(CONFIG_STATUS) --recheck
 | 
|---|
| 132 | configure: configure.ac $(srcdir)/aclocal.m4
 | 
|---|
| 133 |         cd $(srcdir) && autoconf
 | 
|---|
| 134 | config.hin: configure.ac $(srcdir)/aclocal.m4
 | 
|---|
| 135 |         cd $(srcdir) && rm -f config.hin && autoheader
 | 
|---|
| 136 | stdbool.h: stdbool.h.in
 | 
|---|
| 137 |         sed -e 's/@''HAVE__BOOL''@/@HAVE__BOOL@/g' \
 | 
|---|
| 138 |           <$(srcdir)/stdbool.h.in >stdbool.h
 | 
|---|
| 139 | 
 | 
|---|
| 140 | M4DIR = $(srcdir)/m4
 | 
|---|
| 141 | ACINCLUDE_INPUTS = \
 | 
|---|
| 142 |   $(M4DIR)/backupfile.m4 \
 | 
|---|
| 143 |   $(M4DIR)/d-ino.m4 \
 | 
|---|
| 144 |   $(M4DIR)/dirname.m4 \
 | 
|---|
| 145 |   $(M4DIR)/dos.m4 \
 | 
|---|
| 146 |   $(M4DIR)/error.m4 \
 | 
|---|
| 147 |   $(M4DIR)/getopt.m4 \
 | 
|---|
| 148 |   $(M4DIR)/malloc.m4 \
 | 
|---|
| 149 |   $(M4DIR)/mbrtowc.m4 \
 | 
|---|
| 150 |   $(M4DIR)/mbstate_t.m4 \
 | 
|---|
| 151 |   $(M4DIR)/memchr.m4 \
 | 
|---|
| 152 |   $(M4DIR)/mkdir.m4 \
 | 
|---|
| 153 |   $(M4DIR)/onceonly.m4 \
 | 
|---|
| 154 |   $(M4DIR)/quote.m4 \
 | 
|---|
| 155 |   $(M4DIR)/quotearg.m4 \
 | 
|---|
| 156 |   $(M4DIR)/realloc.m4 \
 | 
|---|
| 157 |   $(M4DIR)/rmdir.m4 \
 | 
|---|
| 158 |   $(M4DIR)/setmode.m4 \
 | 
|---|
| 159 |   $(M4DIR)/stdbool.m4 \
 | 
|---|
| 160 |   $(M4DIR)/unlocked-io.m4 \
 | 
|---|
| 161 |   $(M4DIR)/utimbuf.m4 \
 | 
|---|
| 162 |   $(M4DIR)/xalloc.m4
 | 
|---|
| 163 | 
 | 
|---|
| 164 | $(srcdir)/aclocal.m4: $(ACINCLUDE_INPUTS)
 | 
|---|
| 165 |         cat $(ACINCLUDE_INPUTS) >$(srcdir)/aclocal.m4
 | 
|---|
| 166 | 
 | 
|---|
| 167 | TAGS: $(HDRS) $(SRCS)
 | 
|---|
| 168 |         etags $(HDRS) $(SRCS)
 | 
|---|
| 169 | 
 | 
|---|
| 170 | mostlyclean::
 | 
|---|
| 171 |         rm -f core* *core *.$(OBJEXT) *_.c stdbool.h
 | 
|---|
| 172 | 
 | 
|---|
| 173 | clean:: mostlyclean
 | 
|---|
| 174 |         rm -f patch$(EXEEXT)
 | 
|---|
| 175 | 
 | 
|---|
| 176 | distclean:: clean
 | 
|---|
| 177 |         rm -f Makefile config.cache config.log config.status config.h
 | 
|---|
| 178 | 
 | 
|---|
| 179 | maintainer-clean::
 | 
|---|
| 180 |         @echo "This command is intended for maintainers to use;"
 | 
|---|
| 181 |         @echo "rebuilding the deleted files requires special tools."
 | 
|---|
| 182 |         $(MAKE) distclean
 | 
|---|
| 183 |         rm -f TAGS
 | 
|---|
| 184 | 
 | 
|---|
| 185 | PV = $(PACKAGE_NAME)-$(PACKAGE_VERSION)
 | 
|---|
| 186 | 
 | 
|---|
| 187 | dist:: $(DISTFILES) $(DISTFILES_M4) $(DISTFILES_PC) $(DISTFILES_PC_DJGPP)
 | 
|---|
| 188 |         rm -rf $(PV)
 | 
|---|
| 189 |         mkdir $(PV) $(PV)/m4 $(PV)/pc $(PV)/pc/djgpp
 | 
|---|
| 190 |         cp -p $(DISTFILES) $(PV)
 | 
|---|
| 191 |         cp -p $(DISTFILES_M4) $(PV)/m4
 | 
|---|
| 192 |         cp -p $(DISTFILES_PC) $(PV)/pc
 | 
|---|
| 193 |         cp -p $(DISTFILES_PC_DJGPP) $(PV)/pc/djgpp
 | 
|---|
| 194 |         tar -chf - $(PV) | gzip -9 >$(PV).tar.gz
 | 
|---|
| 195 |         rm -rf $(PV)
 | 
|---|
| 196 | 
 | 
|---|
| 197 | $(OBJS): config.h
 | 
|---|
| 198 | COMMON = common.h @STDBOOL_H@
 | 
|---|
| 199 | addext.$(OBJEXT): backupfile.h dirname.h
 | 
|---|
| 200 | argmatch.$(OBJEXT): argmatch.h gettext.h error.h \
 | 
|---|
| 201 |         quote.h quotearg.h unlocked-io.h
 | 
|---|
| 202 | backupfile.$(OBJEXT): argmatch.h backupfile.h dirname.h
 | 
|---|
| 203 | basename.$(OBJEXT): dirname.h
 | 
|---|
| 204 | dirname.$(OBJEXT): dirname.h xalloc.h
 | 
|---|
| 205 | error.$(OBJEXT): error.h gettext.h unlocked-io.h
 | 
|---|
| 206 | getopt.$(OBJEXT) getopt1.$(OBJEXT): getopt.h
 | 
|---|
| 207 | inp.$(OBJEXT): backupfile.h $(COMMON) inp.h pch.h quotearg.h util.h xalloc.h
 | 
|---|
| 208 | maketime.$(OBJEXT): maketime.h partime.h
 | 
|---|
| 209 | mkdir.$(OBJEXT): dirname.h xalloc.h
 | 
|---|
| 210 | partime.$(OBJEXT): partime.h
 | 
|---|
| 211 | patch.$(OBJEXT): argmatch.h backupfile.h $(COMMON) getopt.h inp.h \
 | 
|---|
| 212 |         pch.h quotearg.h util.h version.h xalloc.h
 | 
|---|
| 213 | pch.$(OBJEXT): backupfile.h $(COMMON) dirname.h inp.h pch.h quotearg.h util.h
 | 
|---|
| 214 | quote.$(OBJECT): quote.h quotearg.h
 | 
|---|
| 215 | quotearg.$(OBJEXT): gettext.h quotearg.h xalloc.h
 | 
|---|
| 216 | quotesys.$(OBJEXT): quotesys.h
 | 
|---|
| 217 | strncasecmp.$(OBJEXT): strcasecmp.c
 | 
|---|
| 218 | util.$(OBJEXT): backupfile.h $(COMMON) dirname.h maketime.h \
 | 
|---|
| 219 |         partime.h quotearg.h quotesys.h util.h version.h xalloc.h
 | 
|---|
| 220 | version.$(OBJEXT): $(COMMON) version.h
 | 
|---|
| 221 | xmalloc.$(OBJEXT): error.h gettext.h xalloc.h
 | 
|---|