(etags, ctags): Make VERSION a string constant.
[bpt/emacs.git] / lib-src / Makefile.in
1 /* Makefile for lib-src subdirectory in GNU Emacs.
2 Copyright (C) 1985, 1987, 1988, 1993, 1994 Free Software Foundation, Inc.
3
4 This file is part of GNU Emacs.
5
6 GNU Emacs 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 GNU Emacs 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 GNU Emacs; see the file COPYING. If not, write to
18 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
19
20 #define NO_SHORTNAMES
21 #define THIS_IS_YMAKEFILE
22 #define NOT_C_CODE
23 #include "../src/config.h"
24
25 /* Some s/*.h files define this to request special libraries. */
26 #ifndef LIBS_SYSTEM
27 #define LIBS_SYSTEM
28 #endif
29
30 /* Some m/*.h files define this to request special libraries. */
31 #ifndef LIBS_MACHINE
32 #define LIBS_MACHINE
33 #endif
34
35 #undef MOVEMAIL_NEEDS_BLESSING
36 #ifndef MAIL_USE_FLOCK
37 #ifndef MAIL_USE_LOCKF
38 #define MOVEMAIL_NEEDS_BLESSING
39 #endif
40 #endif
41
42 #ifdef MOVEMAIL_NEEDS_BLESSING
43 #define BLESSMAIL blessmail
44 #else
45 #define BLESSMAIL
46 #endif
47
48 /* Avoid trouble on systems where the `SHELL' variable might be
49 inherited from the environment. */
50 SHELL = /bin/sh
51
52 /* ==================== Things `configure' will edit ==================== */
53
54 CC=@CC@
55 CFLAGS=@CFLAGS@
56 ALLOCA=@ALLOCA@
57 C_SWITCH_SYSTEM=@c_switch_system@
58 C_SWITCH_MACHINE=@c_switch_machine@
59 LOADLIBES=LIBS_SYSTEM LIBS_MACHINE
60 YACC=@YACC@
61 version=@version@
62 configname=@configuration@
63
64 /* ==================== Where To Install Things ==================== */
65
66 /* The default location for installation. Everything is placed in
67 subdirectories of this directory. The default values for many of
68 the variables below are expressed in terms of this one, so you may
69 not need to change them. This is set with the --prefix option to
70 `../configure'. */
71 prefix=@prefix@
72
73 /* Like `prefix', but used for architecture-specific files. This is
74 set with the --exec-prefix option to `../configure'. */
75 exec_prefix=@exec_prefix@
76
77 /* Where to install Emacs and other binaries that people will want to
78 run directly (like etags). This is set with the --bindir option
79 to `../configure'. */
80 bindir=@bindir@
81
82 /* Where to install and expect executable files to be run by Emacs
83 rather than directly by users, and other architecture-dependent
84 data. ${archlibdir} is usually below this. This is set with the
85 --libdir option to `../configure'. */
86 libdir=@libdir@
87
88 /* Where to find the source code. This is set by the configure
89 script's `--srcdir' option. However, the value of ${srcdir} in
90 this makefile is not identical to what was specified with --srcdir,
91 since the variable here has `/lib-src' added at the end. */
92 srcdir=@srcdir@
93 VPATH=@srcdir@
94
95 /* ==================== Emacs-specific directories ==================== */
96
97 /* These variables hold the values Emacs will actually use. They are
98 based on the values of the standard Make variables above. */
99
100 /* Where to put executables to be run by Emacs rather than the user.
101 This path usually includes the Emacs version and configuration name,
102 so that multiple configurations for multiple versions of Emacs may
103 be installed at once. This can be set with the --archlibdir option
104 to `../configure'. */
105 archlibdir=@archlibdir@
106
107 /* ==================== Utility Programs for the Build ================= */
108
109 /* ../configure figures out the correct values for these. */
110 INSTALL = @INSTALL@
111 INSTALL_PROGRAM = @INSTALL_PROGRAM@
112 INSTALL_DATA = @INSTALL_DATA@
113
114 /* ============================= Targets ============================== */
115
116 /* Things that a user might actually run,
117 which should be installed in bindir. */
118 INSTALLABLES = etags ctags emacsclient b2m
119 INSTALLABLE_SCRIPTS = rcs-checkin
120
121 /* Things that Emacs runs internally, or during the build process,
122 which should not be installed in bindir. */
123 UTILITIES= test-distrib make-path wakeup profile make-docfile digest-doc \
124 sorted-doc movemail cvtmail fakemail yow emacsserver hexl timer
125
126 /* Like UTILITIES, but they're not system-dependent, and should not be
127 deleted by the distclean target. */
128 SCRIPTS= rcs2log vcdiff
129
130 EXECUTABLES= ${UTILITIES} ${INSTALLABLES} ${SCRIPTS} ${INSTALLABLE_SCRIPTS}
131
132 SOURCES = COPYING ChangeLog Makefile.in README aixcc.lex emacs.csh \
133 makedoc.com *.[chy] rcs2log vcdiff
134
135 /* We need to #define emacs to get the right versions of some files.
136 Some other files - those shared with other GNU utilities - need
137 HAVE_CONFIG_H #defined before they know they can take advantage of
138 the information in ../src/config.h. */
139 ALL_CFLAGS = ${C_SWITCH_SYSTEM} ${C_SWITCH_MACHINE} -Demacs -DHAVE_CONFIG_H \
140 -I. -I../src -I${srcdir} -I${srcdir}/../src ${LDFLAGS} ${CPPFLAGS} ${CFLAGS}
141 LINK_CFLAGS = ${C_SWITCH_SYSTEM} ${C_SWITCH_MACHINE} -Demacs -DHAVE_CONFIG_H \
142 -I. -I../src -I${srcdir} -I${srcdir}/../src ${LDFLAGS} ${CFLAGS}
143 CPP_CFLAGS = ${C_SWITCH_SYSTEM} ${C_SWITCH_MACHINE} -Demacs -DHAVE_CONFIG_H \
144 -I. -I../src -I${srcdir} -I${srcdir}/../src ${CPPFLAGS} ${CFLAGS}
145 \f
146 /* This is the default compilation command.
147 But we should never rely on it, because some make version
148 failed to find it for getopt.o.
149 Using an explicit command made it work. */
150 .c.o:
151 ${CC} -c ${CPP_CFLAGS} $<
152
153 all: ${UTILITIES} ${INSTALLABLES}
154
155 #ifdef MOVEMAIL_NEEDS_BLESSING
156 blessmail: ../src/temacs
157 ../src/temacs -batch -l blessmail.el
158 chmod +x blessmail
159 #endif
160
161 /* Install the internal utilities. Until they are installed, we can
162 just run them directly from lib-src. */
163 ${archlibdir}: all BLESSMAIL
164 @echo
165 @echo "Installing utilities run internally by Emacs."
166 ./make-path ${archlibdir}
167 if [ `(cd ${archlibdir} && /bin/pwd)` != `/bin/pwd` ]; then \
168 for file in ${UTILITIES}; do \
169 (cd ..; $(INSTALL_PROGRAM) lib-src/$$file ${archlibdir}/$$file) ; \
170 done ; \
171 for file in ${SCRIPTS}; do \
172 (cd ..; $(INSTALL_PROGRAM) ${srcdir}/$$file ${archlibdir}/$$file); \
173 done ; \
174 fi
175 #ifdef MOVEMAIL_NEEDS_BLESSING
176 ./blessmail ${archlibdir}/movemail
177 #endif
178
179 /* We don't need to install `wakeup' explicitly, because it will be
180 copied when this whole directory is copied. */
181 install: ${archlibdir}
182 @echo
183 @echo "Installing utilities for users to run."
184 for file in ${INSTALLABLES} ; do \
185 (cd ..; $(INSTALL_PROGRAM) lib-src/$${file} ${bindir}/$${file}) ; \
186 done
187 for file in ${INSTALLABLE_SCRIPTS} ; do \
188 (cd ..; $(INSTALL_PROGRAM) ${srcdir}/$${file} ${bindir}/$${file}) ; \
189 done
190
191 uninstall:
192 (cd ${bindir}; \
193 rm -f ${INSTALLABLES} ${INSTALLABLE_SCRIPTS})
194 (cd ${archlibdir}; \
195 rm -f ${UTILITIES} ${INSTALLABLES} ${SCRIPTS} ${INSTALLABLE_SCRIPTS})
196
197 mostlyclean:
198 -rm -f core *.o
199
200 clean: mostlyclean
201 -rm -f ${INSTALLABLES} ${UTILITIES}
202
203 distclean: clean
204 -rm -f ../etc/DOC* *.tab.c *.tab.h aixcc.c TAGS
205
206 realclean: distclean
207 true
208
209 extraclean: realclean
210 -rm -f *~ \#*
211
212 unlock:
213 chmod u+w $(SOURCES)
214
215 relock:
216 chmod u-w $(SOURCES)
217
218 /* Test the contents of the directory. */
219 check:
220 @echo "We don't have any tests for GNU Emacs yet."
221
222 TAGS: etags
223 etags *.[ch]
224
225 /* This verifies that the non-ASCII characters in the file `testfile'
226 have not been clobbered by whatever means were used to copy and
227 distribute Emacs. If they were clobbered, all the .elc files were
228 clobbered too. */
229 test-distrib: ${srcdir}/test-distrib.c
230 $(CC) -o test-distrib ${srcdir}/test-distrib.c
231 ./test-distrib ${srcdir}/testfile
232
233 GETOPTOBJS = getopt.o getopt1.o $(ALLOCA)
234 GETOPTDEPS = $(GETOPTOBJS) ${srcdir}/getopt.h
235 getopt.o: ${srcdir}/getopt.c ${srcdir}/getopt.h
236 ${CC} -c ${CPP_CFLAGS} ${srcdir}/getopt.c
237 getopt1.o: ${srcdir}/getopt1.c ${srcdir}/getopt.h
238 ${CC} -c ${CPP_CFLAGS} ${srcdir}/getopt1.c
239
240 etags: ${srcdir}/etags.c $(GETOPTDEPS) ../src/config.h
241 $(CC) ${ALL_CFLAGS} -DVERSION="\"${version}\"" ${srcdir}/etags.c $(GETOPTOBJS) $(LOADLIBES) -o etags
242
243 /* We depend on etags to assure that parallel makes don't write two
244 etags.o files on top of each other. */
245 ctags: ${srcdir}/etags.c $(GETOPTDEPS) etags
246 $(CC) ${ALL_CFLAGS} -DCTAGS -DVERSION="\"${version}\"" ${srcdir}/etags.c $(GETOPTOBJS) $(LOADLIBES) -o ctags
247
248 wakeup: ${srcdir}/wakeup.c
249 $(CC) ${ALL_CFLAGS} ${srcdir}/wakeup.c $(LOADLIBES) -o wakeup
250
251 profile: ${srcdir}/profile.c
252 $(CC) ${ALL_CFLAGS} ${srcdir}/profile.c $(LOADLIBES) -o profile
253
254 make-docfile: ${srcdir}/make-docfile.c
255 $(CC) ${ALL_CFLAGS} ${srcdir}/make-docfile.c $(LOADLIBES) -o make-docfile
256
257 digest-doc: ${srcdir}/digest-doc.c
258 $(CC) ${ALL_CFLAGS} ${srcdir}/digest-doc.c $(LOADLIBES) -o digest-doc
259
260 sorted-doc: ${srcdir}/sorted-doc.c ${ALLOCA}
261 $(CC) ${ALL_CFLAGS} ${srcdir}/sorted-doc.c ${ALLOCA} $(LOADLIBES) -o sorted-doc
262
263 b2m: ${srcdir}/b2m.c ../src/config.h
264 $(CC) ${ALL_CFLAGS} ${srcdir}/b2m.c $(LOADLIBES) -o b2m
265
266 movemail: ${srcdir}/movemail.c ../src/config.h
267 $(CC) ${ALL_CFLAGS} ${srcdir}/movemail.c $(LOADLIBES) -o movemail
268
269 cvtmail: ${srcdir}/cvtmail.c
270 $(CC) ${ALL_CFLAGS} ${srcdir}/cvtmail.c $(LOADLIBES) -o cvtmail
271
272 fakemail: ${srcdir}/fakemail.c ../src/config.h
273 $(CC) ${ALL_CFLAGS} ${srcdir}/fakemail.c $(LOADLIBES) -o fakemail
274
275 yow: ${srcdir}/yow.c ../src/paths.h
276 $(CC) ${ALL_CFLAGS} ${srcdir}/yow.c $(LOADLIBES) -o yow
277
278 emacsserver: ${srcdir}/emacsserver.c ../src/config.h
279 $(CC) ${ALL_CFLAGS} ${srcdir}/emacsserver.c $(LOADLIBES) -o emacsserver
280
281 emacsclient: ${srcdir}/emacsclient.c ../src/config.h
282 $(CC) ${ALL_CFLAGS} ${srcdir}/emacsclient.c $(LOADLIBES) -o emacsclient
283
284 hexl: ${srcdir}/hexl.c
285 $(CC) ${ALL_CFLAGS} ${srcdir}/hexl.c $(LOADLIBES) -o hexl
286
287 TIMEROBJS=getdate.o timer.o $(ALLOCA)
288 getdate.o: ${srcdir}/getdate.y ../src/config.h
289 ${YACC} ${YFLAGS} ${srcdir}/getdate.y
290 $(CC) $(CPP_CFLAGS) -c y.tab.c
291 mv y.tab.o getdate.o
292 timer.o: ${srcdir}/timer.c ../src/config.h
293 $(CC) -c $(CPP_CFLAGS) ${srcdir}/timer.c
294 timer: ${TIMEROBJS}
295 $(CC) $(LINK_CFLAGS) ${TIMEROBJS} $(LOADLIBES) -o timer
296
297 make-path: ${srcdir}/make-path.c ../src/config.h
298 $(CC) $(ALL_CFLAGS) ${srcdir}/make-path.c -o make-path
299
300 /* These are NOT included in INSTALLABLES or UTILITIES.
301 See ../src/ymakefile. */
302 emacstool: ${srcdir}/emacstool.c
303 $(CC) ${srcdir}/emacstool.c -o emacstool ${ALL_CFLAGS} \
304 -lsuntool -lsunwindow -lpixrect $(LOADLIBES)
305
306 /* For SUN Japanese Language Environment. */
307 nemacstool: ${srcdir}/emacstool.c
308 $(CC) -o nemacstool -DJLE ${ALL_CFLAGS} ${srcdir}/emacstool.c \
309 -lsuntool -lmle -lsunwindow -lpixrect $(LOADLIBES)
310
311 xvetool: ${srcdir}/emacstool.c
312 $(CC) -o xvetool -DXVIEW ${ALL_CFLAGS} ${srcdir}/emacstool.c \
313 -lxview -lX -I$(OPENWINHOME)/include -L$(OPENWINHOME)/lib \
314 $(LOADLIBES)
315
316 xveterm: ${srcdir}/emacstool.c
317 $(CC) -o xveterm -DXVIEW -DTTERM ${ALL_CFLAGS} ${srcdir}/emacstool.c \
318 -lxview -lolgx -lX -I$(OPENWINHOME)/include -L$(OPENWINHOME)/lib \
319 $(LOADLIBES)
320
321 aixcc: ${srcdir}/aixcc.c
322 $(CC) $(ALL_CFLAGS) -o aixcc ${srcdir}/aixcc.c
323
324 aixcc.c: ${srcdir}/aixcc.lex
325 lex ${srcdir}/aixcc.lex
326 mv lex.yy.c aixcc.c