1 # Makefile for GNU patch.
2 # Copyright 1993, 1997 Free Software Foundation, Inc.
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)
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.
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.
19 #### Start of system configuration section. ####
27 ed_PROGRAM = @ed_PROGRAM@
29 INSTALL_PROGRAM = @INSTALL_PROGRAM@
30 INSTALL_DATA = @INSTALL_DATA@
31 transform = @program_transform_name@
43 exec_prefix = @exec_prefix@
45 bindir = $(exec_prefix)/bin
47 # Where to put the manual pages.
48 man1dir = $(prefix)/man/man1
49 # Extension (including `.') for the manual page filenames.
52 # Hook for nonstandard builds.
53 CONFIG_STATUS = config.status
55 #### End of system configuration section. ####
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
74 patch_name = `echo patch | sed '$(transform)'`
82 COMPILE = $(CC) -c $(CPPFLAGS) $(DEFS) -Ded_PROGRAM=\"$(ed_PROGRAM)\" \
83 -I. -I$(srcdir) $(CFLAGS)
89 $(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(OBJS) $(LIBS)
91 install:: all installdirs
92 $(INSTALL_PROGRAM) patch $(bindir)/$(patch_name)
93 -$(INSTALL_DATA) $(srcdir)/patch.man $(man1dir)/$(patch_name)$(man1ext)
96 $(SHELL) $(srcdir)/mkinstalldirs $(bindir) $(man1dir)
99 $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' install
102 rm -f $(bindir)/$(patch_name) $(man1dir)/$(patch_name)$(man1ext)
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
113 patchlevel.h: Makefile
114 echo '#define PATCH_VERSION "$(VERSION)"' >patchlevel.h
116 TAGS: $(HDRS) patchlevel.h $(SRCS)
117 etags $(HDRS) patchlevel.h $(SRCS)
120 rm -f patch core* *core *.o
125 rm -f Makefile config.cache config.log config.status config.h
129 @echo "This command is intended for maintainers to use;"
130 @echo "rebuilding the deleted files requires special tools."
134 PV = $(PACKAGE)-$(VERSION)
136 dist:: $(DISTFILES) $(DISTFILES_PC) $(DISTFILES_PC_DJGPP)
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
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
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