1 ## Makefile for src subdirectory in XEmacs.
2 ## Copyright (C) 1985, 1987, 1988, 1993, 1994 Free Software Foundation, Inc.
3 ## Copyright (C) 1994, 1995 Board of Trustees, University of Illinois
4 ## Copyright (C) 1996, 1997 Sun Microsystems, Inc.
6 ## This file is part of XEmacs.
8 ## XEmacs is free software; you can redistribute it and/or modify it
9 ## under the terms of the GNU General Public License as published by the
10 ## Free Software Foundation; either version 2, or (at your option) any
13 ## XEmacs is distributed in the hope that it will be useful, but WITHOUT
14 ## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 ## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
18 ## You should have received a copy of the GNU General Public License
19 ## along with XEmacs; see the file COPYING. If not, write to
20 ## the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21 ## Boston, MA 02111-1307, USA.
23 ## Synched up with: Not synched with FSF.
28 .PHONY : all release dump-elc dump-elcs all-elc all-elcs lint
30 ## For performance and consistency, no built-in rules.
32 .SUFFIXES: .c .h .o .i .s .dep
38 lispdir = ${srcdir}/../lisp/
42 ## Here are the things that we expect ../configure to edit.
52 RECURSIVE_MAKE=@RECURSIVE_MAKE@
54 c_switch_all=@c_switch_all@
55 ld_switch_all=@ld_switch_all@
56 ld_libs_all=@ld_libs_all@
57 ld_dynamic_link_flags=@ld_dynamic_link_flags@
59 extra_objs=@extra_objs@
62 ld_switch_shared=@ld_switch_shared@
63 start_files=@start_files@
64 start_flags=@start_flags@
67 ##libmcheck=@libmcheck@
72 ## With the traditional VPATH setting, it is not possible to
73 ## simultaneously compile in-place and in another directory. The
74 ## mistaken definition is that *all* dependencies are searched for in
75 ## the VPATH directory, rather than just the dependencies that are not
76 ## themselves targets. Thus, if there is an up-to-date .o file in the
77 ## in-place location, it will not get recompiled in the not-in-place
80 ## The GNU Make "vpath" directive continues this tradition, but at
81 ## least lets you restrict the classes of files that it applies to.
82 ## This allows us to kludge around the problem.
87 ## now list files that should NOT be searched in the srcdir.
88 ## This includes any .c or .h built from something else
93 vpath puresize-adjust.h
101 #ifdef HAVE_NATIVE_SOUND
102 sound_cflags=@sound_cflags@
105 LWLIB_SRCDIR = ${srcdir}/../lwlib
107 #ifdef HAVE_X_WINDOWS
108 lwlib_libs = ../lwlib/liblw.a
109 lwlib_deps = $(lwlib_libs)
111 cd ../lwlib && $(RECURSIVE_MAKE)
113 x_objs=balloon_help.o balloon-x.o console-x.o device-x.o event-Xt.o frame-x.o\
114 glyphs-x.o objects-x.o redisplay-x.o xgccache.o xselect.o
120 X11_libs = $(LIBI18N)
121 #endif /* HAVE_X_WINDOWS */
127 ## -Demacs is needed to make some files produce the correct version
130 cppflags = $(CPPFLAGS) -Demacs -I. $(c_switch_all)
131 cflags = $(CFLAGS) $(cppflags)
132 ldflags = $(LDFLAGS) $(ld_switch_all) $(ld_dynamic_link_flags)
139 $(CC) -c $(cflags) $<
141 ## Create preprocessor output (debugging purposes only)
144 $(CC) -E $(cppflags) -o $@ $<
145 #else /* works on Solaris; what about other systems? */
146 $(CC) -P $(cppflags) $<
147 #endif /* compiler */
149 ## Create assembler output (debugging purposes only)
151 $(CC) -S -c $(cflags) $<
155 $(CC) -dr -c $(cflags) $<
157 ## lastfile must follow all files whose initialized data areas should
158 ## be dumped as pure by dump-emacs.
160 ## NOTE: The last line cannot be all macros, because make will barf
161 ## if they all come out null.
164 abbrev.o alloc.o blocktype.o buffer.o bytecode.o\
165 callint.o callproc.o casefiddle.o casetab.o chartab.o\
166 cmdloop.o cmds.o console.o console-stream.o\
167 data.o device.o dired.o doc.o doprnt.o dynarr.o\
168 editfns.o elhash.o emacs.o\
169 eval.o events.o $(extra_objs)\
170 event-stream.o extents.o faces.o\
171 fileio.o $(LOCK_OBJ) filemode.o floatfns.o fns.o font-lock.o\
172 frame.o general.o getloadavg.o glyphs.o glyphs-eimage.o\
173 $(gui_objs) hash.o imgproc.o indent.o insdel.o intl.o\
174 keymap.o $(RTC_patch_objs) line-number.o lread.o lstream.o\
175 macros.o marker.o md5.o minibuf.o objects.o opaque.o\
176 print.o process.o profile.o pure.o\
177 rangetab.o redisplay.o redisplay-output.o regex.o\
178 search.o $(sheap_obj) signal.o sound.o\
179 specifier.o strftime.o symbols.o syntax.o sysdep.o\
180 undo.o $(x_objs) widget.o window.o
182 obj_rtl = $(objs:.o=.c.rtl)
185 rallocdocsrc = ralloc.c
186 rallocobjs = ralloc.o
189 malloclib = $(libmcheck)
190 #ifndef SYSTEM_MALLOC
191 # ifdef GNU_MALLOC /* GNU malloc */
192 # ifdef ERROR_CHECK_MALLOC
193 #ifdef DOUG_LEA_MALLOC
194 mallocobjs = free-hook.o vm-limit.o
196 mallocobjs = gmalloc.o free-hook.o vm-limit.o
198 mallocdocsrc = free-hook.c
199 # else /* New GNU malloc, sans error checking */
200 #ifdef DOUG_LEA_MALLOC
201 mallocobjs = vm-limit.o
203 mallocobjs = gmalloc.o vm-limit.o
206 # endif /* ERROR_CHECK_MALLOC */
207 # else /* Older GNU malloc */
208 mallocobjs = malloc.o
210 # endif /* Older GNU malloc */
211 #else /* SYSTEM_MALLOC */
214 #ifdef USE_DEBUG_MALLOC
215 malloclib = -ldmalloc
216 #endif /* USE_DEBUG_MALLOC */
217 #endif /* SYSTEM_MALLOC */
219 #ifdef HAVE_X_WINDOWS
221 # ifdef EXTERNAL_WIDGET
222 external_widget_objs = ExternalShell.o extw-Xt-nonshared.o extw-Xlib-nonshared.o
224 ## Now we try to figure out how to link a shared library.
225 ## If we cannot figure it out, leave EXTW_LINK undefined and a shared
226 ## library will not be created.
230 # define EXTW_LINK(objs, output) $(CC) -shared objs -Xlinker -z -Xlinker text -o output
231 extw_link_beg = $(CC) -shared
232 extw_link_mid = -Xlinker -z -Xlinker text -o
234 ## I cannot figure out how to do shared a.out libraries, so just punt.
235 # elif !defined (LINUX) || defined (__ELF__)
236 # define EXTW_LINK(objs, output) $(CC) -shared objs -o output
237 extw_link_beg = $(CC) -shared
241 # elif defined (USG5)
243 # define EXTW_LINK(objs, output) $(LD) -shared -g -check_registry ${TOOLROOT}/usr/lib/so_locations objs -o output
244 extw_link_beg = $(LD) -shared -g -check_registry ${TOOLROOT}/usr/lib/so_locations
247 # else /* not IRIX */
248 # define EXTW_LINK(objs, output) $(CC) -G objs -z text -o output
249 extw_link_beg = $(CC) -G
250 extw_link_mid = -z text -o
252 # endif /* not IRIX */
253 # else /* not USG5 */
254 # if defined (DEC_ALPHA) && defined (OSF1)
255 # define EXTW_LINK(objs, output) $(LD) $(ldflags) $(ld_switch_shared) -d objs -o output $(LIBES)
256 extw_link_beg = $(LD) $(ldflags) $(ld_switch_shared) -d
258 extw_link_end = $(LIBES)
259 # else /* !(DEC_ALPHA && OSF1) */
260 # define EXTW_LINK(objs, output) $(LD) -dc objs -assert pure-text -o output
261 extw_link_beg = $(LD) -dc
262 extw_link_mid = -assert pure-text -o
264 # endif /* !(DEC_ALPHA && OSF1) */
265 # endif /* not USG5 */
267 # ifdef LWLIB_USES_MOTIF
269 motif_other_files = libextcli_Xm.a libextcli_Xm.so.1
271 motif_other_files = libextcli_Xm.a
273 #endif /* LWLIB_USES_MOTIF */
276 shared_other_files = libextcli_Xt.so.1 libextcli_Xlib.so.1
279 ${motif_other_files}\
280 libextcli_Xt.a libextcli_Xlib.a\
281 ${shared_other_files}
284 # endif /* EXTERNAL_WIDGET */
286 # if defined (HAVE_OFFIX_DND) || defined (HAVE_CDE)
287 dnd_objs = @dnd_objs@
288 # endif /* HAVE_OFFIX_DND || HAVE_CDE */
290 X11_objs = EmacsFrame.o EmacsShell.o TopLevelEmacsShell.o TransientEmacsShell.o EmacsManager.o $(external_widget_objs) $(dnd_objs)
291 #endif /* HAVE_X_WINDOWS */
293 ## define otherobjs as list of object files that make-docfile
294 ## should not be told about.
295 otherobjs = $(BTL_objs) lastfile.o $(mallocobjs) $(rallocobjs) $(X11_objs)
296 otherrtls = $(otherobjs:.o=.c.rtl)
297 othersrcs = $(otherobjs:.o=.c)
299 LIBES = $(lwlib_libs) $(quantify_libs) $(malloclib) $(ld_libs_all) $(lib_gcc)
303 mo_file = ${mo_dir}emacs.mo
306 LOADPATH = EMACSBOOTSTRAPLOADPATH="${lispdir}:${blddir}"
307 DUMPENV = $(LOADPATH)
309 release: temacs ${libsrc}DOC $(mo_file) ${other_files}
311 ln temacs ${PROGNAME}
314 -if [ -w ${srcdir}/../lisp ]; then \
315 w=`pwd`; cd ${srcdir} && $${w}/temacs -nl -batch -l ${srcdir}/../lisp/inc-vers; \
318 -$(DUMPENV) ./temacs -nl -batch -l ${srcdir}/../lisp/loadup.el dump
319 @if test ! -f SATISFIED; then $(RECURSIVE_MAKE) $@; fi
321 #else /* ! defined (HAVE_SHM) */
322 -if [ -w ${srcdir}/../lisp ]; then \
323 w=`pwd`; cd ${srcdir} && $${w}/temacs -batch -l ${srcdir}/../lisp/inc-vers; \
326 -$(DUMPENV) ./temacs -batch -l ${srcdir}/../lisp/loadup.el dump
327 @if test ! -f SATISFIED; then $(RECURSIVE_MAKE) $@; fi
329 #endif /* ! defined (HAVE_SHM) */
331 #endif /* ! defined (CANNOT_DUMP) */
333 ${PROGNAME}: temacs ${libsrc}DOC $(mo_file) ${other_files} update-elc.stamp
334 @$(RM) $@ && touch SATISFIED
335 -$(DUMPENV) ./temacs -batch -l ${srcdir}/../lisp/loadup.el dump
336 @if test -f $@; then if test -f SATISFIED; then \
337 echo "Testing for Lisp shadows ..."; \
338 ./${PROGNAME} -batch -vanilla -f list-load-path-shadows; fi; \
339 $(RM) SATISFIED; exit 0; fi; \
340 if test -f SATISFIED; then $(RM) SATISFIED; exit 1; fi; \
341 $(RECURSIVE_MAKE) $@;
344 @$(RM) ${PROGNAME} && touch SATISFIED
345 -$(DUMPENV) ./temacs -batch -l ${srcdir}/../lisp/loadup.el dump
346 @if test -f ${PROGNAME}; then if test -f SATISFIED; then \
347 ./${PROGNAME} -batch -vanilla -f list-load-path-shadows; fi; \
348 $(RM) SATISFIED; exit 0; fi; \
349 if test -f SATISFIED; then $(RM) SATISFIED; exit 1; fi;
351 FRC.update-elc.stamp :
353 update-elc.stamp : temacs FRC.update-elc.stamp
355 ${DUMPENV} ./temacs -batch -l ${srcdir}/../lisp/update-elc.el
356 @if test ! -f $@ -o -f NOBYTECOMPILE; then touch $@; fi; \
359 obj_src = $(objs:.o=.c)
361 dortl : $(obj_rtl) $(otherrtls)
362 echo "(defvar source-files '(" > ${srcdir}/../lisp/source-files.el
363 (for a in $(obj_src) $(othersrcs);do \
364 echo -n "\""$$a"\"" >> ${srcdir}/../lisp/source-files.el ;\
366 echo "))" >> ${srcdir}/../lisp/source-files.el
369 dynodump_deps = ../dynodump/dynodump.so
370 ../dynodump/dynodump.so:
371 cd ../dynodump && $(RECURSIVE_MAKE)
372 #endif /* DYNODUMP */
374 ${libsrc}DOC: temacs update-elc.stamp
375 $(RM) ${libsrc}DOC; \
376 ${DUMPENV} ./temacs -batch -l ${srcdir}/../lisp/make-docfile.el -- \
377 -o ${libsrc}DOC -d ${srcdir} -i ${libsrc}../site-packages \
378 ${obj_src} ${mallocdocsrc} ${rallocdocsrc}
383 -${DUMPENV} ./temacs -batch -l ${srcdir}/../lisp/update-elc.el
386 cd .. && $(RECURSIVE_MAKE) all-elc
390 # if defined(SPARC) && !defined(USG)
391 xgettext= /usr/openwin/bin/xgettext
392 xgettext_args= -o emacs -m_X messages
393 msgfmt= /usr/openwin/bin/msgfmt
396 xgettext_args= -s -d emacs -M_X messages
400 ${mo_dir}emacs.po: ${libsrc}make-msgfile ${libsrc}make-po ${objs}
401 ${libsrc}make-msgfile -o ${libsrc}messages ${objs}
402 cd ${libsrc} && ${xgettext} ${xgettext_args}
403 $(RM) ${mo_dir}emacs.po
404 cd ${libsrc} && ${libsrc}make-po -a ${mo_dir}emacs.po DOC
406 ${mo_dir}emacs.mo: ${mo_dir}emacs.po
407 cd ${mo_dir} && ${msgfmt} -o emacs.mo emacs.po
409 ${libsrc}make-msgfile:
410 cd ${libsrc} && $(RECURSIVE_MAKE) make-msgfile
413 cd ${libsrc} && $(RECURSIVE_MAKE) make-po
417 ${libsrc}make-docfile:
418 cd ${libsrc} && $(RECURSIVE_MAKE) make-docfile
421 LINT.c=$(LINT) $(LINTFLAGS) $(LINTINCLUDES)
422 LINTFILES= $(objs:.o=.ln)
423 LINTINCLUDES = $(cppflags)
424 ## LINTFLAGS= -fd -m -p -s -u -v -x
425 LINTFLAGS= -fd -m -s -u -v -x
427 $(LINT.c) $(LINTFILES)
428 ## end of Lint Section
431 $(start_files) ${objs} ${otherobjs}\
432 $(lwlib_deps) $(dynodump_deps)
435 ${start_flags} ${ldflags}\
436 -o $@ ${start_files} ${objs} ${otherobjs} ${LIBES}
438 temacs: $(temacs_deps)
439 $(LD) $(temacs_link_args)
444 -$(DUMPENV) ./temacs -batch -l ${srcdir}/../lisp/loadup.el run-temacs
446 ## Debugging targets:
448 ## RTC is Sun WorkShop's Run Time Checking
450 ## Purify, Quantify, PureCoverage are software quality products from
451 ## Rational, formerly Pure Atria, formerly Pure Software.
453 ## None of these products work with a dumped xemacs binary, because it
454 ## does unexpected things like free memory that has been malloc'ed in
455 ## a *different* process!! So we need to run these on temacs.
458 .PHONY : run-rtcmacs run-puremacs run-quantmacs
463 rtcmacs: $(temacs_deps) rtc_patch.o
464 $(RM) temacs; $(RECURSIVE_MAKE) temacs RTC_patch_objs=rtc_patch.o
469 'dbxenv rtc_error_log_file_name /dev/fd/1; \
470 dbxenv suppress_startup_message 5.0; \
474 runargs -batch -l ${srcdir}/../lisp/loadup.el run-temacs -q; \
479 PURIFY_FLAGS=-chain-length=32 -ignore-signals=SIGPOLL -threads=yes \
480 -cache-dir=./purecache -always-use-cache-dir=yes -pointer-mask=0x0fffffff
481 puremacs: $(temacs_deps)
482 $(PURIFY_PROG) $(PURIFY_FLAGS) $(LD) $(temacs_link_args) -lpthread
484 run-puremacs: puremacs
485 -$(DUMPENV) ./puremacs -batch -l ${srcdir}/../lisp/loadup.el run-temacs
489 quantify_prog = quantify
490 quantify_flags = -windows=no -record-data=no
491 quantify_includes = -I/local/include
492 quantify_libs = /local/lib/quantify_stubs.a
494 quantmacs: $(temacs_deps)
495 $(quantify_prog) $(quantify_flags) $(LD) $(temacs_link_args)
496 #endif /* QUANTIFY */
499 covmacs: $(temacs_deps)
500 $(PURECOV_PROG) $(LD) $(temacs_link_args)
503 TopLevelEmacsShell.o : ${srcdir}/EmacsShell-sub.c config.h xintrinsicp.h EmacsShellP.h
504 $(CC) -c $(cflags) -DDEFINE_TOP_LEVEL_EMACS_SHELL ${srcdir}/EmacsShell-sub.c
505 mv EmacsShell-sub.o TopLevelEmacsShell.o
507 TopLevelEmacsShell.c.rtl : ${srcdir}/EmacsShell-sub.c config.h xintrinsicp.h EmacsShellP.h
508 $(CC) -dr -c $(cflags) -DDEFINE_TOP_LEVEL_EMACS_SHELL ${srcdir}/EmacsShell-sub.c
509 mv EmacsShell-sub.c.rtl TopLevelEmacsShell.c.rtl
511 TransientEmacsShell.o : ${srcdir}/EmacsShell-sub.c TopLevelEmacsShell.o config.h xintrinsicp.h EmacsShellP.h
512 $(CC) -c $(cflags) -DDEFINE_TRANSIENT_EMACS_SHELL ${srcdir}/EmacsShell-sub.c
513 mv EmacsShell-sub.o TransientEmacsShell.o
515 TransientEmacsShell.c.rtl : ${srcdir}/EmacsShell-sub.c TopLevelEmacsShell.o config.h xintrinsicp.h EmacsShellP.h
516 $(CC) -dr -c $(cflags) -DDEFINE_TRANSIENT_EMACS_SHELL ${srcdir}/EmacsShell-sub.c
517 mv EmacsShell-sub.c.rtl TransientEmacsShell.c.rtl
519 ## Position-independent code for shared library creation
528 #ifdef EXTERNAL_WIDGET
530 external_client_motif_objs_shared = ExternalClient-Xm-shared.o extw-Xt-shared.o extw-Xlib-shared.o
531 external_client_xt_objs_shared = ExternalClient-Xt-shared.o extw-Xt-shared.o extw-Xlib-shared.o
532 external_client_xlib_objs_shared = ExternalClient-Xlib-shared.o extw-Xlib-shared.o
533 external_client_motif_objs_nonshared = ExternalClient-Xm-nonshared.o extw-Xt-nonshared.o extw-Xlib-nonshared.o
534 external_client_xt_objs_nonshared = ExternalClient-Xt-nonshared.o extw-Xt-nonshared.o extw-Xlib-nonshared.o
535 external_client_xlib_objs_nonshared = ExternalClient-Xlib-nonshared.o extw-Xlib-nonshared.o
537 ## Add dependencies so things work right with a parallel make
538 ExternalClient-Xm-shared.o: ${srcdir}/ExternalClient.c ExternalClient-Xt-shared.o ExternalClient-Xm-nonshared.o
539 $(CC) -c $(pic_arg) $(cflags) -DEXTW_USES_MOTIF ${srcdir}/ExternalClient.c
540 mv ExternalClient.o ExternalClient-Xm-shared.o
542 ExternalClient-Xt-shared.o: ${srcdir}/ExternalClient.c ExternalClient-Xt-nonshared.o
543 $(CC) -c $(pic_arg) $(cflags) ${srcdir}/ExternalClient.c
544 mv ExternalClient.o ExternalClient-Xt-shared.o
546 ExternalClient-Xlib-shared.o: ${srcdir}/ExternalClient-Xlib.c ExternalClient-Xlib-nonshared.o
547 $(CC) -c $(pic_arg) $(cflags) ${srcdir}/ExternalClient-Xlib.c
548 mv ExternalClient-Xlib.o ExternalClient-Xlib-shared.o
550 ExternalClient-Xm-nonshared.o: ${srcdir}/ExternalClient.c ExternalClient-Xt-nonshared.o
551 $(CC) -c $(cflags) -DEXTW_USES_MOTIF ${srcdir}/ExternalClient.c
552 mv ExternalClient.o ExternalClient-Xm-nonshared.o
554 ExternalClient-Xt-nonshared.o: ${srcdir}/ExternalClient.c
555 $(CC) -c $(cflags) ${srcdir}/ExternalClient.c
556 mv ExternalClient.o ExternalClient-Xt-nonshared.o
558 ExternalClient-Xlib-nonshared.o: ${srcdir}/ExternalClient-Xlib.c
559 $(CC) -c $(cflags) ${srcdir}/ExternalClient-Xlib.c
560 mv ExternalClient-Xlib.o ExternalClient-Xlib-nonshared.o
562 ## We compile the common files twice (once with PIC and once without)
563 ## because on some systems, compiling with PIC but not linking into
564 ## a shared library messes things up.
566 extw-Xt-shared.o: ${srcdir}/extw-Xt.c extw-Xt-nonshared.o
567 $(CC) -c $(pic_arg) $(cflags) ${srcdir}/extw-Xt.c
568 mv extw-Xt.o extw-Xt-shared.o
570 extw-Xlib-shared.o: ${srcdir}/extw-Xlib.c extw-Xlib-nonshared.o
571 $(CC) -c $(pic_arg) $(cflags) ${srcdir}/extw-Xlib.c
572 mv extw-Xlib.o extw-Xlib-shared.o
574 extw-Xt-nonshared.o: ${srcdir}/extw-Xt.c
575 $(CC) -c $(cflags) ${srcdir}/extw-Xt.c
576 mv extw-Xt.o extw-Xt-nonshared.o
578 extw-Xlib-nonshared.o: ${srcdir}/extw-Xlib.c
579 $(CC) -c $(cflags) ${srcdir}/extw-Xlib.c
580 mv extw-Xlib.o extw-Xlib-nonshared.o
582 libextcli_Xm.a: ${external_client_motif_objs_nonshared}
583 ar r libextcli_Xm.a ${external_client_motif_objs_nonshared}
585 libextcli_Xt.a: ${external_client_xt_objs_nonshared}
586 ar r libextcli_Xt.a ${external_client_xt_objs_nonshared}
588 libextcli_Xlib.a: ${external_client_xlib_objs_nonshared}
589 ar r libextcli_Xlib.a ${external_client_xlib_objs_nonshared}
593 libextcli_Xm.so.1: ${external_client_motif_objs_shared}
594 ${extw_link_beg} ${external_client_motif_objs_shared} ${extw_link_mid} libextcli_Xm.so.1 ${extw_link_end}
596 libextcli_Xt.so.1: ${external_client_xt_objs_shared}
597 ${extw_link_beg} ${external_client_xt_objs_shared} ${extw_link_mid} libextcli_Xt.so.1 ${extw_link_end}
599 libextcli_Xlib.so.1: ${external_client_xlib_objs_shared}
600 ${extw_link_beg} ${external_client_xlib_objs_shared} ${extw_link_mid} libextcli_Xlib.so.1 ${extw_link_end}
602 #endif /* EXTW_LINK */
604 #endif /* EXTERNAL_WIDGET */
606 config.h: ${srcdir}/config.h.in
607 puresize-adjust.h: ${srcdir}/puresize.h
608 Emacs.ad.h: ${srcdir}/${etcdir}Emacs.ad
610 config.h puresize-adjust.h sheap-adjust.h paths.h Emacs.ad.h :
611 @echo "The file $@ needs to be re-generated."
612 @echo "Please run a make in the top level directory."
613 @echo "Consult the file \`INSTALL' for instructions for building XEmacs."
616 ## Some machines have alloca built-in.
617 ## They should define HAVE_ALLOCA, or may just let alloca.s
618 ## be used but generate no code.
619 ## Some have it written in assembler in alloca.s.
620 ## Some use the C version in alloca.c (these define C_ALLOCA in config.h).
624 ## We could put something in alloca.c to #define free and malloc
625 ## whenever emacs was #defined, but that's not appropriate for all
626 ## users of alloca in Emacs. Check out ../lib-src/getopt.c. */
628 alloca.o : ${srcdir}/alloca.c
629 $(CC) -c -Dfree=xfree -Dmalloc=xmalloc $(cflags) ${srcdir}/alloca.c
632 alloca.o : ${srcdir}/alloca.s config.h
633 ## $(CPP) is cc -E, which may get confused by filenames
634 ## that do not end in .c. So copy file to a safe name. */
635 ## cp ${srcdir}/alloca.s allocatem.c
636 ## Remove any ^L, blank lines, and preprocessor comments,
637 ## since some assemblers barf on them. Use a different basename for the
638 ## output file, since some stupid compilers (Green Hill) use that
639 ## name for the intermediate assembler file.
640 $(CPP) $(cppflags) allocatem.c | \
641 sed -e 's/
\f//' -e 's/^#.*//' | \
642 sed -n -e '/^..*$$/p' > allocax.s
644 ## Xenix, in particular, needs to run assembler via cc.
646 mv allocax.o alloca.o
647 $(RM) allocax.s allocatem.c
648 #endif /* HAVE_ALLOCA */
649 #endif /* ! defined (C_ALLOCA) */
652 BTL_includes = -I$(BTL_dir)
653 BTL_compile = -DEMACS_BTL -D`lucid-arch` -I. $(BTL_includes) $(BTL_dir)/$(@:.o=.c)
655 cadillac-btl.o cadillac-btl-process.o cadillac-btl-emacs.o:
656 $(CC) $(CFLAGS) -c $(BTL_compile)
658 $(CC) $(CFLAGS) -c $(BTL_compile)
659 #endif /* EMACS_BTL */
661 #ifdef HAVE_NATIVE_SOUND
662 sunplay.o: ${srcdir}/sunplay.c
663 $(CC) -c $(sound_cflags) $(cflags) ${srcdir}/sunplay.c
664 hpplay.o: ${srcdir}/hpplay.c
665 $(CC) -c -Demacs $(sound_cflags) $(cflags) ${srcdir}/hpplay.c
666 #endif /* HAVE_NATIVE_SOUND */
668 ## System-specific programs to be made.
669 ## ${other_files}, $(objects_system) and $(objects_machine)
670 ## select which of these should be compiled. */
672 .PHONY: mostlyclean clean distclean realclean versionclean extraclean
674 $(RM) temacs puremacs quantmacs prefix-args *.o *.i \
675 core temacs.exe puresize-adjust.h sheap-adjust.h
676 clean: mostlyclean versionclean
677 $(RM) libextcli* update-elc.stamp
678 ## This is used in making a distribution.
679 ## Do not use it on development directories!
681 $(RM) config.h paths.h Emacs.ad.h \
682 Makefile Makefile.in TAGS ${PROGNAME}.*
685 $(RM) ${PROGNAME} ${PROGNAME}.exe ${libsrc}DOC
686 extraclean: realclean
687 $(RM) *~ \#* m/*~ m/\#* s/*~ s/\#*
690 SOURCES = *.[chm] *.pswm [sm]/* COPYING paths.h.in Makefile.in.in \
691 config.h.in README COPYING ChangeLog
698 ## Dependency processing using home-grown script, not makedepend
700 $(RM) ${srcdir}/depend depend.tmp
701 perl ${srcdir}/make-src-depend > depend.tmp
702 mv depend.tmp ${srcdir}/depend