]> code.delx.au - gnu-emacs/blob - lib-src/Makefile.in
(test-distrib): Use ALL_CFLAGS.
[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 # --libdir option to `../configure'.
55 libdir=@libdir@
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 # ==================== Emacs-specific directories ====================
65
66 # These variables hold the values Emacs will actually use. They are
67 # based on the values of the standard Make variables above.
68
69 # Where to put executables to be run by Emacs rather than the user.
70 # This path usually includes the Emacs version and configuration name,
71 # so that multiple configurations for multiple versions of Emacs may
72 # be installed at once. This can be set with the --archlibdir option
73 # to `../configure'.
74 archlibdir=@archlibdir@
75
76 # ==================== Utility Programs for the Build =================
77
78 # ../configure figures out the correct values for these.
79 INSTALL = @INSTALL@
80 INSTALL_PROGRAM = @INSTALL_PROGRAM@
81 INSTALL_DATA = @INSTALL_DATA@
82
83 # ========================== Lists of Files ===========================
84
85 # Things that a user might actually run,
86 # which should be installed in bindir.
87 INSTALLABLES = etags ctags emacsclient b2m
88 INSTALLABLE_SCRIPTS = rcs-checkin
89
90 # Things that Emacs runs internally, or during the build process,
91 # which should not be installed in bindir.
92 UTILITIES= test-distrib make-path wakeup profile make-docfile digest-doc \
93 sorted-doc movemail cvtmail fakemail yow emacsserver hexl timer
94
95 # Like UTILITIES, but they're not system-dependent, and should not be
96 # deleted by the distclean target.
97 SCRIPTS= rcs2log vcdiff
98
99 EXECUTABLES= ${UTILITIES} ${INSTALLABLES} ${SCRIPTS} ${INSTALLABLE_SCRIPTS}
100
101 SOURCES = COPYING ChangeLog Makefile.in README aixcc.lex emacs.csh \
102 makedoc.com *.[chy] rcs2log vcdiff
103
104 # ========================== start of cpp stuff =======================
105 /* From here on, comments must be done in C syntax. */
106
107 #define NO_SHORTNAMES
108 #define THIS_IS_YMAKEFILE
109 #define NOT_C_CODE
110 #include "../src/config.h"
111
112 /* Some s/*.h files define this to request special libraries. */
113 #ifndef LIBS_SYSTEM
114 #define LIBS_SYSTEM
115 #endif
116
117 /* Some m/*.h files define this to request special libraries. */
118 #ifndef LIBS_MACHINE
119 #define LIBS_MACHINE
120 #endif
121
122 #ifndef C_SWITCH_SYSTEM
123 #define C_SWITCH_SYSTEM
124 #endif
125
126 #ifndef C_SWITCH_MACHINE
127 #define C_SWITCH_MACHINE
128 #endif
129
130 #undef MOVEMAIL_NEEDS_BLESSING
131 #ifndef MAIL_USE_FLOCK
132 #ifndef MAIL_USE_LOCKF
133 #define MOVEMAIL_NEEDS_BLESSING
134 #endif
135 #endif
136
137 #ifdef MOVEMAIL_NEEDS_BLESSING
138 #define BLESSMAIL blessmail
139 #else
140 #define BLESSMAIL
141 #endif
142
143 LOADLIBES=LIBS_SYSTEM LIBS_MACHINE
144
145 /* We need to #define emacs to get the right versions of some files.
146 Some other files - those shared with other GNU utilities - need
147 HAVE_CONFIG_H #defined before they know they can take advantage of
148 the information in ../src/config.h. */
149 ALL_CFLAGS = C_SWITCH_SYSTEM C_SWITCH_MACHINE -Demacs -DHAVE_CONFIG_H \
150 -I. -I../src -I${srcdir} -I${srcdir}/../src ${LDFLAGS} ${CPPFLAGS} ${CFLAGS}
151 LINK_CFLAGS = C_SWITCH_SYSTEM C_SWITCH_MACHINE -Demacs -DHAVE_CONFIG_H \
152 -I. -I../src -I${srcdir} -I${srcdir}/../src ${LDFLAGS} ${CFLAGS}
153 CPP_CFLAGS = C_SWITCH_SYSTEM C_SWITCH_MACHINE -Demacs -DHAVE_CONFIG_H \
154 -I. -I../src -I${srcdir} -I${srcdir}/../src ${CPPFLAGS} ${CFLAGS}
155 \f
156 /* This is the default compilation command.
157 But we should never rely on it, because some make version
158 failed to find it for getopt.o.
159 Using an explicit command made it work. */
160 .c.o:
161 ${CC} -c ${CPP_CFLAGS} $<
162
163 all: ${UTILITIES} ${INSTALLABLES}
164
165 #ifdef MOVEMAIL_NEEDS_BLESSING
166 blessmail:
167 ../src/emacs -batch -l ../lisp/blessmail.el
168 chmod +x blessmail
169 #endif
170
171 maybe-blessmail: BLESSMAIL
172 #ifdef MOVEMAIL_NEEDS_BLESSING
173 /* Don't charge ahead and do it! Let the installer decide.
174 ./blessmail ${archlibdir}/movemail */
175 @if [ `wc -l <blessmail` != 2 ] ; then \
176 dir=`sed -n -e 's/echo mail directory = \(.*\)/\1/p' blessmail`; \
177 echo Assuming $$dir is really the mail spool directory, you should; \
178 echo run lib-src/blessmail ${archlibdir}/movemail; \
179 echo as root, to give movemail appropriate permissions.; \
180 echo Do that after running make install.; \
181 fi
182 #endif
183
184 /* Install the internal utilities. Until they are installed, we can
185 just run them directly from lib-src. */
186 ${archlibdir}: all
187 @echo
188 @echo "Installing utilities run internally by Emacs."
189 ./make-path ${archlibdir}
190 if [ `(cd ${archlibdir} && /bin/pwd)` != `/bin/pwd` ]; then \
191 for file in ${UTILITIES}; do \
192 (cd ..; $(INSTALL_PROGRAM) lib-src/$$file ${archlibdir}/$$file) ; \
193 done ; \
194 for file in ${SCRIPTS}; do \
195 (cd ..; $(INSTALL_PROGRAM) ${srcdir}/$$file ${archlibdir}/$$file); \
196 done ; \
197 fi
198
199 /* We don't need to install `wakeup' explicitly, because it will be
200 copied when this whole directory is copied. */
201 install: ${archlibdir}
202 @echo
203 @echo "Installing utilities for users to run."
204 for file in ${INSTALLABLES} ; do \
205 (cd ..; $(INSTALL_PROGRAM) lib-src/$${file} ${bindir}/$${file}) ; \
206 done
207 for file in ${INSTALLABLE_SCRIPTS} ; do \
208 (cd ..; $(INSTALL_PROGRAM) ${srcdir}/$${file} ${bindir}/$${file}) ; \
209 done
210
211 uninstall:
212 (cd ${bindir}; \
213 rm -f ${INSTALLABLES} ${INSTALLABLE_SCRIPTS})
214 (cd ${archlibdir}; \
215 rm -f ${UTILITIES} ${INSTALLABLES} ${SCRIPTS} ${INSTALLABLE_SCRIPTS})
216
217 mostlyclean:
218 -rm -f core *.o
219
220 clean: mostlyclean
221 -rm -f ${INSTALLABLES} ${UTILITIES}
222
223 distclean: clean
224 -rm -f ../etc/DOC* *.tab.c *.tab.h aixcc.c TAGS
225 -rm -f Makefile Makefile.in blessmail
226
227 realclean: distclean
228 true
229
230 extraclean: realclean
231 -rm -f *~ \#*
232
233 unlock:
234 chmod u+w $(SOURCES)
235
236 relock:
237 chmod u-w $(SOURCES)
238
239 /* Test the contents of the directory. */
240 check:
241 @echo "We don't have any tests for GNU Emacs yet."
242
243 TAGS: etags
244 etags *.[ch]
245
246 /* This verifies that the non-ASCII characters in the file `testfile'
247 have not been clobbered by whatever means were used to copy and
248 distribute Emacs. If they were clobbered, all the .elc files were
249 clobbered too. */
250 test-distrib: ${srcdir}/test-distrib.c
251 $(CC) ${ALL_CFLAGS} -o test-distrib ${srcdir}/test-distrib.c
252 ./test-distrib ${srcdir}/testfile
253
254 GETOPTOBJS = getopt.o getopt1.o $(ALLOCA)
255 GETOPTDEPS = $(GETOPTOBJS) ${srcdir}/getopt.h
256 getopt.o: ${srcdir}/getopt.c ${srcdir}/getopt.h
257 ${CC} -c ${CPP_CFLAGS} ${srcdir}/getopt.c
258 getopt1.o: ${srcdir}/getopt1.c ${srcdir}/getopt.h
259 ${CC} -c ${CPP_CFLAGS} ${srcdir}/getopt1.c
260
261 etags: ${srcdir}/etags.c $(GETOPTDEPS) ../src/config.h
262 $(CC) ${ALL_CFLAGS} -DVERSION="\"${version}\"" ${srcdir}/etags.c $(GETOPTOBJS) $(LOADLIBES) -o etags
263
264 /* We depend on etags to assure that parallel makes don't write two
265 etags.o files on top of each other. */
266 ctags: ${srcdir}/etags.c $(GETOPTDEPS) etags
267 $(CC) ${ALL_CFLAGS} -DCTAGS -DVERSION="\"${version}\"" ${srcdir}/etags.c $(GETOPTOBJS) $(LOADLIBES) -o ctags
268
269 wakeup: ${srcdir}/wakeup.c
270 $(CC) ${ALL_CFLAGS} ${srcdir}/wakeup.c $(LOADLIBES) -o wakeup
271
272 profile: ${srcdir}/profile.c
273 $(CC) ${ALL_CFLAGS} ${srcdir}/profile.c $(LOADLIBES) -o profile
274
275 make-docfile: ${srcdir}/make-docfile.c
276 $(CC) ${ALL_CFLAGS} ${srcdir}/make-docfile.c $(LOADLIBES) -o make-docfile
277
278 digest-doc: ${srcdir}/digest-doc.c
279 $(CC) ${ALL_CFLAGS} ${srcdir}/digest-doc.c $(LOADLIBES) -o digest-doc
280
281 sorted-doc: ${srcdir}/sorted-doc.c ${ALLOCA}
282 $(CC) ${ALL_CFLAGS} ${srcdir}/sorted-doc.c ${ALLOCA} $(LOADLIBES) -o sorted-doc
283
284 b2m: ${srcdir}/b2m.c ../src/config.h
285 $(CC) ${ALL_CFLAGS} ${srcdir}/b2m.c $(LOADLIBES) -o b2m
286
287 movemail: ${srcdir}/movemail.c ../src/config.h
288 $(CC) ${ALL_CFLAGS} ${srcdir}/movemail.c $(LOADLIBES) -o movemail
289
290 cvtmail: ${srcdir}/cvtmail.c
291 $(CC) ${ALL_CFLAGS} ${srcdir}/cvtmail.c $(LOADLIBES) -o cvtmail
292
293 fakemail: ${srcdir}/fakemail.c ../src/config.h
294 $(CC) ${ALL_CFLAGS} ${srcdir}/fakemail.c $(LOADLIBES) -o fakemail
295
296 yow: ${srcdir}/yow.c ../src/paths.h
297 $(CC) ${ALL_CFLAGS} ${srcdir}/yow.c $(LOADLIBES) -o yow
298
299 emacsserver: ${srcdir}/emacsserver.c ../src/config.h
300 $(CC) ${ALL_CFLAGS} ${srcdir}/emacsserver.c $(LOADLIBES) -o emacsserver
301
302 emacsclient: ${srcdir}/emacsclient.c ../src/config.h
303 $(CC) ${ALL_CFLAGS} ${srcdir}/emacsclient.c $(LOADLIBES) -o emacsclient
304
305 hexl: ${srcdir}/hexl.c
306 $(CC) ${ALL_CFLAGS} ${srcdir}/hexl.c $(LOADLIBES) -o hexl
307
308 TIMEROBJS=getdate.o timer.o $(ALLOCA)
309 getdate.o: ${srcdir}/getdate.y ../src/config.h
310 ${YACC} ${YFLAGS} ${srcdir}/getdate.y
311 $(CC) $(CPP_CFLAGS) -c y.tab.c
312 mv y.tab.o getdate.o
313 timer.o: ${srcdir}/timer.c ../src/config.h
314 $(CC) -c $(CPP_CFLAGS) ${srcdir}/timer.c
315 timer: ${TIMEROBJS}
316 $(CC) $(LINK_CFLAGS) ${TIMEROBJS} $(LOADLIBES) -o timer
317
318 make-path: ${srcdir}/make-path.c ../src/config.h
319 $(CC) $(ALL_CFLAGS) ${srcdir}/make-path.c -o make-path
320
321 /* These are NOT included in INSTALLABLES or UTILITIES.
322 See ../src/Makefile.in.in. */
323 emacstool: ${srcdir}/emacstool.c
324 $(CC) ${srcdir}/emacstool.c -o emacstool ${ALL_CFLAGS} \
325 -lsuntool -lsunwindow -lpixrect $(LOADLIBES)
326
327 /* For SUN Japanese Language Environment. */
328 nemacstool: ${srcdir}/emacstool.c
329 $(CC) -o nemacstool -DJLE ${ALL_CFLAGS} ${srcdir}/emacstool.c \
330 -lsuntool -lmle -lsunwindow -lpixrect $(LOADLIBES)
331
332 xvetool: ${srcdir}/emacstool.c
333 $(CC) -o xvetool -DXVIEW ${ALL_CFLAGS} ${srcdir}/emacstool.c \
334 -lxview -lX -I$(OPENWINHOME)/include -L$(OPENWINHOME)/lib \
335 $(LOADLIBES)
336
337 xveterm: ${srcdir}/emacstool.c
338 $(CC) -o xveterm -DXVIEW -DTTERM ${ALL_CFLAGS} ${srcdir}/emacstool.c \
339 -lxview -lolgx -lX -I$(OPENWINHOME)/include -L$(OPENWINHOME)/lib \
340 $(LOADLIBES)
341
342 aixcc: ${srcdir}/aixcc.c
343 $(CC) $(ALL_CFLAGS) -o aixcc ${srcdir}/aixcc.c
344
345 aixcc.c: ${srcdir}/aixcc.lex
346 lex ${srcdir}/aixcc.lex
347 mv lex.yy.c aixcc.c