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