]> code.delx.au - gnu-emacs/blob - lib-src/Makefile.in
(LIB_STANDARD): Extract this as in src/Makefile.in.
[gnu-emacs] / 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 # Avoid trouble on systems where the `SHELL' variable might be
21 # inherited from the environment.
22 SHELL = /bin/sh
23
24 # ==================== Things `configure' will edit ====================
25
26 CC=@CC@
27 CFLAGS=@CFLAGS@
28 ALLOCA=@ALLOCA@
29 YACC=@YACC@
30 version=@version@
31 configuration=@configuration@
32
33 # ==================== Where To Install Things ====================
34
35 # The default location for installation. Everything is placed in
36 # subdirectories of this directory. The default values for many of
37 # the variables below are expressed in terms of this one, so you may
38 # not need to change them. This is set with the --prefix option to
39 # `../configure'.
40 prefix=@prefix@
41
42 # Like `prefix', but used for architecture-specific files. This is
43 # set with the --exec-prefix option to `../configure'.
44 exec_prefix=@exec_prefix@
45
46 # Where to install Emacs and other binaries that people will want to
47 # run directly (like etags). This is set with the --bindir option
48 # to `../configure'.
49 bindir=@bindir@
50
51 # Where to install and expect executable files to be run by Emacs
52 # rather than directly by users, and other architecture-dependent
53 # data. ${archlibdir} is usually below this. This is set with the
54 # --libexecdir option to `../configure'.
55 libexecdir=@libexecdir@
56
57 # Where to find the source code. This is set by the configure
58 # script's `--srcdir' option. However, the value of ${srcdir} in
59 # this makefile is not identical to what was specified with --srcdir,
60 # since the variable here has `/lib-src' added at the end.
61 srcdir=@srcdir@
62 VPATH=@srcdir@
63
64 # The top-level source directory, also set by configure.
65 top_srcdir=@top_srcdir@
66
67 # ==================== Emacs-specific directories ====================
68
69 # These variables hold the values Emacs will actually use. They are
70 # based on the values of the standard Make variables above.
71
72 # Where to put executables to be run by Emacs rather than the user.
73 # This path usually includes the Emacs version and configuration name,
74 # so that multiple configurations for multiple versions of Emacs may
75 # be installed at once. This can be set with the --archlibdir option
76 # to `../configure'.
77 archlibdir=@archlibdir@
78
79 # ==================== Utility Programs for the Build =================
80
81 # ../configure figures out the correct values for these.
82 INSTALL = @INSTALL@
83 INSTALL_PROGRAM = @INSTALL_PROGRAM@
84 INSTALL_DATA = @INSTALL_DATA@
85
86 # ========================== Lists of Files ===========================
87
88 # Things that a user might actually run,
89 # which should be installed in bindir.
90 INSTALLABLES = etags ctags emacsclient b2m
91 INSTALLABLE_SCRIPTS = rcs-checkin
92
93 # Things that Emacs runs internally, or during the build process,
94 # which should not be installed in bindir.
95 UTILITIES= wakeup profile digest-doc \
96 sorted-doc movemail cvtmail fakemail yow emacsserver hexl timer
97
98 DONT_INSTALL= test-distrib make-docfile
99
100 # Like UTILITIES, but they're not system-dependent, and should not be
101 # deleted by the distclean target.
102 SCRIPTS= rcs2log vcdiff
103
104 EXECUTABLES= ${UTILITIES} ${INSTALLABLES} ${SCRIPTS} ${INSTALLABLE_SCRIPTS}
105
106 SOURCES = COPYING ChangeLog Makefile.in README emacs.csh \
107 makedoc.com *.[chy] rcs2log vcdiff
108
109 # Additional -D flags for movemail (add to MOVE_FLAGS if desired):
110 # MAIL_USE_POP Support mail retrieval from a POP mailbox.
111 # MAIL_USE_MMDF Support MMDF mailboxes.
112 # MAIL_USE_FLOCK Use flock for file locking (see the comments
113 # about locking in movemail.c)
114 # MAIL_UNLINK_SPOOL Unlink the user's spool mailbox after reading
115 # it (instead of just emptying it).
116 # KERBEROS Support Kerberized POP.
117 # KRB5 Support Kerberos Version 5 pop instead of
118 # Version 4 (define this in addition to
119 # KERBEROS).
120 # HESIOD Support Hesiod lookups of user mailboxes.
121 # MAILHOST A string, the host name of the default POP
122 # mail host for the site.
123 MOVE_FLAGS=
124
125 # Additional libraries for movemail:
126 # For KERBEROS
127 # MOVE_LIBS= -lkrb -ldes -lcom_err
128 # For KERBEROS + KRB5
129 # MOVE_LIBS= -lkrb5 -lcrypto -lisode -lcom_err
130 # Add "-lhesiod" if HESIOD is defined.
131 MOVE_LIBS=
132
133 # ========================== start of cpp stuff =======================
134 /* From here on, comments must be done in C syntax. */
135
136 #define NO_SHORTNAMES
137 #define THIS_IS_YMAKEFILE
138 #define NOT_C_CODE
139 #include "../src/config.h"
140
141 /* We won't really call alloca;
142 don't let the file name alloca.c get messed up. */
143 #ifdef alloca
144 #undef alloca
145 #endif
146
147 /* Some machines don't find the standard C libraries in the usual place. */
148 #ifndef ORDINARY_LINK
149 #ifndef LIB_STANDARD
150 #define LIB_STANDARD -lc
151 #endif
152 #else
153 #ifndef LIB_STANDARD
154 #define LIB_STANDARD
155 #endif
156 #endif
157
158 /* Some s/*.h files define this to request special libraries. */
159 #ifndef LIBS_SYSTEM
160 #define LIBS_SYSTEM
161 #endif
162
163 /* Some m/*.h files define this to request special libraries. */
164 #ifndef LIBS_MACHINE
165 #define LIBS_MACHINE
166 #endif
167
168 #ifndef C_SWITCH_SYSTEM
169 #define C_SWITCH_SYSTEM
170 #endif
171
172 #ifndef C_SWITCH_MACHINE
173 #define C_SWITCH_MACHINE
174 #endif
175
176 #undef MOVEMAIL_NEEDS_BLESSING
177 #ifndef MAIL_USE_FLOCK
178 #ifndef MAIL_USE_LOCKF
179 #define MOVEMAIL_NEEDS_BLESSING
180 #endif
181 #endif
182
183 #ifdef MOVEMAIL_NEEDS_BLESSING
184 #define BLESSMAIL blessmail
185 #else
186 #define BLESSMAIL
187 #endif
188
189 LOADLIBES=LIBS_SYSTEM LIBS_MACHINE LIB_STANDARD
190
191 /* We need to #define emacs to get the right versions of some files.
192 Some other files - those shared with other GNU utilities - need
193 HAVE_CONFIG_H #defined before they know they can take advantage of
194 the information in ../src/config.h. */
195 ALL_CFLAGS = C_SWITCH_SYSTEM C_SWITCH_MACHINE -DHAVE_CONFIG_H \
196 -I. -I../src -I${srcdir} -I${srcdir}/../src ${LDFLAGS} ${CPPFLAGS} ${CFLAGS}
197 LINK_CFLAGS = C_SWITCH_SYSTEM C_SWITCH_MACHINE -DHAVE_CONFIG_H \
198 -I. -I../src -I${srcdir} -I${srcdir}/../src ${LDFLAGS} ${CFLAGS}
199 CPP_CFLAGS = C_SWITCH_SYSTEM C_SWITCH_MACHINE -DHAVE_CONFIG_H \
200 -I. -I../src -I${srcdir} -I${srcdir}/../src ${CPPFLAGS} ${CFLAGS}
201 /* This was all of CPP_CFLAGS except -Demacs.
202 Now that -Demacs has been deleted from CPP_CFLAGS,
203 this is actually the same as CPP_CFLAGS, but let's not delete it yet. */
204 BASE_CFLAGS = C_SWITCH_SYSTEM C_SWITCH_MACHINE -DHAVE_CONFIG_H \
205 -I. -I../src -I${srcdir} -I${srcdir}/../src ${CPPFLAGS} ${CFLAGS}
206 \f
207 /* This is the default compilation command.
208 But we should never rely on it, because some make version
209 failed to find it for getopt.o.
210 Using an explicit command made it work. */
211 .c.o:
212 ${CC} -c ${CPP_CFLAGS} $<
213
214 all: ${DONT_INSTALL} ${UTILITIES} ${INSTALLABLES}
215
216 #ifdef MOVEMAIL_NEEDS_BLESSING
217 blessmail:
218 ../src/emacs -batch -l ../lisp/blessmail.el
219 chmod +x blessmail
220 #endif
221
222 maybe-blessmail: BLESSMAIL
223 #ifdef MOVEMAIL_NEEDS_BLESSING
224 /* Don't charge ahead and do it! Let the installer decide.
225 ./blessmail ${archlibdir}/movemail */
226 @if [ `wc -l <blessmail` != 2 ] ; then \
227 dir=`sed -n -e 's/echo mail directory = \(.*\)/\1/p' blessmail`; \
228 echo Assuming $$dir is really the mail spool directory, you should; \
229 echo run lib-src/blessmail ${archlibdir}/movemail; \
230 echo as root, to give movemail appropriate permissions.; \
231 echo Do that after running make install.; \
232 fi
233 #endif
234
235 /* Install the internal utilities. Until they are installed, we can
236 just run them directly from lib-src. */
237 ${archlibdir}: all
238 @echo
239 @echo "Installing utilities run internally by Emacs."
240 $(top_srcdir)/mkinstalldirs ${archlibdir}
241 if [ `(cd ${archlibdir} && /bin/pwd)` != `/bin/pwd` ]; then \
242 for file in ${UTILITIES}; do \
243 $(INSTALL_PROGRAM) $$file ${archlibdir}/$$file ; \
244 done ; \
245 fi
246 if [ `(cd ${archlibdir} && /bin/pwd)` \
247 != `(cd ${srcdir} && /bin/pwd)` ]; then \
248 for file in ${SCRIPTS}; do \
249 $(INSTALL_PROGRAM) ${srcdir}/$$file ${archlibdir}/$$file; \
250 done ; \
251 fi
252
253 /* We don't need to install `wakeup' explicitly, because it will be
254 copied when this whole directory is copied. */
255 install: ${archlibdir}
256 @echo
257 @echo "Installing utilities for users to run."
258 for file in ${INSTALLABLES} ; do \
259 $(INSTALL_PROGRAM) $${file} ${bindir}/$${file} ; \
260 done
261 for file in ${INSTALLABLE_SCRIPTS} ; do \
262 $(INSTALL_PROGRAM) ${srcdir}/$${file} ${bindir}/$${file} ; \
263 done
264
265 uninstall:
266 (cd ${bindir}; \
267 rm -f ${INSTALLABLES} ${INSTALLABLE_SCRIPTS})
268 (cd ${archlibdir}; \
269 rm -f ${UTILITIES} ${INSTALLABLES} ${SCRIPTS} ${INSTALLABLE_SCRIPTS})
270
271 mostlyclean:
272 -rm -f core *.o
273
274 clean: mostlyclean
275 -rm -f ${INSTALLABLES} ${UTILITIES} ${DONT_INSTALL}
276 -rm -f ../etc/DOC* *.tab.c *.tab.h
277
278 distclean: clean
279 -rm -f TAGS
280 -rm -f Makefile Makefile.c blessmail
281
282 maintainer-clean: distclean
283 true
284
285 extraclean: maintainer-clean
286 -rm -f *~ \#*
287
288 unlock:
289 chmod u+w $(SOURCES)
290
291 relock:
292 chmod u-w $(SOURCES)
293
294 /* Test the contents of the directory. */
295 check:
296 @echo "We don't have any tests for GNU Emacs yet."
297
298 tags: TAGS
299 TAGS: etags
300 etags *.[ch]
301
302 /* This verifies that the non-ASCII characters in the file `testfile'
303 have not been clobbered by whatever means were used to copy and
304 distribute Emacs. If they were clobbered, all the .elc files were
305 clobbered too. */
306 test-distrib: ${srcdir}/test-distrib.c
307 $(CC) ${ALL_CFLAGS} -o test-distrib ${srcdir}/test-distrib.c
308 ./test-distrib ${srcdir}/testfile
309
310 GETOPTOBJS = getopt.o getopt1.o $(ALLOCA)
311 GETOPTDEPS = $(GETOPTOBJS) ${srcdir}/getopt.h
312 getopt.o: ${srcdir}/getopt.c ${srcdir}/getopt.h
313 ${CC} -c ${CPP_CFLAGS} ${srcdir}/getopt.c
314 getopt1.o: ${srcdir}/getopt1.c ${srcdir}/getopt.h
315 ${CC} -c ${CPP_CFLAGS} ${srcdir}/getopt1.c
316 alloca.o: ${srcdir}/alloca.c
317 ${CC} -c ${BASE_CFLAGS} ${srcdir}/alloca.c
318
319 #ifdef REGEXP_IN_LIBC
320 REGEXPOBJ =
321 REGEXPDEPS =
322 #else
323 REGEXPOBJ = regex.o
324 REGEXPDEPS = $(REGEXPOBJ) ../src/regex.h
325 #endif
326
327 regex.o: ../src/regex.c ../src/regex.h
328 ${CC} -c ${BASE_CFLAGS} -DCONFIG_BROKETS -DINHIBIT_STRING_HEADER ${srcdir}/../src/regex.c
329
330 etags: ${srcdir}/etags.c $(GETOPTDEPS) $(REGEXPDEPS) ../src/config.h
331 $(CC) ${ALL_CFLAGS} -DVERSION="\"${version}\"" -DETAGS_REGEXPS ${srcdir}/etags.c $(GETOPTOBJS) $(REGEXPOBJ) $(LOADLIBES) -o etags
332
333 /* We depend on etags to assure that parallel makes don't write two
334 etags.o files on top of each other. */
335 ctags: ${srcdir}/etags.c $(GETOPTDEPS) etags
336 $(CC) ${ALL_CFLAGS} -DCTAGS -DVERSION="\"${version}\"" ${srcdir}/etags.c $(GETOPTOBJS) $(LOADLIBES) -o ctags
337
338 wakeup: ${srcdir}/wakeup.c
339 $(CC) ${ALL_CFLAGS} ${srcdir}/wakeup.c $(LOADLIBES) -o wakeup
340
341 profile: ${srcdir}/profile.c
342 $(CC) ${ALL_CFLAGS} ${srcdir}/profile.c $(LOADLIBES) -o profile
343
344 make-docfile: ${srcdir}/make-docfile.c
345 $(CC) ${ALL_CFLAGS} ${srcdir}/make-docfile.c $(LOADLIBES) -o make-docfile
346
347 digest-doc: ${srcdir}/digest-doc.c
348 $(CC) ${ALL_CFLAGS} ${srcdir}/digest-doc.c $(LOADLIBES) -o digest-doc
349
350 sorted-doc: ${srcdir}/sorted-doc.c ${ALLOCA}
351 $(CC) ${ALL_CFLAGS} ${srcdir}/sorted-doc.c ${ALLOCA} $(LOADLIBES) -o sorted-doc
352
353 b2m: ${srcdir}/b2m.c ../src/config.h
354 $(CC) ${ALL_CFLAGS} ${srcdir}/b2m.c $(LOADLIBES) -o b2m
355
356 movemail: movemail.o pop.o
357 $(CC) ${LINK_CFLAGS} ${MOVE_FLAGS} movemail.o pop.o $(LOADLIBES) $(MOVE_LIBS) -o movemail
358
359 movemail.o: ${srcdir}/movemail.c ../src/config.h
360 $(CC) -c ${CPP_CFLAGS} -Demacs ${MOVE_FLAGS} ${srcdir}/movemail.c
361
362 pop.o: ${srcdir}/pop.c
363 $(CC) -c ${CPP_CFLAGS} ${MOVE_FLAGS} ${srcdir}/pop.c
364
365 cvtmail: ${srcdir}/cvtmail.c
366 $(CC) ${ALL_CFLAGS} ${srcdir}/cvtmail.c $(LOADLIBES) -o cvtmail
367
368 fakemail: ${srcdir}/fakemail.c ../src/config.h
369 $(CC) ${ALL_CFLAGS} ${srcdir}/fakemail.c $(LOADLIBES) -o fakemail
370
371 yow: ${srcdir}/yow.c ../src/paths.h
372 $(CC) ${ALL_CFLAGS} ${srcdir}/yow.c $(LOADLIBES) -o yow
373
374 emacsserver: ${srcdir}/emacsserver.c ../src/config.h
375 $(CC) ${ALL_CFLAGS} ${srcdir}/emacsserver.c $(LOADLIBES) -o emacsserver
376
377 emacsclient: ${srcdir}/emacsclient.c ../src/config.h
378 $(CC) ${ALL_CFLAGS} ${srcdir}/emacsclient.c $(LOADLIBES) -o emacsclient
379
380 hexl: ${srcdir}/hexl.c
381 $(CC) ${ALL_CFLAGS} ${srcdir}/hexl.c $(LOADLIBES) -o hexl
382
383 TIMEROBJS=getdate.o timer.o $(ALLOCA)
384 $(srcdir)/getdate.c: ${srcdir}/getdate.y
385 cd $(srcdir); ${YACC} ${YFLAGS} getdate.y
386 cd $(srcdir); mv y.tab.c getdate.c
387 getdate.o: ${srcdir}/getdate.c ../src/config.h
388 $(CC) $(CPP_CFLAGS) -Demacs -c ${srcdir}/getdate.c
389
390 timer.o: ${srcdir}/timer.c ../src/config.h
391 $(CC) -c $(CPP_CFLAGS) ${srcdir}/timer.c
392 timer: ${TIMEROBJS}
393 $(CC) $(LINK_CFLAGS) ${TIMEROBJS} $(LOADLIBES) -o timer
394
395 /* These are NOT included in INSTALLABLES or UTILITIES.
396 See ../src/Makefile.in. */
397 emacstool: ${srcdir}/emacstool.c
398 $(CC) ${srcdir}/emacstool.c -o emacstool ${ALL_CFLAGS} \
399 -lsuntool -lsunwindow -lpixrect $(LOADLIBES)
400
401 /* For SUN Japanese Language Environment. */
402 nemacstool: ${srcdir}/emacstool.c
403 $(CC) -o nemacstool -DJLE ${ALL_CFLAGS} ${srcdir}/emacstool.c \
404 -lsuntool -lmle -lsunwindow -lpixrect $(LOADLIBES)
405
406 xvetool: ${srcdir}/emacstool.c
407 $(CC) -o xvetool -DXVIEW ${ALL_CFLAGS} ${srcdir}/emacstool.c \
408 -lxview -lX -I$(OPENWINHOME)/include -L$(OPENWINHOME)/lib \
409 $(LOADLIBES)
410
411 xveterm: ${srcdir}/emacstool.c
412 $(CC) -o xveterm -DXVIEW -DTTERM ${ALL_CFLAGS} ${srcdir}/emacstool.c \
413 -lxview -lolgx -lX -I$(OPENWINHOME)/include -L$(OPENWINHOME)/lib \
414 $(LOADLIBES)