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.
5 ## Copyright (C) 1998, 1999 J. Kean Johnston.
7 ## This file is part of XEmacs.
9 ## XEmacs is free software; you can redistribute it and/or modify it
10 ## under the terms of the GNU General Public License as published by the
11 ## Free Software Foundation; either version 2, or (at your option) any
14 ## XEmacs is distributed in the hope that it will be useful, but WITHOUT
15 ## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
16 ## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19 ## You should have received a copy of the GNU General Public License
20 ## along with XEmacs; see the file COPYING. If not, write to
21 ## the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
22 ## Boston, MA 02111-1307, USA.
24 ## Synched up with: Not synched with FSF.
29 .PHONY : all release dump-elc dump-elcs all-elc all-elcs lint
31 ## For performance and consistency, no built-in rules.
33 .SUFFIXES: .c .h .o .i .s .dep
36 RECURSIVE_MAKE=$(MAKE)
39 RECURSIVE_MAKE=@RECURSIVE_MAKE@
45 lispdir = ${srcdir}/../lisp/
46 moduledir = ${srcdir}/../modules/
50 ## Here are the things that we expect ../configure to edit.
61 c_switch_all=@c_switch_all@
62 ld_switch_all=@ld_switch_all@
63 ld_libs_all=@ld_libs_all@
64 ld_dynamic_link_flags=@ld_dynamic_link_flags@
66 extra_objs=@extra_objs@
69 ld_switch_shared=@ld_switch_shared@
70 start_files=@start_files@
71 start_flags=@start_flags@
74 ##libmcheck=@libmcheck@
79 ## With the traditional VPATH setting, it is not possible to
80 ## simultaneously compile in-place and in another directory. The
81 ## mistaken definition is that *all* dependencies are searched for in
82 ## the VPATH directory, rather than just the dependencies that are not
83 ## themselves targets. Thus, if there is an up-to-date .o file in the
84 ## in-place location, it will not get recompiled in the not-in-place
87 ## The GNU Make "vpath" directive continues this tradition, but at
88 ## least lets you restrict the classes of files that it applies to.
89 ## This allows us to kludge around the problem.
94 ## now list files that should NOT be searched in the srcdir.
95 ## This includes any .c or .h built from something else
107 #ifdef HAVE_NATIVE_SOUND
108 sound_cflags=@sound_cflags@
111 LWLIB_SRCDIR = ${srcdir}/../lwlib
113 #ifdef HAVE_X_WINDOWS
114 lwlib_libs = ../lwlib/liblw.a
115 lwlib_deps = $(lwlib_libs)
117 cd ../lwlib && $(RECURSIVE_MAKE)
119 x_objs=balloon_help.o balloon-x.o console-x.o device-x.o event-Xt.o frame-x.o\
120 glyphs-x.o objects-x.o redisplay-x.o select-x.o xgccache.o
126 X11_libs = $(LIBI18N)
127 #endif /* HAVE_X_WINDOWS */
133 ## -Demacs is needed to make some files produce the correct version
136 cppflags = $(CPPFLAGS) -Demacs -I. $(c_switch_all)
137 cflags = $(CFLAGS) $(cppflags)
138 ldflags = $(LDFLAGS) $(ld_switch_all) $(ld_dynamic_link_flags)
145 $(CC) -c $(cflags) $<
147 ## Create preprocessor output (debugging purposes only)
150 $(CC) -E $(cppflags) -o $@ $<
151 #else /* works on Solaris; what about other systems? */
152 $(CC) -P $(cppflags) $<
153 #endif /* compiler */
155 ## Create assembler output (debugging purposes only)
157 $(CC) -S -c $(cflags) $<
161 $(CC) -dr -c $(cflags) $<
163 ## lastfile must follow all files whose initialized data areas should
164 ## be dumped as pure by dump-emacs.
166 ## NOTE: The last line cannot be all macros, because make will barf
167 ## if they all come out null.
170 abbrev.o alloc.o blocktype.o buffer.o bytecode.o\
171 callint.o callproc.o casefiddle.o casetab.o chartab.o\
172 cmdloop.o cmds.o console.o console-stream.o\
173 data.o device.o dired.o doc.o doprnt.o dynarr.o\
174 editfns.o elhash.o emacs.o\
175 eval.o events.o $(extra_objs)\
176 event-stream.o extents.o faces.o\
177 fileio.o $(LOCK_OBJ) filemode.o floatfns.o fns.o font-lock.o\
178 frame.o general.o glyphs.o glyphs-eimage.o glyphs-widget.o\
179 gui.o gutter.o $(gui_objs) hash.o imgproc.o indent.o insdel.o intl.o\
180 keymap.o $(RTC_patch_objs) line-number.o lread.o lstream.o\
181 macros.o marker.o md5.o minibuf.o objects.o opaque.o\
182 print.o process.o profile.o\
183 rangetab.o redisplay.o redisplay-output.o regex.o\
184 search.o select.o $(sheap_obj) signal.o sound.o\
185 specifier.o strftime.o symbols.o syntax.o sysdep.o\
186 undo.o $(x_objs) widget.o window.o
188 obj_rtl = $(objs:.o=.c.rtl)
191 rallocdocsrc = ralloc.c
192 rallocobjs = ralloc.o
195 malloclib = $(libmcheck)
196 #ifndef SYSTEM_MALLOC
197 # ifdef GNU_MALLOC /* GNU malloc */
198 # ifdef ERROR_CHECK_MALLOC
199 #ifdef DOUG_LEA_MALLOC
200 mallocobjs = free-hook.o vm-limit.o
202 mallocobjs = gmalloc.o free-hook.o vm-limit.o
204 mallocdocsrc = free-hook.c
205 # else /* New GNU malloc, sans error checking */
206 #ifdef DOUG_LEA_MALLOC
207 mallocobjs = vm-limit.o
209 mallocobjs = gmalloc.o vm-limit.o
212 # endif /* ERROR_CHECK_MALLOC */
213 # else /* Older GNU malloc */
214 mallocobjs = malloc.o
216 # endif /* Older GNU malloc */
217 #else /* SYSTEM_MALLOC */
220 #ifdef USE_DEBUG_MALLOC
221 malloclib = -ldmalloc
222 #endif /* USE_DEBUG_MALLOC */
223 #endif /* SYSTEM_MALLOC */
225 #ifdef HAVE_X_WINDOWS
227 # ifdef EXTERNAL_WIDGET
228 external_widget_objs = ExternalShell.o extw-Xt-nonshared.o extw-Xlib-nonshared.o
230 ## Now we try to figure out how to link a shared library.
231 ## If we cannot figure it out, leave EXTW_LINK undefined and a shared
232 ## library will not be created.
236 # define EXTW_LINK(objs, output) $(CC) -shared objs -Xlinker -z -Xlinker text -o output
237 extw_link_beg = $(CC) -shared
238 extw_link_mid = -Xlinker -z -Xlinker text -o
240 ## I cannot figure out how to do shared a.out libraries, so just punt.
241 # elif !defined (LINUX) || defined (__ELF__)
242 # define EXTW_LINK(objs, output) $(CC) -shared objs -o output
243 extw_link_beg = $(CC) -shared
247 # elif defined (USG5)
249 # define EXTW_LINK(objs, output) $(LD) -shared -g -check_registry ${TOOLROOT}/usr/lib/so_locations objs -o output
250 extw_link_beg = $(LD) -shared -g -check_registry ${TOOLROOT}/usr/lib/so_locations
253 # else /* not IRIX */
254 # define EXTW_LINK(objs, output) $(CC) -G objs -z text -o output
255 extw_link_beg = $(CC) -G
256 extw_link_mid = -z text -o
258 # endif /* not IRIX */
259 # else /* not USG5 */
260 # if defined (DEC_ALPHA) && defined (OSF1)
261 # define EXTW_LINK(objs, output) $(LD) $(ldflags) $(ld_switch_shared) -d objs -o output $(LIBES)
262 extw_link_beg = $(LD) $(ldflags) $(ld_switch_shared) -d
264 extw_link_end = $(LIBES)
265 # else /* !(DEC_ALPHA && OSF1) */
266 # define EXTW_LINK(objs, output) $(LD) -dc objs -assert pure-text -o output
267 extw_link_beg = $(LD) -dc
268 extw_link_mid = -assert pure-text -o
270 # endif /* !(DEC_ALPHA && OSF1) */
271 # endif /* not USG5 */
273 # ifdef LWLIB_USES_MOTIF
275 motif_other_files = libextcli_Xm.a libextcli_Xm.so.1
277 motif_other_files = libextcli_Xm.a
279 #endif /* LWLIB_USES_MOTIF */
282 shared_other_files = libextcli_Xt.so.1 libextcli_Xlib.so.1
285 ${motif_other_files}\
286 libextcli_Xt.a libextcli_Xlib.a\
287 ${shared_other_files}
290 # endif /* EXTERNAL_WIDGET */
292 # if defined (HAVE_OFFIX_DND) || defined (HAVE_CDE)
293 dnd_objs = @dnd_objs@
294 # endif /* HAVE_OFFIX_DND || HAVE_CDE */
296 X11_objs = EmacsFrame.o EmacsShell.o TopLevelEmacsShell.o TransientEmacsShell.o EmacsManager.o $(external_widget_objs) $(dnd_objs)
297 #endif /* HAVE_X_WINDOWS */
299 ## define otherobjs as list of object files that make-docfile
300 ## should not be told about.
301 otherobjs = lastfile.o $(mallocobjs) $(rallocobjs) $(X11_objs)
302 otherrtls = $(otherobjs:.o=.c.rtl)
303 othersrcs = $(otherobjs:.o=.c)
305 LIBES = $(lwlib_libs) $(malloclib) $(ld_libs_all) $(lib_gcc)
309 mo_file = ${mo_dir}emacs.mo
313 LOADPATH = EMACSBOOTSTRAPLOADPATH="${lispdir};${blddir}"
314 MODULEPATH = EMACSBOOTSTRAPMODULEPATH="${moduledir};${blddir}"
316 LOADPATH = EMACSBOOTSTRAPLOADPATH="${lispdir}:${blddir}"
317 MODULEPATH = EMACSBOOTSTRAPMODULEPATH="${moduledir}:${blddir}"
319 DUMPENV = $(LOADPATH) $(MODULEPATH)
320 temacs_loadup = $(DUMPENV) ./temacs -batch -l ${srcdir}/../lisp/loadup.el
321 dump_temacs = ${temacs_loadup} dump
322 run_temacs = ${temacs_loadup} run-temacs
323 debug_temacs = $(DUMPENV) gdb temacs
325 release: temacs ${libsrc}DOC $(mo_file) ${other_files}
327 ln temacs ${PROGNAME}
329 -if [ -w ${srcdir}/../lisp ]; then \
330 w=`pwd`; cd ${srcdir} && $${w}/temacs -batch -l ${srcdir}/../lisp/inc-vers; \
332 -$(DUMPENV) ./temacs -batch -l ${srcdir}/../lisp/loadup.el dump
334 #endif /* ! defined (CANNOT_DUMP) */
336 ${PROGNAME}: temacs ${libsrc}DOC $(mo_file) ${other_files} update-elc.stamp
338 @$(RM) $@ $@.exe && touch SATISFIED
340 @if test -f $@; then if test -f SATISFIED; then \
341 echo "Testing for Lisp shadows ..."; \
342 ./${PROGNAME} -batch -vanilla -f list-load-path-shadows; fi; \
343 $(RM) SATISFIED; exit 0; fi; \
344 if test -f SATISFIED; then $(RM) SATISFIED; exit 1; fi; \
345 $(RECURSIVE_MAKE) $@;
352 @echo "Testing for Lisp shadows ..."
353 @./${PROGNAME} -batch -vanilla -f list-load-path-shadows
357 @$(RM) ${PROGNAME} && touch SATISFIED
359 @./${PROGNAME} -batch -vanilla -f list-load-path-shadows
361 FRC.update-elc.stamp :
363 update-elc.stamp : temacs FRC.update-elc.stamp
365 ${DUMPENV} ./temacs -batch -l ${srcdir}/../lisp/update-elc.el
366 @if test ! -f $@ -o -f NOBYTECOMPILE; then touch $@; fi; \
369 obj_src = $(objs:.o=.c)
371 dortl : $(obj_rtl) $(otherrtls)
372 echo "(defvar source-files '(" > ${srcdir}/../lisp/source-files.el
373 (for a in $(obj_src) $(othersrcs);do \
374 echo -n "\""$$a"\"" >> ${srcdir}/../lisp/source-files.el ;\
376 echo "))" >> ${srcdir}/../lisp/source-files.el
379 dynodump_deps = ../dynodump/dynodump.so
380 ../dynodump/dynodump.so:
381 cd ../dynodump && $(RECURSIVE_MAKE)
382 #endif /* DYNODUMP */
384 ${libsrc}DOC: temacs update-elc.stamp
385 $(RM) ${libsrc}DOC; \
386 ${DUMPENV} ./temacs -batch -l ${srcdir}/../lisp/make-docfile.el -- \
387 -o ${libsrc}DOC -d ${srcdir} -i ${libsrc}../site-packages \
388 ${obj_src} ${mallocdocsrc} ${rallocdocsrc}
393 -${DUMPENV} ./temacs -batch -l ${srcdir}/../lisp/update-elc.el
396 cd .. && $(RECURSIVE_MAKE) all-elc
400 # if defined(SPARC) && !defined(USG)
401 xgettext= /usr/openwin/bin/xgettext
402 xgettext_args= -o emacs -m_X messages
403 msgfmt= /usr/openwin/bin/msgfmt
406 xgettext_args= -s -d emacs -M_X messages
410 ${mo_dir}emacs.po: ${libsrc}make-msgfile ${libsrc}make-po ${objs}
411 ${libsrc}make-msgfile -o ${libsrc}messages ${objs}
412 cd ${libsrc} && ${xgettext} ${xgettext_args}
413 $(RM) ${mo_dir}emacs.po
414 cd ${libsrc} && ${libsrc}make-po -a ${mo_dir}emacs.po DOC
416 ${mo_dir}emacs.mo: ${mo_dir}emacs.po
417 cd ${mo_dir} && ${msgfmt} -o emacs.mo emacs.po
419 ${libsrc}make-msgfile:
420 cd ${libsrc} && $(RECURSIVE_MAKE) make-msgfile
423 cd ${libsrc} && $(RECURSIVE_MAKE) make-po
427 ${libsrc}make-docfile:
428 cd ${libsrc} && $(RECURSIVE_MAKE) make-docfile
431 LINT.c=$(LINT) $(LINTFLAGS) $(LINTINCLUDES)
432 LINTFILES= $(objs:.o=.ln)
433 LINTINCLUDES = $(cppflags)
434 ## LINTFLAGS= -fd -m -p -s -u -v -x
435 LINTFLAGS= -fd -m -s -u -v -x
437 $(LINT.c) $(LINTFILES)
438 ## end of Lint Section
441 $(start_files) ${objs} ${otherobjs}\
442 $(lwlib_deps) $(dynodump_deps)
445 ${start_flags} ${ldflags}\
446 -o $@ ${start_files} ${objs} ${otherobjs} ${LIBES}
448 temacs: $(temacs_deps)
449 $(LD) $(temacs_link_args)
459 ## We have automated tests!!
460 testdir = ${srcdir}/../tests/automated
461 batch_test_emacs = -batch -l ${testdir}/test-harness.el -f batch-test-emacs ${testdir}
463 .PHONY: check check-temacs
465 ./${PROGNAME} ${batch_test_emacs}
467 ${run_temacs} ${batch_test_emacs}
469 ## Debugging targets:
471 ## None of the debugging products work with a dumped xemacs binary,
472 ## because it does unexpected things like free memory that has been
473 ## malloc'ed in a *different* process!! So we need to run these on
476 ## RTC is Sun WorkShop's Run Time Checking, integrated with dbx
480 rtcmacs: $(temacs_deps) rtc_patch.o
481 $(RM) temacs; $(RECURSIVE_MAKE) temacs RTC_patch_objs=rtc_patch.o
487 'dbxenv rtc_error_log_file_name /dev/fd/1; \
488 dbxenv suppress_startup_message 5.0; \
492 runargs -batch -l ${srcdir}/../lisp/loadup.el run-temacs -q; \
498 ## Purify, Quantify, PureCoverage are software quality products from
499 ## Rational, formerly Pure Atria, formerly Pure Software.
507 -chain-length=32 -ignore-signals=SIGPOLL -threads=yes\
508 -cache-dir=./purecache -always-use-cache-dir=yes
510 PURIFY_LIBS = -lpthread
511 puremacs: $(temacs_deps)
512 $(PURIFY_PROG) $(PURIFY_FLAGS) $(LD) $(temacs_link_args) $(PURIFY_LIBS)
517 QUANTIFY_PROG = quantify
518 QUANTIFY_HOME = `$(QUANTIFY_PROG) -print-home-dir`
519 QUANTIFY_FLAGS = -cache-dir=./purecache -always-use-cache-dir=yes
520 cppflags += -I$(QUANTIFY_HOME)
521 temacs_link_args += $(QUANTIFY_HOME)/quantify_stubs.a
523 quantmacs: $(temacs_deps)
524 $(QUANTIFY_PROG) $(QUANTIFY_FLAGS) $(LD) $(temacs_link_args)
526 #endif /* QUANTIFY */
530 covmacs: $(temacs_deps)
531 $(PURECOV_PROG) $(LD) $(temacs_link_args)
534 TopLevelEmacsShell.o : ${srcdir}/EmacsShell-sub.c config.h xintrinsicp.h EmacsShellP.h
535 $(CC) -c $(cflags) -DDEFINE_TOP_LEVEL_EMACS_SHELL ${srcdir}/EmacsShell-sub.c
536 mv EmacsShell-sub.o TopLevelEmacsShell.o
538 TopLevelEmacsShell.c.rtl : ${srcdir}/EmacsShell-sub.c config.h xintrinsicp.h EmacsShellP.h
539 $(CC) -dr -c $(cflags) -DDEFINE_TOP_LEVEL_EMACS_SHELL ${srcdir}/EmacsShell-sub.c
540 mv EmacsShell-sub.c.rtl TopLevelEmacsShell.c.rtl
542 TransientEmacsShell.o : ${srcdir}/EmacsShell-sub.c TopLevelEmacsShell.o config.h xintrinsicp.h EmacsShellP.h
543 $(CC) -c $(cflags) -DDEFINE_TRANSIENT_EMACS_SHELL ${srcdir}/EmacsShell-sub.c
544 mv EmacsShell-sub.o TransientEmacsShell.o
546 TransientEmacsShell.c.rtl : ${srcdir}/EmacsShell-sub.c TopLevelEmacsShell.o config.h xintrinsicp.h EmacsShellP.h
547 $(CC) -dr -c $(cflags) -DDEFINE_TRANSIENT_EMACS_SHELL ${srcdir}/EmacsShell-sub.c
548 mv EmacsShell-sub.c.rtl TransientEmacsShell.c.rtl
550 ## Position-independent code for shared library creation
559 #ifdef EXTERNAL_WIDGET
561 external_client_motif_objs_shared = ExternalClient-Xm-shared.o extw-Xt-shared.o extw-Xlib-shared.o
562 external_client_xt_objs_shared = ExternalClient-Xt-shared.o extw-Xt-shared.o extw-Xlib-shared.o
563 external_client_xlib_objs_shared = ExternalClient-Xlib-shared.o extw-Xlib-shared.o
564 external_client_motif_objs_nonshared = ExternalClient-Xm-nonshared.o extw-Xt-nonshared.o extw-Xlib-nonshared.o
565 external_client_xt_objs_nonshared = ExternalClient-Xt-nonshared.o extw-Xt-nonshared.o extw-Xlib-nonshared.o
566 external_client_xlib_objs_nonshared = ExternalClient-Xlib-nonshared.o extw-Xlib-nonshared.o
568 ## Add dependencies so things work right with a parallel make
569 ExternalClient-Xm-shared.o: ${srcdir}/ExternalClient.c ExternalClient-Xt-shared.o ExternalClient-Xm-nonshared.o
570 $(CC) -c $(pic_arg) $(cflags) -DEXTW_USES_MOTIF ${srcdir}/ExternalClient.c
571 mv ExternalClient.o ExternalClient-Xm-shared.o
573 ExternalClient-Xt-shared.o: ${srcdir}/ExternalClient.c ExternalClient-Xt-nonshared.o
574 $(CC) -c $(pic_arg) $(cflags) ${srcdir}/ExternalClient.c
575 mv ExternalClient.o ExternalClient-Xt-shared.o
577 ExternalClient-Xlib-shared.o: ${srcdir}/ExternalClient-Xlib.c ExternalClient-Xlib-nonshared.o
578 $(CC) -c $(pic_arg) $(cflags) ${srcdir}/ExternalClient-Xlib.c
579 mv ExternalClient-Xlib.o ExternalClient-Xlib-shared.o
581 ExternalClient-Xm-nonshared.o: ${srcdir}/ExternalClient.c ExternalClient-Xt-nonshared.o
582 $(CC) -c $(cflags) -DEXTW_USES_MOTIF ${srcdir}/ExternalClient.c
583 mv ExternalClient.o ExternalClient-Xm-nonshared.o
585 ExternalClient-Xt-nonshared.o: ${srcdir}/ExternalClient.c
586 $(CC) -c $(cflags) ${srcdir}/ExternalClient.c
587 mv ExternalClient.o ExternalClient-Xt-nonshared.o
589 ExternalClient-Xlib-nonshared.o: ${srcdir}/ExternalClient-Xlib.c
590 $(CC) -c $(cflags) ${srcdir}/ExternalClient-Xlib.c
591 mv ExternalClient-Xlib.o ExternalClient-Xlib-nonshared.o
593 ## We compile the common files twice (once with PIC and once without)
594 ## because on some systems, compiling with PIC but not linking into
595 ## a shared library messes things up.
597 extw-Xt-shared.o: ${srcdir}/extw-Xt.c extw-Xt-nonshared.o
598 $(CC) -c $(pic_arg) $(cflags) ${srcdir}/extw-Xt.c
599 mv extw-Xt.o extw-Xt-shared.o
601 extw-Xlib-shared.o: ${srcdir}/extw-Xlib.c extw-Xlib-nonshared.o
602 $(CC) -c $(pic_arg) $(cflags) ${srcdir}/extw-Xlib.c
603 mv extw-Xlib.o extw-Xlib-shared.o
605 extw-Xt-nonshared.o: ${srcdir}/extw-Xt.c
606 $(CC) -c $(cflags) ${srcdir}/extw-Xt.c
607 mv extw-Xt.o extw-Xt-nonshared.o
609 extw-Xlib-nonshared.o: ${srcdir}/extw-Xlib.c
610 $(CC) -c $(cflags) ${srcdir}/extw-Xlib.c
611 mv extw-Xlib.o extw-Xlib-nonshared.o
613 libextcli_Xm.a: ${external_client_motif_objs_nonshared}
614 ar r libextcli_Xm.a ${external_client_motif_objs_nonshared}
616 libextcli_Xt.a: ${external_client_xt_objs_nonshared}
617 ar r libextcli_Xt.a ${external_client_xt_objs_nonshared}
619 libextcli_Xlib.a: ${external_client_xlib_objs_nonshared}
620 ar r libextcli_Xlib.a ${external_client_xlib_objs_nonshared}
624 libextcli_Xm.so.1: ${external_client_motif_objs_shared}
625 ${extw_link_beg} ${external_client_motif_objs_shared} ${extw_link_mid} libextcli_Xm.so.1 ${extw_link_end}
627 libextcli_Xt.so.1: ${external_client_xt_objs_shared}
628 ${extw_link_beg} ${external_client_xt_objs_shared} ${extw_link_mid} libextcli_Xt.so.1 ${extw_link_end}
630 libextcli_Xlib.so.1: ${external_client_xlib_objs_shared}
631 ${extw_link_beg} ${external_client_xlib_objs_shared} ${extw_link_mid} libextcli_Xlib.so.1 ${extw_link_end}
633 #endif /* EXTW_LINK */
635 #endif /* EXTERNAL_WIDGET */
637 config.h: ${srcdir}/config.h.in
638 Emacs.ad.h: ${srcdir}/${etcdir}Emacs.ad
640 config.h sheap-adjust.h paths.h Emacs.ad.h :
641 @echo "The file $@ needs to be re-generated."
642 @echo "Please run a make in the top level directory."
643 @echo "Consult the file \`INSTALL' for instructions for building XEmacs."
646 ## Some machines have alloca built-in.
647 ## They should define HAVE_ALLOCA, or may just let alloca.s
648 ## be used but generate no code.
649 ## Some have it written in assembler in alloca.s.
650 ## Some use the C version in alloca.c (these define C_ALLOCA in config.h).
654 ## We could put something in alloca.c to #define free and malloc
655 ## whenever emacs was #defined, but that's not appropriate for all
656 ## users of alloca in Emacs. Check out ../lib-src/getopt.c. */
658 alloca.o : ${srcdir}/alloca.c
659 $(CC) -c -Dfree=xfree -Dmalloc=xmalloc $(cflags) ${srcdir}/alloca.c
662 alloca.o : ${srcdir}/alloca.s config.h
663 ## $(CPP) is cc -E, which may get confused by filenames
664 ## that do not end in .c. So copy file to a safe name. */
665 ## cp ${srcdir}/alloca.s allocatem.c
666 ## Remove any ^L, blank lines, and preprocessor comments,
667 ## since some assemblers barf on them. Use a different basename for the
668 ## output file, since some stupid compilers (Green Hill) use that
669 ## name for the intermediate assembler file.
670 $(CPP) $(cppflags) allocatem.c | \
671 sed -e 's/
\f//' -e 's/^#.*//' | \
672 sed -n -e '/^..*$$/p' > allocax.s
674 ## Xenix, in particular, needs to run assembler via cc.
676 mv allocax.o alloca.o
677 $(RM) allocax.s allocatem.c
678 #endif /* HAVE_ALLOCA */
679 #endif /* ! defined (C_ALLOCA) */
681 #ifdef HAVE_NATIVE_SOUND
682 sunplay.o: ${srcdir}/sunplay.c
683 $(CC) -c $(sound_cflags) $(cflags) ${srcdir}/sunplay.c
684 hpplay.o: ${srcdir}/hpplay.c
685 $(CC) -c -Demacs $(sound_cflags) $(cflags) ${srcdir}/hpplay.c
686 #endif /* HAVE_NATIVE_SOUND */
688 ## System-specific programs to be made.
689 ## ${other_files}, $(objects_system) and $(objects_machine)
690 ## select which of these should be compiled. */
692 .PHONY: mostlyclean clean distclean realclean versionclean extraclean
694 $(RM) temacs puremacs quantmacs prefix-args *.o *.i \
695 core temacs.exe sheap-adjust.h
696 clean: mostlyclean versionclean
697 $(RM) libextcli* update-elc.stamp
698 ## This is used in making a distribution.
699 ## Do not use it on development directories!
701 $(RM) config.h paths.h Emacs.ad.h \
702 GNUmakefile Makefile Makefile.in TAGS ${PROGNAME}.*
705 $(RM) ${PROGNAME} ${PROGNAME}.exe ${libsrc}DOC
706 extraclean: realclean
707 $(RM) *~ \#* m/*~ m/\#* s/*~ s/\#*
710 SOURCES = *.[chm] *.pswm [sm]/* COPYING paths.h.in Makefile.in.in \
711 config.h.in README COPYING ChangeLog
718 ## Header files for ellcc
720 MAKEPATH=../lib-src/make-path
722 ${MAKEPATH} ${archlibdir}/include ${archlibdir}/include/m ${archlibdir}/include/s
723 -@echo "Copying include files for ellcc..."
725 cd ${srcdir}; hdrdir2=`pwd`; cd $$hdir; \
726 test "$$hdrdir2" != "$$hdir" && hdir="$$hdir $$hdrdir2"; \
727 (for thisdir in $$hdir; do \
730 for hdrfile in *.h; do \
731 hdrtars="$$hdrtars $$hdrfile"; \
733 test -d s && hdrtars="$$hdrtars s/*"; \
734 test -d m && hdrtars="$$hdrtars m/*"; \
735 test -n "$$hdrtars" && (tar cf - $$hdrtars) | \
736 (cd ${archlibdir}/include && umask 022 && tar xf -); \
737 chmod 755 ${archlibdir}/include; \
738 test -d ${archlibdir}/include/s && \
739 chmod 755 ${archlibdir}/include/s; \
740 test -d ${archlibdir}/include/m && \
741 chmod 755 ${archlibdir}/include/s;) \
745 ## Dependency processing using home-grown script, not makedepend
749 cd ${srcdir} && $(RM) depend.tmp && \
750 perl ./make-src-depend > depend.tmp && \
751 if cmp -s depend depend.tmp; \
752 then $(RM) depend.tmp; \
753 else $(RM) depend && mv depend.tmp depend; \