1# Makefile.in gnuserv
2
3# Copyright (C) 1994, 1995, 1997, 1999, 2000, 2001 Noah S. Friedman, Martin Schwenke
4
5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by
7# the Free Software Foundation; either version 2, or (at your option)
8# any later version.
9#
10# This program is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13# GNU General Public License for more details.
14#
15# You should have received a copy of the GNU General Public License
16# along with this program; if not, write to the Free Software
17# Foundation, Inc., 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA.
18
19# $Id$
20
21PACKAGENAME = gnuserv
22VERSION = 3.12.4
23DISTNAME = $(PACKAGENAME)-$(VERSION)
24
25#### Start of system configuration section. ####
26
27srcdir = @srcdir@
28VPATH = @srcdir@
29
30CC = @CC@
31
32INSTALL = @INSTALL@
33INSTALL_PROGRAM = @INSTALL_PROGRAM@
34INSTALL_SCRIPT = @INSTALL_SCRIPT@
35INSTALL_DATA = @INSTALL_DATA@
36
37DEFS = @DEFS@
38LIBS = @LIBS@
39LIBXAUTH = @LIBXAUTH@
40
41CFLAGS = @CFLAGS@
42CPPFLAGS = @CPPFLAGS@
43LDFLAGS = @LDFLAGS@
44
45prefix = @prefix@
46exec_prefix = @exec_prefix@
47
48# The directory for installing executable programs that users can run.
49bindir = $(exec_prefix)/bin
50# Prefix/suffix for each installed program name, normally empty.
51binprefix =
52binsuffix =
53
54# The directory for installing read-only architecture independent
55# data files.
56# As a special exception, see `infodir' and `includedir' below.
57datadir = $(prefix)/share
58
59elispdir = $(datadir)/emacs/site-lisp
60
61# Where to install the manual pages.
62man1dir = $(prefix)/man/man1
63# Prefix/suffix for each installed man page, normally empty or `g'.
64man1prefix = $(binprefix)
65man1suffix = $(binsuffix)
66# Extension (not including `.') for the installed manual page filenames.
67man1ext = 1
68
69AUTOCONF       = autoconf
70AUTOHEADER     = autoheader
71EMACS          = emacs
72ETAGS          = etags
73GZIP           = gzip
74LN             = ln -s
75MAKEINFO       = makeinfo
76MAKEINFOFLAGS  = --no-split -I. -I$(srcdir)
77MV             = mv
78RM             = rm -f
79TAR            = tar
80TOUCH 	       = touch
81TEXI2DVI       = texi2dvi
82TEXI2DVIFLAGS  = #-I. -I$(srcdir)
83
84#### End of system configuration section. ####
85
86SHELL = /bin/sh
87
88LOADLIBES = $(LIBS) $(LIBXAUTH)
89
90DIST_TXTS = INSTALL COPYING README README.orig ChangeLog
91DIST_MISC = 
92DIST_CONF = Makefile.in acconfig.h aclocal.m4 config.h.in config.h.bot \
93            configure configure.in install-sh mkinstalldirs
94DIST_SCPS = gnuattach gnudoit
95DIST_SRCS = getopt.c gnuclient.c gnuserv.c gnuslib.c
96DIST_HDRS = getopt.h gnuserv.h sysfile.h
97DIST_DOCS = gnuserv.1
98DIST_LISP = gnuserv.el gnuserv-compat.el devices.el
99DISTFILES = $(DIST_TXTS) $(DIST_MISC) $(DIST_CONF) $(DIST_SCPS) \
100            $(DIST_SRCS) $(DIST_HDRS) $(DIST_DOCS) $(DIST_LISP)
101
102
103COMPILE_FLAGS = -I. -I$(srcdir) $(DEFS) $(CPPFLAGS) $(CFLAGS)
104.c.o:
105	$(CC) -c $(COMPILE_FLAGS) $<
106
107.SUFFIXES: .texi .info
108.texi.info:
109	$(MAKEINFO) $(MAKEINFOFLAGS) $<
110
111.SUFFIXES: .texi .dvi
112.texi.dvi:
113	$(TEXI2DVI) $(TEXI2DVIFLAGS) $<
114
115.SUFFIXES: .el .elc
116.el.elc:
117	$(EMACS) -batch -l loadup -f batch-byte-compile $<
118
119all: all-gnuserv
120all-info: info
121
122### targets required by GNU Coding standards ###
123
124Makefile: Makefile.in config.status
125	$(SHELL) ./config.status
126
127config.status: configure
128	$(SHELL) ./config.status --recheck
129
130configure: configure.in
131	cd $(srcdir) && $(AUTOCONF)
132
133config.h.in: configure.in
134	cd $(srcdir) && $(AUTOHEADER)
135
136config.h: config.h.in
137	$(SHELL) ./config.status
138
139TAGS:
140	cd $(srcdir) && $(ETAGS)
141
142.PHONY: clean mostlyclean distclean
143clean:
144	$(RM) $(PROGS) *.o *.elc core a.out
145
146mostlyclean: clean
147
148distclean: clean
149	$(RM) Makefile config.status config.log config.cache config.h
150
151.PHONY: maintainer-clean maintclean-warning
152maintainer-clean: maintclean-warning distclean
153	$(RM) configure config.h.in getdate.c y.tab.c
154
155# Used by maintainer-clean to print a warning before any rm commands are run.
156maintclean-warning:
157	@echo "This command is intended for maintainers to use;"
158	@echo "it deletes files that may require special tools to rebuild."
159
160realclean: distclean
161	$(RM) TAGS
162
163.PHONY: dist
164dist: $(DISTFILES)
165	$(TOUCH) config.h.in
166	$(RM) -r $(DISTNAME)
167	mkdir $(DISTNAME)
168	@dst=$(DISTNAME); for f in $(DISTFILES); do \
169	   { cmd=ln; $$cmd $(srcdir)/$$f $$dst/$$f ; } \
170	     || { cmd='cp -p'; cp -p $(srcdir)/$$f $$dst/$$f ; }; \
171	   echo $$cmd $(srcdir)/$$f $$dst/$$f; \
172	done
173	$(TAR) cf - $(DISTNAME) | $(GZIP) > $(DISTNAME).tar.gz
174	$(RM) -r $(DISTNAME)
175
176.PHONY: installdirs uninstall
177install: all installdirs install-programs install-man install-elisp
178
179installdirs: force
180	-$(SHELL) $(srcdir)/mkinstalldirs $(bindir) $(datadir) $(libdir) $(infodir) $(man1dir) $(elispdir)
181
182install-programs: all-gnuserv
183	@for prog in gnuserv gnuclient ; do \
184	  new=$(bindir)/$(binprefix)$$prog$(binsuffix); \
185          echo $(INSTALL_PROGRAM) $$prog $$new; \
186	  $(INSTALL_PROGRAM) $$prog $$new;\
187	done
188	@for prog in gnuattach gnudoit ; do \
189	  new=$(bindir)/$(binprefix)$$prog$(binsuffix); \
190          echo $(INSTALL_SCRIPT) $$prog $$new; \
191	  $(INSTALL_SCRIPT) $$prog $$new;\
192	done
193
194install-man: force
195	@new=$(man1prefix)gnuserv$(man1suffix).$(man1ext); \
196	echo $(INSTALL_DATA) $(srcdir)/gnuserv.1 $(man1dir)/$$new; \
197	$(INSTALL_DATA) $(srcdir)/gnuserv.1 $(man1dir)/$$new; \
198	cd $(man1dir) || exit 1; \
199	for l in gnuclient gnuattach gnudoit ; do \
200	  l=$(man1dir)/$(man1prefix)$$l$(man1suffix).$(man1ext); \
201	  echo $(LN) $(man1dir)/$$new $$l; \
202	  $(RM) $$l; $(LN) $$new $$l; \
203	done
204
205install-elisp: gnuserv.el gnuserv.elc
206	for e in gnuserv gnuserv-compat devices ; do \
207	  $(INSTALL_DATA) $(srcdir)/$${e}.el $(elispdir)/$${e}.el; \
208	  $(INSTALL_DATA) $${e}.elc $(elispdir)/$${e}.elc; \
209	done
210
211uninstall: force
212	-cd $(bindir) && $(RM) $(PROGS)
213	-@cd $(man1dir);\
214	 for l in $(PROGS); do \
215	   f=$(man1dir)/$(man1prefix)$$l$(man1suffix).$(man1ext); \
216	   echo $(RM) $$f && $(RM) $$f ; \
217	 done
218
219.PHONY: check installcheck force
220check:
221	@echo 'Nothing to be done for "check"'
222
223installcheck:
224	@echo 'Nothing to be done for "installcheck"'
225
226force:
227
228### program-specific building targets ###
229
230PROGS = gnuserv gnuclient
231ELC = gnuserv-compat.elc gnuserv.elc devices.elc
232
233all-gnuserv: $(PROGS) $(ELC)
234
235gnuserv: gnuserv.o gnuslib.o
236	$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ gnuserv.o gnuslib.o $(LOADLIBES)
237
238gnuclient: gnuclient.o gnuslib.o getopt.o
239	$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ gnuclient.o gnuslib.o getopt.o $(LOADLIBES)
240
241gnuserv.o: gnuserv.c gnuserv.h config.h
242gnuclient.o: gnuclient.c gnuserv.h getopt.h config.h
243gnuslib.o: gnuslib.c gnuserv.h getopt.o config.h
244getopt.o: getopt.c getopt.h config.h
245
246gnuserv-compat.elc: gnuserv-compat.el
247	$(EMACS) -batch -l loadup \
248		--eval "(add-to-list 'load-path \".\")" \
249		-l gnuserv-compat  -f batch-byte-compile $<
250gnuserv.elc: gnuserv.el
251	$(EMACS) -batch -l loadup \
252	--eval "(add-to-list 'load-path \".\")" \
253	-l gnuserv-compat -f batch-byte-compile $<
254devices.elc: devices.el
255
256info: gnuserv.info
257gnuserv.info: gnuserv.texi
258
259dvi: gnuserv.dvi
260gnuserv.dvi: gnuserv.texi
261
262# Prevent GNU make v3 from overflowing arg limit on SysV.
263.NOEXPORT:
264
265# local variables:
266# mode: makefile
267# end:
268
269# Makefile.in ends here
270