Commit | Line | Data |
---|---|---|
eb4252f7 RS |
1 | # Makefile for lib-src subdirectory in GNU Emacs. |
2 | # Copyright (C) 1985, 1987, 1988, 1993, 1994 Free Software Foundation, Inc. | |
29ed0542 | 3 | |
eb4252f7 | 4 | # This file is part of GNU Emacs. |
29ed0542 | 5 | |
eb4252f7 RS |
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. | |
29ed0542 | 10 | |
eb4252f7 RS |
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. | |
29ed0542 | 15 | |
eb4252f7 RS |
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. */ | |
29ed0542 | 19 | |
eb4252f7 RS |
20 | # Avoid trouble on systems where the `SHELL' variable might be |
21 | # inherited from the environment. | |
f7dbcf3c JB |
22 | SHELL = /bin/sh |
23 | ||
eb4252f7 | 24 | # ==================== Things `configure' will edit ==================== |
c71beb75 | 25 | |
b93f2493 BF |
26 | CC=@CC@ |
27 | CFLAGS=@CFLAGS@ | |
28 | ALLOCA=@ALLOCA@ | |
b93f2493 BF |
29 | YACC=@YACC@ |
30 | version=@version@ | |
cf770692 | 31 | configuration=@configuration@ |
c71beb75 | 32 | |
eb4252f7 | 33 | # ==================== Where To Install Things ==================== |
c71beb75 | 34 | |
eb4252f7 RS |
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'. | |
b93f2493 | 40 | prefix=@prefix@ |
c71beb75 | 41 | |
eb4252f7 RS |
42 | # Like `prefix', but used for architecture-specific files. This is |
43 | # set with the --exec-prefix option to `../configure'. | |
b93f2493 | 44 | exec_prefix=@exec_prefix@ |
c71beb75 | 45 | |
eb4252f7 RS |
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'. | |
b93f2493 | 49 | bindir=@bindir@ |
c71beb75 | 50 | |
eb4252f7 RS |
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'. | |
b93f2493 | 55 | libdir=@libdir@ |
c71beb75 | 56 | |
eb4252f7 RS |
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. | |
b93f2493 BF |
61 | srcdir=@srcdir@ |
62 | VPATH=@srcdir@ | |
c71beb75 | 63 | |
eb4252f7 | 64 | # ==================== Emacs-specific directories ==================== |
c71beb75 | 65 | |
eb4252f7 RS |
66 | # These variables hold the values Emacs will actually use. They are |
67 | # based on the values of the standard Make variables above. | |
c71beb75 | 68 | |
eb4252f7 RS |
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'. | |
b93f2493 | 74 | archlibdir=@archlibdir@ |
41f86d5a | 75 | |
eb4252f7 | 76 | # ==================== Utility Programs for the Build ================= |
c71beb75 | 77 | |
eb4252f7 | 78 | # ../configure figures out the correct values for these. |
b93f2493 | 79 | INSTALL = @INSTALL@ |
b93f2493 BF |
80 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ |
81 | INSTALL_DATA = @INSTALL_DATA@ | |
c71beb75 | 82 | |
eb4252f7 | 83 | # ========================== Lists of Files =========================== |
f7dbcf3c | 84 | |
eb4252f7 RS |
85 | # Things that a user might actually run, |
86 | # which should be installed in bindir. | |
0d73e8e3 JB |
87 | INSTALLABLES = etags ctags emacsclient b2m |
88 | INSTALLABLE_SCRIPTS = rcs-checkin | |
f7dbcf3c | 89 | |
eb4252f7 RS |
90 | # Things that Emacs runs internally, or during the build process, |
91 | # which should not be installed in bindir. | |
379fb9c8 | 92 | UTILITIES= test-distrib make-path wakeup profile make-docfile digest-doc \ |
62039e5a | 93 | sorted-doc movemail cvtmail fakemail yow emacsserver hexl timer |
f7dbcf3c | 94 | |
eb4252f7 RS |
95 | # Like UTILITIES, but they're not system-dependent, and should not be |
96 | # deleted by the distclean target. | |
b7cceaf1 JB |
97 | SCRIPTS= rcs2log vcdiff |
98 | ||
0d73e8e3 | 99 | EXECUTABLES= ${UTILITIES} ${INSTALLABLES} ${SCRIPTS} ${INSTALLABLE_SCRIPTS} |
f7dbcf3c | 100 | |
41f86d5a ER |
101 | SOURCES = COPYING ChangeLog Makefile.in README aixcc.lex emacs.csh \ |
102 | makedoc.com *.[chy] rcs2log vcdiff | |
103 | ||
eb4252f7 RS |
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 | ||
89b3f894 RS |
112 | /* We won't really call alloca; |
113 | don't let the file name alloca.c get messed up. */ | |
114 | #ifdef alloca | |
115 | #undef alloca | |
116 | #endif | |
117 | ||
eb4252f7 RS |
118 | /* Some s/*.h files define this to request special libraries. */ |
119 | #ifndef LIBS_SYSTEM | |
120 | #define LIBS_SYSTEM | |
121 | #endif | |
122 | ||
123 | /* Some m/*.h files define this to request special libraries. */ | |
124 | #ifndef LIBS_MACHINE | |
125 | #define LIBS_MACHINE | |
126 | #endif | |
127 | ||
128 | #ifndef C_SWITCH_SYSTEM | |
129 | #define C_SWITCH_SYSTEM | |
130 | #endif | |
131 | ||
132 | #ifndef C_SWITCH_MACHINE | |
133 | #define C_SWITCH_MACHINE | |
134 | #endif | |
135 | ||
136 | #undef MOVEMAIL_NEEDS_BLESSING | |
137 | #ifndef MAIL_USE_FLOCK | |
138 | #ifndef MAIL_USE_LOCKF | |
139 | #define MOVEMAIL_NEEDS_BLESSING | |
140 | #endif | |
141 | #endif | |
142 | ||
143 | #ifdef MOVEMAIL_NEEDS_BLESSING | |
144 | #define BLESSMAIL blessmail | |
145 | #else | |
146 | #define BLESSMAIL | |
147 | #endif | |
148 | ||
149 | LOADLIBES=LIBS_SYSTEM LIBS_MACHINE | |
150 | ||
29ed0542 RS |
151 | /* We need to #define emacs to get the right versions of some files. |
152 | Some other files - those shared with other GNU utilities - need | |
153 | HAVE_CONFIG_H #defined before they know they can take advantage of | |
154 | the information in ../src/config.h. */ | |
82a635f3 | 155 | ALL_CFLAGS = C_SWITCH_SYSTEM C_SWITCH_MACHINE -Demacs -DHAVE_CONFIG_H \ |
3e883207 | 156 | -I. -I../src -I${srcdir} -I${srcdir}/../src ${LDFLAGS} ${CPPFLAGS} ${CFLAGS} |
82a635f3 | 157 | LINK_CFLAGS = C_SWITCH_SYSTEM C_SWITCH_MACHINE -Demacs -DHAVE_CONFIG_H \ |
3e883207 | 158 | -I. -I../src -I${srcdir} -I${srcdir}/../src ${LDFLAGS} ${CFLAGS} |
82a635f3 | 159 | CPP_CFLAGS = C_SWITCH_SYSTEM C_SWITCH_MACHINE -Demacs -DHAVE_CONFIG_H \ |
b2d7a9c7 | 160 | -I. -I../src -I${srcdir} -I${srcdir}/../src ${CPPFLAGS} ${CFLAGS} |
20cda85b RS |
161 | ALLOCA_CFLAGS = C_SWITCH_SYSTEM C_SWITCH_MACHINE -DHAVE_CONFIG_H \ |
162 | -I. -I../src -I${srcdir} -I${srcdir}/../src ${CPPFLAGS} ${CFLAGS} | |
29ed0542 RS |
163 | \f |
164 | /* This is the default compilation command. | |
165 | But we should never rely on it, because some make version | |
166 | failed to find it for getopt.o. | |
167 | Using an explicit command made it work. */ | |
c38a040d | 168 | .c.o: |
5293b432 | 169 | ${CC} -c ${CPP_CFLAGS} $< |
c71beb75 | 170 | |
4eda59a9 | 171 | all: ${UTILITIES} ${INSTALLABLES} |
c71beb75 | 172 | |
c6207d0d | 173 | #ifdef MOVEMAIL_NEEDS_BLESSING |
f675ecb5 | 174 | blessmail: |
2b243866 | 175 | ../src/emacs -batch -l ../lisp/blessmail.el |
c6207d0d KH |
176 | chmod +x blessmail |
177 | #endif | |
178 | ||
d19f95fe RS |
179 | maybe-blessmail: BLESSMAIL |
180 | #ifdef MOVEMAIL_NEEDS_BLESSING | |
181 | /* Don't charge ahead and do it! Let the installer decide. | |
182 | ./blessmail ${archlibdir}/movemail */ | |
183 | @if [ `wc -l <blessmail` != 2 ] ; then \ | |
184 | dir=`sed -n -e 's/echo mail directory = \(.*\)/\1/p' blessmail`; \ | |
185 | echo Assuming $$dir is really the mail spool directory, you should; \ | |
fed76e78 | 186 | echo run lib-src/blessmail ${archlibdir}/movemail; \ |
d19f95fe | 187 | echo as root, to give movemail appropriate permissions.; \ |
eb4252f7 | 188 | echo Do that after running make install.; \ |
d19f95fe RS |
189 | fi |
190 | #endif | |
191 | ||
29ed0542 RS |
192 | /* Install the internal utilities. Until they are installed, we can |
193 | just run them directly from lib-src. */ | |
d19f95fe | 194 | ${archlibdir}: all |
c71beb75 JB |
195 | @echo |
196 | @echo "Installing utilities run internally by Emacs." | |
197 | ./make-path ${archlibdir} | |
f7d3e7d0 | 198 | if [ `(cd ${archlibdir} && /bin/pwd)` != `/bin/pwd` ]; then \ |
544d556f | 199 | for file in ${UTILITIES}; do \ |
4ef7b413 | 200 | (cd ..; $(INSTALL_PROGRAM) lib-src/$$file ${archlibdir}/$$file) ; \ |
544d556f | 201 | done ; \ |
ad600343 RS |
202 | fi |
203 | if [ `(cd ${archlibdir} && /bin/pwd)` \ | |
204 | != `(cd ${srcdir} && /bin/pwd)` ]; then \ | |
544d556f | 205 | for file in ${SCRIPTS}; do \ |
4ef7b413 | 206 | (cd ..; $(INSTALL_PROGRAM) ${srcdir}/$$file ${archlibdir}/$$file); \ |
c71beb75 | 207 | done ; \ |
0268f19b | 208 | fi |
f7dbcf3c | 209 | |
29ed0542 RS |
210 | /* We don't need to install `wakeup' explicitly, because it will be |
211 | copied when this whole directory is copied. */ | |
c71beb75 JB |
212 | install: ${archlibdir} |
213 | @echo | |
214 | @echo "Installing utilities for users to run." | |
b70cff71 | 215 | for file in ${INSTALLABLES} ; do \ |
4ef7b413 | 216 | (cd ..; $(INSTALL_PROGRAM) lib-src/$${file} ${bindir}/$${file}) ; \ |
0268f19b | 217 | done |
b70cff71 | 218 | for file in ${INSTALLABLE_SCRIPTS} ; do \ |
4ef7b413 | 219 | (cd ..; $(INSTALL_PROGRAM) ${srcdir}/$${file} ${bindir}/$${file}) ; \ |
0268f19b | 220 | done |
f7dbcf3c | 221 | |
39b649dd JB |
222 | uninstall: |
223 | (cd ${bindir}; \ | |
224 | rm -f ${INSTALLABLES} ${INSTALLABLE_SCRIPTS}) | |
225 | (cd ${archlibdir}; \ | |
226 | rm -f ${UTILITIES} ${INSTALLABLES} ${SCRIPTS} ${INSTALLABLE_SCRIPTS}) | |
227 | ||
a17d2c25 RS |
228 | mostlyclean: |
229 | -rm -f core *.o | |
230 | ||
231 | clean: mostlyclean | |
232 | -rm -f ${INSTALLABLES} ${UTILITIES} | |
f7dbcf3c | 233 | |
39b649dd JB |
234 | distclean: clean |
235 | -rm -f ../etc/DOC* *.tab.c *.tab.h aixcc.c TAGS | |
348c8c1b | 236 | -rm -f Makefile Makefile.in blessmail |
f7dbcf3c JB |
237 | |
238 | realclean: distclean | |
39b649dd | 239 | true |
c71beb75 JB |
240 | |
241 | extraclean: realclean | |
242 | -rm -f *~ \#* | |
f7dbcf3c | 243 | |
41f86d5a ER |
244 | unlock: |
245 | chmod u+w $(SOURCES) | |
246 | ||
247 | relock: | |
248 | chmod u-w $(SOURCES) | |
249 | ||
29ed0542 | 250 | /* Test the contents of the directory. */ |
f7dbcf3c JB |
251 | check: |
252 | @echo "We don't have any tests for GNU Emacs yet." | |
253 | ||
254 | TAGS: etags | |
255 | etags *.[ch] | |
256 | ||
29ed0542 RS |
257 | /* This verifies that the non-ASCII characters in the file `testfile' |
258 | have not been clobbered by whatever means were used to copy and | |
259 | distribute Emacs. If they were clobbered, all the .elc files were | |
260 | clobbered too. */ | |
0d73e8e3 | 261 | test-distrib: ${srcdir}/test-distrib.c |
c88a7f88 | 262 | $(CC) ${ALL_CFLAGS} -o test-distrib ${srcdir}/test-distrib.c |
0d73e8e3 | 263 | ./test-distrib ${srcdir}/testfile |
f7dbcf3c | 264 | |
c38a040d | 265 | GETOPTOBJS = getopt.o getopt1.o $(ALLOCA) |
0d73e8e3 | 266 | GETOPTDEPS = $(GETOPTOBJS) ${srcdir}/getopt.h |
b90589d8 | 267 | getopt.o: ${srcdir}/getopt.c ${srcdir}/getopt.h |
0268f19b | 268 | ${CC} -c ${CPP_CFLAGS} ${srcdir}/getopt.c |
b90589d8 | 269 | getopt1.o: ${srcdir}/getopt1.c ${srcdir}/getopt.h |
0268f19b | 270 | ${CC} -c ${CPP_CFLAGS} ${srcdir}/getopt1.c |
20cda85b RS |
271 | alloca.o: ${srcdir}/alloca.c |
272 | ${CC} -c ${ALLOCA_CFLAGS} ${srcdir}/alloca.c | |
f7dbcf3c | 273 | |
755f5c87 | 274 | etags: ${srcdir}/etags.c $(GETOPTDEPS) ../src/config.h |
9076a6fc | 275 | $(CC) ${ALL_CFLAGS} -DVERSION="\"${version}\"" ${srcdir}/etags.c $(GETOPTOBJS) $(LOADLIBES) -o etags |
f7dbcf3c | 276 | |
29ed0542 RS |
277 | /* We depend on etags to assure that parallel makes don't write two |
278 | etags.o files on top of each other. */ | |
4348b379 | 279 | ctags: ${srcdir}/etags.c $(GETOPTDEPS) etags |
9076a6fc | 280 | $(CC) ${ALL_CFLAGS} -DCTAGS -DVERSION="\"${version}\"" ${srcdir}/etags.c $(GETOPTOBJS) $(LOADLIBES) -o ctags |
f7dbcf3c | 281 | |
0d73e8e3 | 282 | wakeup: ${srcdir}/wakeup.c |
3e883207 | 283 | $(CC) ${ALL_CFLAGS} ${srcdir}/wakeup.c $(LOADLIBES) -o wakeup |
f7dbcf3c | 284 | |
379fb9c8 RS |
285 | profile: ${srcdir}/profile.c |
286 | $(CC) ${ALL_CFLAGS} ${srcdir}/profile.c $(LOADLIBES) -o profile | |
287 | ||
0d73e8e3 | 288 | make-docfile: ${srcdir}/make-docfile.c |
3e883207 | 289 | $(CC) ${ALL_CFLAGS} ${srcdir}/make-docfile.c $(LOADLIBES) -o make-docfile |
f7dbcf3c | 290 | |
0d73e8e3 | 291 | digest-doc: ${srcdir}/digest-doc.c |
3e883207 | 292 | $(CC) ${ALL_CFLAGS} ${srcdir}/digest-doc.c $(LOADLIBES) -o digest-doc |
f7dbcf3c | 293 | |
1e3255d8 | 294 | sorted-doc: ${srcdir}/sorted-doc.c ${ALLOCA} |
3e883207 | 295 | $(CC) ${ALL_CFLAGS} ${srcdir}/sorted-doc.c ${ALLOCA} $(LOADLIBES) -o sorted-doc |
f7dbcf3c | 296 | |
0d73e8e3 | 297 | b2m: ${srcdir}/b2m.c ../src/config.h |
3e883207 | 298 | $(CC) ${ALL_CFLAGS} ${srcdir}/b2m.c $(LOADLIBES) -o b2m |
f7dbcf3c | 299 | |
0d73e8e3 | 300 | movemail: ${srcdir}/movemail.c ../src/config.h |
3e883207 | 301 | $(CC) ${ALL_CFLAGS} ${srcdir}/movemail.c $(LOADLIBES) -o movemail |
f7dbcf3c | 302 | |
0d73e8e3 | 303 | cvtmail: ${srcdir}/cvtmail.c |
3e883207 | 304 | $(CC) ${ALL_CFLAGS} ${srcdir}/cvtmail.c $(LOADLIBES) -o cvtmail |
f7dbcf3c | 305 | |
0d73e8e3 | 306 | fakemail: ${srcdir}/fakemail.c ../src/config.h |
3e883207 | 307 | $(CC) ${ALL_CFLAGS} ${srcdir}/fakemail.c $(LOADLIBES) -o fakemail |
f7dbcf3c | 308 | |
0d73e8e3 | 309 | yow: ${srcdir}/yow.c ../src/paths.h |
3e883207 | 310 | $(CC) ${ALL_CFLAGS} ${srcdir}/yow.c $(LOADLIBES) -o yow |
f7dbcf3c | 311 | |
0d73e8e3 | 312 | emacsserver: ${srcdir}/emacsserver.c ../src/config.h |
3e883207 | 313 | $(CC) ${ALL_CFLAGS} ${srcdir}/emacsserver.c $(LOADLIBES) -o emacsserver |
f7dbcf3c | 314 | |
0d73e8e3 | 315 | emacsclient: ${srcdir}/emacsclient.c ../src/config.h |
3e883207 | 316 | $(CC) ${ALL_CFLAGS} ${srcdir}/emacsclient.c $(LOADLIBES) -o emacsclient |
f7dbcf3c | 317 | |
0d73e8e3 | 318 | hexl: ${srcdir}/hexl.c |
3e883207 | 319 | $(CC) ${ALL_CFLAGS} ${srcdir}/hexl.c $(LOADLIBES) -o hexl |
f7dbcf3c | 320 | |
9ff5de07 | 321 | TIMEROBJS=getdate.o timer.o $(ALLOCA) |
0d73e8e3 JB |
322 | getdate.o: ${srcdir}/getdate.y ../src/config.h |
323 | ${YACC} ${YFLAGS} ${srcdir}/getdate.y | |
eab5f4fd | 324 | $(CC) $(CPP_CFLAGS) -c y.tab.c |
43bf8b0e | 325 | mv y.tab.o getdate.o |
0d73e8e3 | 326 | timer.o: ${srcdir}/timer.c ../src/config.h |
eab5f4fd | 327 | $(CC) -c $(CPP_CFLAGS) ${srcdir}/timer.c |
9ff5de07 | 328 | timer: ${TIMEROBJS} |
3e883207 | 329 | $(CC) $(LINK_CFLAGS) ${TIMEROBJS} $(LOADLIBES) -o timer |
f7dbcf3c | 330 | |
a0697435 | 331 | make-path: ${srcdir}/make-path.c ../src/config.h |
3e883207 | 332 | $(CC) $(ALL_CFLAGS) ${srcdir}/make-path.c -o make-path |
ecc798b0 | 333 | |
29ed0542 | 334 | /* These are NOT included in INSTALLABLES or UTILITIES. |
1858a206 | 335 | See ../src/Makefile.in.in. */ |
0d73e8e3 | 336 | emacstool: ${srcdir}/emacstool.c |
3e883207 | 337 | $(CC) ${srcdir}/emacstool.c -o emacstool ${ALL_CFLAGS} \ |
f7dbcf3c JB |
338 | -lsuntool -lsunwindow -lpixrect $(LOADLIBES) |
339 | ||
29ed0542 | 340 | /* For SUN Japanese Language Environment. */ |
0d73e8e3 | 341 | nemacstool: ${srcdir}/emacstool.c |
3e883207 | 342 | $(CC) -o nemacstool -DJLE ${ALL_CFLAGS} ${srcdir}/emacstool.c \ |
f7dbcf3c JB |
343 | -lsuntool -lmle -lsunwindow -lpixrect $(LOADLIBES) |
344 | ||
0d73e8e3 | 345 | xvetool: ${srcdir}/emacstool.c |
3e883207 | 346 | $(CC) -o xvetool -DXVIEW ${ALL_CFLAGS} ${srcdir}/emacstool.c \ |
f7dbcf3c JB |
347 | -lxview -lX -I$(OPENWINHOME)/include -L$(OPENWINHOME)/lib \ |
348 | $(LOADLIBES) | |
349 | ||
0d73e8e3 | 350 | xveterm: ${srcdir}/emacstool.c |
3e883207 | 351 | $(CC) -o xveterm -DXVIEW -DTTERM ${ALL_CFLAGS} ${srcdir}/emacstool.c \ |
f7dbcf3c JB |
352 | -lxview -lolgx -lX -I$(OPENWINHOME)/include -L$(OPENWINHOME)/lib \ |
353 | $(LOADLIBES) | |
354 | ||
0d73e8e3 | 355 | aixcc: ${srcdir}/aixcc.c |
3e883207 | 356 | $(CC) $(ALL_CFLAGS) -o aixcc ${srcdir}/aixcc.c |
f7dbcf3c | 357 | |
0d73e8e3 JB |
358 | aixcc.c: ${srcdir}/aixcc.lex |
359 | lex ${srcdir}/aixcc.lex | |
f7dbcf3c | 360 | mv lex.yy.c aixcc.c |