* Makefile.in (CFLAGS): Drop -universal under NS_IMPL_COCOA. (.m.o): Dispense with...
[bpt/emacs.git] / lib-src / Makefile.in
1 # Makefile for lib-src subdirectory in GNU Emacs.
2 # Copyright (C) 1985, 1987, 1988, 1993, 1994, 2001, 2002, 2003, 2004,
3 # 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
4
5 # This file is part of GNU Emacs.
6
7 # GNU Emacs is free software: you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation, either version 3 of the License, or
10 # (at your option) any later version.
11
12 # GNU Emacs is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
16
17 # You should have received a copy of the GNU General Public License
18 # along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
19
20
21 # Avoid trouble on systems where the `SHELL' variable might be
22 # inherited from the environment.
23 SHELL = /bin/sh
24
25 # Following ../lisp/Makefile.in.
26 EMACS = ../src/emacs
27 EMACSOPT = -batch --no-site-file --multibyte
28
29 # ==================== Things `configure' will edit ====================
30
31 CC=@CC@
32 CFLAGS=@CFLAGS@
33 version=@version@
34 configuration=@configuration@
35 EXEEXT=@EXEEXT@
36
37 # Program name transformation.
38 TRANSFORM = @program_transform_name@
39
40 # ==================== Where To Install Things ====================
41
42 # The default location for installation. Everything is placed in
43 # subdirectories of this directory. The default values for many of
44 # the variables below are expressed in terms of this one, so you may
45 # not need to change them. This is set with the --prefix option to
46 # `../configure'.
47 prefix=@prefix@
48
49 # Like `prefix', but used for architecture-specific files. This is
50 # set with the --exec-prefix option to `../configure'.
51 exec_prefix=@exec_prefix@
52
53 # Where to install Emacs and other binaries that people will want to
54 # run directly (like etags). This is set with the --bindir option
55 # to `../configure'.
56 bindir=@bindir@
57
58 # Where to install and expect executable files to be run by Emacs
59 # rather than directly by users, and other architecture-dependent
60 # data. ${archlibdir} is usually below this. This is set with the
61 # --libexecdir option to `../configure'.
62 libexecdir=@libexecdir@
63
64 # Directory for local state files for all programs.
65 localstatedir=@localstatedir@
66
67 # Where to find the source code. This is set by the configure
68 # script's `--srcdir' option. However, the value of ${srcdir} in
69 # this makefile is not identical to what was specified with --srcdir,
70 # since the variable here has `/lib-src' added at the end.
71
72 # We use $(srcdir) explicitly in dependencies so as not to depend on VPATH.
73 srcdir=@srcdir@
74 VPATH=@srcdir@
75
76 # The top-level source directory, also set by configure.
77 top_srcdir=@top_srcdir@
78
79 # ==================== Emacs-specific directories ====================
80
81 # These variables hold the values Emacs will actually use. They are
82 # based on the values of the standard Make variables above.
83
84 # Where to put executables to be run by Emacs rather than the user.
85 # This path usually includes the Emacs version and configuration name,
86 # so that multiple configurations for multiple versions of Emacs may
87 # be installed at once. This can be set with the --archlibdir option
88 # to `../configure'.
89 archlibdir=@archlibdir@
90
91 gamedir=@gamedir@
92 gameuser=@gameuser@
93
94 # ==================== Utility Programs for the Build =================
95
96 # ../configure figures out the correct values for these.
97 INSTALL = @INSTALL@
98 INSTALL_PROGRAM = @INSTALL_PROGRAM@
99 INSTALL_DATA = @INSTALL_DATA@
100 INSTALL_SCRIPT = @INSTALL_SCRIPT@
101 # By default, we uphold the dignity of our programs.
102 INSTALL_STRIP =
103
104 # ========================== Lists of Files ===========================
105
106 # Things that a user might actually run,
107 # which should be installed in bindir.
108 INSTALLABLES = etags${EXEEXT} ctags${EXEEXT} emacsclient${EXEEXT} b2m${EXEEXT} ebrowse${EXEEXT}
109 INSTALLABLE_SCRIPTS = rcs-checkin grep-changelog
110
111 # Things that Emacs runs internally, or during the build process,
112 # which should not be installed in bindir.
113 UTILITIES= profile${EXEEXT} digest-doc${EXEEXT} sorted-doc${EXEEXT} movemail${EXEEXT} cvtmail${EXEEXT} fakemail${EXEEXT} \
114 hexl${EXEEXT} update-game-score${EXEEXT}
115
116 DONT_INSTALL= test-distrib${EXEEXT} make-docfile${EXEEXT}
117
118 # Like UTILITIES, but they're not system-dependent, and should not be
119 # deleted by the distclean target.
120 SCRIPTS= rcs2log vcdiff
121
122 EXECUTABLES= ${UTILITIES} ${INSTALLABLES} ${SCRIPTS} ${INSTALLABLE_SCRIPTS}
123
124 # Additional -D flags for movemail (add to MOVE_FLAGS if desired):
125 # MAIL_USE_POP Support mail retrieval from a POP mailbox.
126 # MAIL_USE_MMDF Support MMDF mailboxes.
127 # MAIL_USE_FLOCK Use flock for file locking (see the comments
128 # about locking in movemail.c)
129 # MAIL_UNLINK_SPOOL Unlink the user's spool mailbox after reading
130 # it (instead of just emptying it).
131 # KERBEROS Support Kerberized POP.
132 # KRB5 Support Kerberos Version 5 pop instead of
133 # Version 4 (define this in addition to
134 # KERBEROS).
135 # HESIOD Support Hesiod lookups of user mailboxes.
136 # MAILHOST A string, the host name of the default POP
137 # mail host for the site.
138 MOVE_FLAGS=
139
140 # ========================== start of cpp stuff =======================
141 /* From here on, comments must be done in C syntax. */
142
143 #define THIS_IS_MAKEFILE
144 #define NOT_C_CODE
145 #include "../src/config.h"
146
147 #if defined(NS_IMPL_COCOA)
148 /* Add mac-fix-env for OS X systems running NS version. */
149 INSTALLABLES = etags${EXEEXT} ctags${EXEEXT} emacsclient${EXEEXT} b2m${EXEEXT} ebrowse${EXEEXT} mac-fix-env${EXEEXT}
150 #endif
151
152 /* Some s/SYSTEM.h files define this to request special libraries. */
153 #ifndef LIBS_SYSTEM
154 #define LIBS_SYSTEM
155 #endif
156
157 /* Some m/MACHINE.h files define this to request special libraries. */
158 #ifndef LIBS_MACHINE
159 #define LIBS_MACHINE
160 #endif
161
162 #ifndef C_SWITCH_SYSTEM
163 #define C_SWITCH_SYSTEM
164 #endif
165
166 #ifndef C_SWITCH_MACHINE
167 #define C_SWITCH_MACHINE
168 #endif
169
170 #undef MOVEMAIL_NEEDS_BLESSING
171 #ifndef MAIL_USE_FLOCK
172 #ifndef MAIL_USE_LOCKF
173 #define MOVEMAIL_NEEDS_BLESSING
174 #endif
175 #endif
176
177 #ifdef MOVEMAIL_NEEDS_BLESSING
178 #define BLESSMAIL blessmail
179 #else
180 #define BLESSMAIL
181 #endif
182
183 #ifdef KERBEROS
184 # ifdef HAVE_LIBKRB
185 KRB4LIB = -lkrb
186 # else
187 # ifdef HAVE_LIBKRB4
188 KRB4LIB = -lkrb4
189 # endif
190 # endif
191 # ifdef HAVE_LIBDES
192 DESLIB = -ldes
193 # else
194 # ifdef HAVE_LIBDES425
195 DESLIB = -ldes425
196 # endif
197 # endif
198 # ifdef HAVE_LIBKRB5
199 KRB5LIB = -lkrb5
200 # endif
201 # ifdef HAVE_LIBK5CRYPTO
202 CRYPTOLIB = -lk5crypto
203 # else
204 # ifdef HAVE_LIBCRYPTO
205 CRYPTOLIB = -lcrypto
206 # endif
207 # endif
208 # ifdef HAVE_LIBCOM_ERR
209 COM_ERRLIB = -lcom_err
210 # endif
211 #endif /* KERBEROS */
212
213 /* If HESIOD is defined, set this to "-lhesiod". */
214 #ifdef HAVE_LIBHESIOD
215 # ifdef HAVE_LIBRESOLV
216 HESIODLIB= -lhesiod -lresolv
217 # else
218 HESIODLIB= -lhesiod
219 # endif
220 #endif
221
222 LIBS_MOVE=$(KRB4LIB) $(DESLIB) $(KRB5LIB) $(CRYPTOLIB) $(COM_ERRLIB) $(HESIODLIB)
223
224 #ifdef HAVE_LIBLOCKFILE
225 LIBS_MAIL=-llockfile
226 #else
227 #ifdef HAVE_LIBMAIL
228 LIBS_MAIL=-lmail
229 #endif
230 #endif
231
232 LOADLIBES=LIBS_SYSTEM LIBS_MACHINE
233
234 /* We need to #define emacs to get the right versions of some files.
235 Some other files - those shared with other GNU utilities - need
236 HAVE_CONFIG_H #defined before they know they can take advantage of
237 the information in ../src/config.h. */
238 ALL_CFLAGS = C_SWITCH_SYSTEM C_SWITCH_MACHINE -DHAVE_CONFIG_H \
239 -I. -I../src -I${srcdir} -I${srcdir}/../src ${LDFLAGS} ${CPPFLAGS} ${CFLAGS}
240 LINK_CFLAGS = C_SWITCH_SYSTEM C_SWITCH_MACHINE -DHAVE_CONFIG_H \
241 -I. -I../src -I${srcdir} -I${srcdir}/../src ${LDFLAGS} ${CFLAGS}
242 CPP_CFLAGS = C_SWITCH_SYSTEM C_SWITCH_MACHINE -DHAVE_CONFIG_H \
243 -I. -I../src -I${srcdir} -I${srcdir}/../src ${CPPFLAGS} ${CFLAGS}
244 /* This was all of CPP_CFLAGS except -Demacs.
245 Now that -Demacs has been deleted from CPP_CFLAGS,
246 this is actually the same as CPP_CFLAGS, but let\'s not delete it yet. */
247 BASE_CFLAGS = C_SWITCH_SYSTEM C_SWITCH_MACHINE -DHAVE_CONFIG_H \
248 -I. -I../src -I${srcdir} -I${srcdir}/../src ${CPPFLAGS} ${CFLAGS}
249 \f
250 .SUFFIXES: .m
251
252 /* This is the default compilation command.
253 But we should never rely on it, because some make version
254 failed to find it for getopt.o.
255 Using an explicit command made it work. */
256 .c.o:
257 ${CC} -c ${CPP_CFLAGS} $<
258
259 .m.o:
260 $(CC) -c $(CPPFLAGS) $(ALL_CFLAGS) $<
261
262 all: ${DONT_INSTALL} ${UTILITIES} ${INSTALLABLES} ${SCRIPTS} ${INSTALLABLE_SCRIPTS}
263
264 /* These targets copy the scripts into the build directory
265 so that they can be run from there in an uninstalled Emacs.
266 The "-" is prepended because some versions of cp barf when
267 srcdir is the current directory, and thus the file will be
268 copied into itself. */
269 rcs2log: $(srcdir)/rcs2log
270 -cp -p $(srcdir)/rcs2log rcs2log
271
272 rcs-checkin: $(srcdir)/rcs-checkin
273 -cp -p $(srcdir)/rcs-checkin rcs-checkin
274
275 grep-changelog: $(srcdir)/grep-changelog
276 -cp -p $(srcdir)/grep-changelog grep-changelog
277
278 vcdiff: $(srcdir)/vcdiff
279 -cp -p $(srcdir)/vcdiff vcdiff
280
281 #ifdef MOVEMAIL_NEEDS_BLESSING
282 blessmail:
283 $(EMACS) $(EMACSOPT) -l $(srcdir)/../lisp/mail/blessmail.el
284 chmod +x blessmail
285 #endif
286
287 maybe-blessmail: BLESSMAIL
288 #ifdef MOVEMAIL_NEEDS_BLESSING
289 /* Don\'t charge ahead and do it! Let the installer decide.
290 ./blessmail $(DESTDIR)${archlibdir}/movemail${EXEEXT} */
291 @if [ `wc -l <blessmail` != 2 ] ; then \
292 dir=`sed -n -e 's/echo mail directory = \(.*\)/\1/p' blessmail`; \
293 echo Assuming $$dir is really the mail spool directory, you should; \
294 echo run lib-src/blessmail $(DESTDIR)${archlibdir}/movemail${EXEEXT}; \
295 echo as root, to give movemail${EXEEXT} appropriate permissions.; \
296 echo Do that after running make install.; \
297 fi
298 #endif
299
300 /* Install the internal utilities. Until they are installed, we can
301 just run them directly from lib-src. */
302 $(DESTDIR)${archlibdir}: all
303 @echo
304 @echo "Installing utilities run internally by Emacs."
305 $(top_srcdir)/mkinstalldirs $(DESTDIR)${archlibdir}
306 if [ `(cd $(DESTDIR)${archlibdir} && /bin/pwd)` != `/bin/pwd` ]; then \
307 for file in ${UTILITIES}; do \
308 $(INSTALL_PROGRAM) $(INSTALL_STRIP) $$file $(DESTDIR)${archlibdir}/$$file ; \
309 done ; \
310 fi
311 $(top_srcdir)/mkinstalldirs $(DESTDIR)${gamedir}
312 touch $(DESTDIR)${gamedir}/snake-scores
313 touch $(DESTDIR)${gamedir}/tetris-scores
314 /* If the following commands fail, that is not a big deal.
315 update-game-score will detect at runtime that it is not setuid,
316 and handle things accordingly. */
317 -if chown ${gameuser} $(DESTDIR)${archlibdir}/update-game-score && chmod u+s $(DESTDIR)${archlibdir}/update-game-score; then \
318 chown ${gameuser} $(DESTDIR)${gamedir}; \
319 chmod u=rwx,g=rwx,o=rx $(DESTDIR)${gamedir}; \
320 fi
321 if [ `(cd $(DESTDIR)${archlibdir} && /bin/pwd)` \
322 != `(cd ${srcdir} && /bin/pwd)` ]; then \
323 for file in ${SCRIPTS}; do \
324 $(INSTALL_SCRIPT) ${srcdir}/$$file $(DESTDIR)${archlibdir}/$$file; \
325 done ; \
326 fi
327
328 install: $(DESTDIR)${archlibdir}
329 @echo
330 @echo "Installing utilities for users to run."
331 for file in ${INSTALLABLES} ; do \
332 $(INSTALL_PROGRAM) $(INSTALL_STRIP) $${file} $(DESTDIR)${bindir}/`echo $${file} | sed '$(TRANSFORM)'` ; \
333 chmod a+rx $(DESTDIR)${bindir}/`echo $${file} | sed '$(TRANSFORM)'`; \
334 done
335 for file in ${INSTALLABLE_SCRIPTS} ; do \
336 $(INSTALL_SCRIPT) ${srcdir}/$${file} $(DESTDIR)${bindir}/`echo $${file} | sed '$(TRANSFORM)'` ; \
337 chmod a+rx $(DESTDIR)${bindir}/`echo $${file} | sed '$(TRANSFORM)'`; \
338 done
339
340 uninstall:
341 (cd $(DESTDIR)${bindir}; \
342 for file in ${INSTALLABLES} ${INSTALLABLE_SCRIPTS}; do \
343 rm -f $(DESTDIR)${bindir}/`echo $${file} | sed '$(TRANSFORM)'` ; \
344 done)
345 (cd $(DESTDIR)${archlibdir}; \
346 rm -f ${UTILITIES} ${INSTALLABLES} ${SCRIPTS} ${INSTALLABLE_SCRIPTS})
347
348 mostlyclean:
349 -rm -f core *.o getopt.h getopt.h-t
350
351 clean: mostlyclean
352 -rm -f ${INSTALLABLES} ${UTILITIES} ${DONT_INSTALL}
353 -rm -f fns*.el *.tab.c *.tab.h
354
355 distclean: clean
356 -rm -f TAGS
357 -rm -f Makefile Makefile.c blessmail
358
359 maintainer-clean: distclean
360 true
361
362 extraclean: maintainer-clean
363 -rm -f *~ \#*
364
365 /* Test the contents of the directory. */
366 check:
367 @echo "We don't have any tests for GNU Emacs yet."
368
369 tags: TAGS
370 TAGS: etags${EXEEXT}
371 etags *.[ch]
372
373 /* This verifies that the non-ASCII characters in the file \`testfile\'
374 have not been clobbered by whatever means were used to copy and
375 distribute Emacs. If they were clobbered, all the .elc files were
376 clobbered too. */
377 test-distrib${EXEEXT}: ${srcdir}/test-distrib.c
378 $(CC) ${ALL_CFLAGS} -o test-distrib ${srcdir}/test-distrib.c
379 ./test-distrib ${srcdir}/testfile
380
381 /* We need the following in order to create a <getopt.h> when the system
382 does not have one that works with the given compiler. */
383 GETOPT_H = @GETOPT_H@
384 getopt.h: getopt_.h
385 cp $(srcdir)/getopt_.h $@-t
386 mv $@-t $@
387
388 GETOPTOBJS = @GETOPTOBJS@
389 GETOPTDEPS = $(GETOPTOBJS) $(GETOPT_H)
390 getopt.o: ${srcdir}/getopt.c $(GETOPT_H) ${srcdir}/gettext.h
391 ${CC} -c ${CPP_CFLAGS} ${srcdir}/getopt.c
392 getopt1.o: ${srcdir}/getopt1.c $(GETOPT_H)
393 ${CC} -c ${CPP_CFLAGS} ${srcdir}/getopt1.c
394
395 REGEXPOBJ = regex.o
396 REGEXPDEPS = $(REGEXPOBJ) $(srcdir)/../src/regex.h
397
398 regex.o: $(srcdir)/../src/regex.c $(srcdir)/../src/regex.h ../src/config.h
399 ${CC} -c ${BASE_CFLAGS} -DCONFIG_BROKETS -DINHIBIT_STRING_HEADER ${srcdir}/../src/regex.c
400
401 etags${EXEEXT}: ${srcdir}/etags.c $(GETOPTDEPS) $(REGEXPDEPS) ../src/config.h
402 $(CC) ${ALL_CFLAGS} -DEMACS_NAME="\"GNU Emacs\"" -DVERSION="\"${version}\"" ${srcdir}/etags.c $(GETOPTOBJS) $(REGEXPOBJ) $(LOADLIBES) -o etags
403
404 ebrowse${EXEEXT}: ${srcdir}/ebrowse.c $(GETOPTDEPS) ../src/config.h
405 $(CC) ${ALL_CFLAGS} -DVERSION="\"${version}\"" ${srcdir}/ebrowse.c $(GETOPTOBJS) $(LOADLIBES) -o ebrowse
406
407 /* We depend on etags to assure that parallel makes don\'t write two
408 etags.o files on top of each other. */
409 ctags${EXEEXT}: etags${EXEEXT}
410 $(CC) ${ALL_CFLAGS} -DCTAGS -DEMACS_NAME="\"GNU Emacs\"" -DVERSION="\"${version}\"" ${srcdir}/etags.c $(GETOPTOBJS) $(REGEXPOBJ) $(LOADLIBES) -o ctags
411
412 profile${EXEEXT}: ${srcdir}/profile.c ../src/config.h
413 $(CC) ${ALL_CFLAGS} ${srcdir}/profile.c $(LOADLIBES) -o profile
414
415 make-docfile${EXEEXT}: ${srcdir}/make-docfile.c ../src/config.h
416 $(CC) ${ALL_CFLAGS} ${srcdir}/make-docfile.c $(LOADLIBES) -o make-docfile
417
418 digest-doc${EXEEXT}: ${srcdir}/digest-doc.c
419 $(CC) ${ALL_CFLAGS} ${srcdir}/digest-doc.c $(LOADLIBES) -o digest-doc
420
421 sorted-doc${EXEEXT}: ${srcdir}/sorted-doc.c
422 $(CC) ${ALL_CFLAGS} ${srcdir}/sorted-doc.c $(LOADLIBES) -o sorted-doc
423
424 b2m${EXEEXT}: ${srcdir}/b2m.c ../src/config.h $(GETOPTDEPS)
425 $(CC) ${ALL_CFLAGS} ${srcdir}/b2m.c -DVERSION="\"${version}\"" \
426 $(GETOPTOBJS) $(LOADLIBES) -o b2m
427
428 movemail${EXEEXT}: movemail.o pop.o $(GETOPTDEPS)
429 $(CC) ${LINK_CFLAGS} ${MOVE_FLAGS} movemail.o pop.o $(GETOPTOBJS) $(LOADLIBES) $(LIBS_MAIL) $(LIBS_MOVE) -o movemail
430
431 movemail.o: ${srcdir}/movemail.c ../src/config.h $(GETOPT_H)
432 $(CC) -c ${CPP_CFLAGS} -Demacs ${MOVE_FLAGS} ${srcdir}/movemail.c
433
434 pop.o: ${srcdir}/pop.c ../src/config.h
435 $(CC) -c ${CPP_CFLAGS} ${MOVE_FLAGS} ${srcdir}/pop.c
436
437 cvtmail${EXEEXT}: ${srcdir}/cvtmail.c
438 $(CC) ${ALL_CFLAGS} ${srcdir}/cvtmail.c $(LOADLIBES) -o cvtmail
439
440 fakemail${EXEEXT}: ${srcdir}/fakemail.c ../src/config.h
441 $(CC) ${ALL_CFLAGS} ${srcdir}/fakemail.c $(LOADLIBES) -o fakemail
442
443 emacsclient${EXEEXT}: ${srcdir}/emacsclient.c ../src/config.h $(GETOPTDEPS)
444 $(CC) ${ALL_CFLAGS} ${srcdir}/emacsclient.c $(GETOPTOBJS) \
445 -DVERSION="\"${version}\"" \
446 $(LOADLIBES) -o emacsclient
447
448 hexl${EXEEXT}: ${srcdir}/hexl.c ../src/config.h
449 $(CC) ${ALL_CFLAGS} ${srcdir}/hexl.c $(LOADLIBES) -o hexl
450
451 update-game-score${EXEEXT}: update-game-score.o $(GETOPTDEPS)
452 $(CC) ${LINK_CFLAGS} ${MOVE_FLAGS} update-game-score.o $(GETOPTOBJS) $(LOADLIBES) -o update-game-score
453
454 update-game-score.o: ${srcdir}/update-game-score.c ../src/config.h $(GETOPT_H)
455 $(CC) -c ${CPP_CFLAGS} ${srcdir}/update-game-score.c \
456 -DHAVE_SHARED_GAME_DIR="\"$(gamedir)\""
457
458 mac-fix-env: ${srcdir}/mac-fix-env.m
459 $(CC) -o mac-fix-env ${srcdir}/mac-fix-env.m -prebind -framework Foundation