xref: /plan9-contrib/sys/src/ape/cmd/patch/Makefile.in (revision 0b459c2cb92b7c9d88818e9a2f72e678e5bc4553)
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
21srcdir = @srcdir@
22VPATH = @srcdir@
23
24@SET_MAKE@
25
26CC = @CC@
27ed_PROGRAM = @ed_PROGRAM@
28INSTALL = @INSTALL@
29INSTALL_PROGRAM = @INSTALL_PROGRAM@
30INSTALL_DATA = @INSTALL_DATA@
31transform = @program_transform_name@
32
33CFLAGS = @CFLAGS@
34CPPFLAGS = @CPPFLAGS@
35DEFS = @DEFS@
36LDFLAGS = @LDFLAGS@
37LIBOBJS = @LIBOBJS@
38LIBS = @LIBS@
39PACKAGE = @PACKAGE@
40VERSION = @VERSION@
41
42prefix = @prefix@
43exec_prefix = @exec_prefix@
44
45bindir = $(exec_prefix)/bin
46
47# Where to put the manual pages.
48man1dir = $(prefix)/man/man1
49# Extension (including `.') for the manual page filenames.
50man1ext = .1
51
52# Hook for nonstandard builds.
53CONFIG_STATUS = config.status
54
55#### End of system configuration section. ####
56
57SHELL = /bin/sh
58
59LIBSRCS = getopt.c getopt1.c memchr.c rename.c
60SRCS = 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)
62OBJS = 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)
64HDRS = argmatch.h backupfile.h common.h getopt.h \
65	inp.h maketime.h partime.h pch.h quotearg.h util.h version.h
66MISC = COPYING ChangeLog INSTALL Makefile.in NEWS README \
67	acconfig.h config.hin configure configure.in \
68	install-sh mkinstalldirs patch.man
69DISTFILES = $(MISC) $(SRCS) $(HDRS)
70DISTFILES_PC = pc/chdirsaf.c
71DISTFILES_PC_DJGPP = pc/djgpp/README pc/djgpp/config.sed \
72	pc/djgpp/configure.bat pc/djgpp/configure.sed
73
74patch_name = `echo patch | sed '$(transform)'`
75
76all:: patch
77
78info::
79check::
80installcheck::
81
82COMPILE = $(CC) -c $(CPPFLAGS) $(DEFS) -Ded_PROGRAM=\"$(ed_PROGRAM)\" \
83	-I. -I$(srcdir) $(CFLAGS)
84
85.c.o:
86	$(COMPILE) $<
87
88patch: $(OBJS)
89	$(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(OBJS) $(LIBS)
90
91install:: all installdirs
92	$(INSTALL_PROGRAM) patch $(bindir)/$(patch_name)
93	-$(INSTALL_DATA) $(srcdir)/patch.man $(man1dir)/$(patch_name)$(man1ext)
94
95installdirs::
96	$(SHELL) $(srcdir)/mkinstalldirs $(bindir) $(man1dir)
97
98install-strip::
99	$(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' install
100
101uninstall::
102	rm -f $(bindir)/$(patch_name) $(man1dir)/$(patch_name)$(man1ext)
103
104Makefile: Makefile.in $(CONFIG_STATUS)
105	$(SHELL) $(CONFIG_STATUS)
106config.status: configure
107	$(SHELL) $(CONFIG_STATUS) --recheck
108configure: configure.in
109	cd $(srcdir) && autoconf
110config.hin: configure.in acconfig.h
111	cd $(srcdir) && rm -f config.hin && autoheader
112
113patchlevel.h: Makefile
114	echo '#define PATCH_VERSION "$(VERSION)"' >patchlevel.h
115
116TAGS: $(HDRS) patchlevel.h $(SRCS)
117	etags $(HDRS) patchlevel.h $(SRCS)
118
119clean::
120	rm -f patch core* *core *.o
121
122mostlyclean:: clean
123
124distclean:: clean
125	rm -f Makefile config.cache config.log config.status config.h
126	rm -f patchlevel.h
127
128maintainer-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
134PV = $(PACKAGE)-$(VERSION)
135
136dist:: $(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
146addext.o: backupfile.h
147argmatch.o: argmatch.h
148backupfile.o: argmatch.h backupfile.h
149basename.o: backupfile.h
150getopt.o getopt1.o: getopt.h
151maketime.o: maketime.h partime.h
152inp.o: backupfile.h common.h inp.h pch.h util.h
153partime.o: partime.h
154patch.o: argmatch.h backupfile.h common.h getopt.h inp.h pch.h util.h version.h
155pch.o: common.h inp.h pch.h util.h
156quotearg.o: quotearg.h
157util.o: backupfile.h common.h maketime.h partime.h quotearg.h util.h version.h
158version.o: common.h patchlevel.h util.h version.h
159