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}
330 -if [ -w ${srcdir}/../lisp ]; then \
331 w=`pwd`; cd ${srcdir} && $${w}/temacs -nl -batch -l ${srcdir}/../lisp/inc-vers; \
333 -$(DUMPENV) ./temacs -nl -batch -l ${srcdir}/../lisp/loadup.el dump
334 #else /* ! defined (HAVE_SHM) */
335 -if [ -w ${srcdir}/../lisp ]; then \
336 w=`pwd`; cd ${srcdir} && $${w}/temacs -batch -l ${srcdir}/../lisp/inc-vers; \
338 -$(DUMPENV) ./temacs -batch -l ${srcdir}/../lisp/loadup.el dump
339 #endif /* ! defined (HAVE_SHM) */
341 #endif /* ! defined (CANNOT_DUMP) */
343 ${PROGNAME}: temacs ${libsrc}DOC $(mo_file) ${other_files} update-elc.stamp
345 @$(RM) $@ $@.exe && touch SATISFIED
347 @if test -f $@; then if test -f SATISFIED; then \
348 echo "Testing for Lisp shadows ..."; \
349 ./${PROGNAME} -batch -vanilla -f list-load-path-shadows; fi; \
350 $(RM) SATISFIED; exit 0; fi; \
351 if test -f SATISFIED; then $(RM) SATISFIED; exit 1; fi; \
352 $(RECURSIVE_MAKE) $@;
356 @echo "Testing for Lisp shadows ..."
357 @./${PROGNAME} -batch -vanilla -f list-load-path-shadows
361 @$(RM) ${PROGNAME} && touch SATISFIED
363 @./${PROGNAME} -batch -vanilla -f list-load-path-shadows
365 FRC.update-elc.stamp :
367 update-elc.stamp : temacs FRC.update-elc.stamp
369 ${DUMPENV} ./temacs -batch -l ${srcdir}/../lisp/update-elc.el
370 @if test ! -f $@ -o -f NOBYTECOMPILE; then touch $@; fi; \
373 obj_src = $(objs:.o=.c)
375 dortl : $(obj_rtl) $(otherrtls)
376 echo "(defvar source-files '(" > ${srcdir}/../lisp/source-files.el
377 (for a in $(obj_src) $(othersrcs);do \
378 echo -n "\""$$a"\"" >> ${srcdir}/../lisp/source-files.el ;\
380 echo "))" >> ${srcdir}/../lisp/source-files.el
383 dynodump_deps = ../dynodump/dynodump.so
384 ../dynodump/dynodump.so:
385 cd ../dynodump && $(RECURSIVE_MAKE)
386 #endif /* DYNODUMP */
388 ${libsrc}DOC: temacs update-elc.stamp
389 $(RM) ${libsrc}DOC; \
390 ${DUMPENV} ./temacs -batch -l ${srcdir}/../lisp/make-docfile.el -- \
391 -o ${libsrc}DOC -d ${srcdir} -i ${libsrc}../site-packages \
392 ${obj_src} ${mallocdocsrc} ${rallocdocsrc}
397 -${DUMPENV} ./temacs -batch -l ${srcdir}/../lisp/update-elc.el
400 cd .. && $(RECURSIVE_MAKE) all-elc
404 # if defined(SPARC) && !defined(USG)
405 xgettext= /usr/openwin/bin/xgettext
406 xgettext_args= -o emacs -m_X messages
407 msgfmt= /usr/openwin/bin/msgfmt
410 xgettext_args= -s -d emacs -M_X messages
414 ${mo_dir}emacs.po: ${libsrc}make-msgfile ${libsrc}make-po ${objs}
415 ${libsrc}make-msgfile -o ${libsrc}messages ${objs}
416 cd ${libsrc} && ${xgettext} ${xgettext_args}
417 $(RM) ${mo_dir}emacs.po
418 cd ${libsrc} && ${libsrc}make-po -a ${mo_dir}emacs.po DOC
420 ${mo_dir}emacs.mo: ${mo_dir}emacs.po
421 cd ${mo_dir} && ${msgfmt} -o emacs.mo emacs.po
423 ${libsrc}make-msgfile:
424 cd ${libsrc} && $(RECURSIVE_MAKE) make-msgfile
427 cd ${libsrc} && $(RECURSIVE_MAKE) make-po
431 ${libsrc}make-docfile:
432 cd ${libsrc} && $(RECURSIVE_MAKE) make-docfile
435 LINT.c=$(LINT) $(LINTFLAGS) $(LINTINCLUDES)
436 LINTFILES= $(objs:.o=.ln)
437 LINTINCLUDES = $(cppflags)
438 ## LINTFLAGS= -fd -m -p -s -u -v -x
439 LINTFLAGS= -fd -m -s -u -v -x
441 $(LINT.c) $(LINTFILES)
442 ## end of Lint Section
445 $(start_files) ${objs} ${otherobjs}\
446 $(lwlib_deps) $(dynodump_deps)
449 ${start_flags} ${ldflags}\
450 -o $@ ${start_files} ${objs} ${otherobjs} ${LIBES}
452 temacs: $(temacs_deps)
453 $(LD) $(temacs_link_args)
460 ## We have automated tests!!
461 testdir = ${srcdir}/../tests/automated
462 batch_test_emacs = -batch -l ${testdir}/test-harness.el -f batch-test-emacs ${testdir}
464 .PHONY: check check-temacs
466 ./${PROGNAME} ${batch_test_emacs}
468 ${run_temacs} ${batch_test_emacs}
470 ## Debugging targets:
472 ## None of the debugging products work with a dumped xemacs binary,
473 ## because it does unexpected things like free memory that has been
474 ## malloc'ed in a *different* process!! So we need to run these on
477 ## RTC is Sun WorkShop's Run Time Checking, integrated with dbx
481 rtcmacs: $(temacs_deps) rtc_patch.o
482 $(RM) temacs; $(RECURSIVE_MAKE) temacs RTC_patch_objs=rtc_patch.o
488 'dbxenv rtc_error_log_file_name /dev/fd/1; \
489 dbxenv suppress_startup_message 5.0; \
493 runargs -batch -l ${srcdir}/../lisp/loadup.el run-temacs -q; \
499 ## Purify, Quantify, PureCoverage are software quality products from
500 ## Rational, formerly Pure Atria, formerly Pure Software.
504 PURIFY_FLAGS = -chain-length=32 -ignore-signals=SIGPOLL -threads=yes \
505 -cache-dir=./purecache -always-use-cache-dir=yes
506 PURIFY_LIBS = -lpthread
507 puremacs: $(temacs_deps)
508 $(PURIFY_PROG) $(PURIFY_FLAGS) $(LD) $(temacs_link_args) $(PURIFY_LIBS)
513 QUANTIFY_PROG = quantify
514 QUANTIFY_HOME = `$(QUANTIFY_PROG) -print-home-dir`
515 QUANTIFY_FLAGS = -cache-dir=./purecache -always-use-cache-dir=yes
516 cppflags += -I$(QUANTIFY_HOME)
517 temacs_link_args += $(QUANTIFY_HOME)/quantify_stubs.a
519 quantmacs: $(temacs_deps)
520 $(QUANTIFY_PROG) $(QUANTIFY_FLAGS) $(LD) $(temacs_link_args)
522 #endif /* QUANTIFY */
526 covmacs: $(temacs_deps)
527 $(PURECOV_PROG) $(LD) $(temacs_link_args)
530 TopLevelEmacsShell.o : ${srcdir}/EmacsShell-sub.c config.h xintrinsicp.h EmacsShellP.h
531 $(CC) -c $(cflags) -DDEFINE_TOP_LEVEL_EMACS_SHELL ${srcdir}/EmacsShell-sub.c
532 mv EmacsShell-sub.o TopLevelEmacsShell.o
534 TopLevelEmacsShell.c.rtl : ${srcdir}/EmacsShell-sub.c config.h xintrinsicp.h EmacsShellP.h
535 $(CC) -dr -c $(cflags) -DDEFINE_TOP_LEVEL_EMACS_SHELL ${srcdir}/EmacsShell-sub.c
536 mv EmacsShell-sub.c.rtl TopLevelEmacsShell.c.rtl
538 TransientEmacsShell.o : ${srcdir}/EmacsShell-sub.c TopLevelEmacsShell.o config.h xintrinsicp.h EmacsShellP.h
539 $(CC) -c $(cflags) -DDEFINE_TRANSIENT_EMACS_SHELL ${srcdir}/EmacsShell-sub.c
540 mv EmacsShell-sub.o TransientEmacsShell.o
542 TransientEmacsShell.c.rtl : ${srcdir}/EmacsShell-sub.c TopLevelEmacsShell.o config.h xintrinsicp.h EmacsShellP.h
543 $(CC) -dr -c $(cflags) -DDEFINE_TRANSIENT_EMACS_SHELL ${srcdir}/EmacsShell-sub.c
544 mv EmacsShell-sub.c.rtl TransientEmacsShell.c.rtl
546 ## Position-independent code for shared library creation
555 #ifdef EXTERNAL_WIDGET
557 external_client_motif_objs_shared = ExternalClient-Xm-shared.o extw-Xt-shared.o extw-Xlib-shared.o
558 external_client_xt_objs_shared = ExternalClient-Xt-shared.o extw-Xt-shared.o extw-Xlib-shared.o
559 external_client_xlib_objs_shared = ExternalClient-Xlib-shared.o extw-Xlib-shared.o
560 external_client_motif_objs_nonshared = ExternalClient-Xm-nonshared.o extw-Xt-nonshared.o extw-Xlib-nonshared.o
561 external_client_xt_objs_nonshared = ExternalClient-Xt-nonshared.o extw-Xt-nonshared.o extw-Xlib-nonshared.o
562 external_client_xlib_objs_nonshared = ExternalClient-Xlib-nonshared.o extw-Xlib-nonshared.o
564 ## Add dependencies so things work right with a parallel make
565 ExternalClient-Xm-shared.o: ${srcdir}/ExternalClient.c ExternalClient-Xt-shared.o ExternalClient-Xm-nonshared.o
566 $(CC) -c $(pic_arg) $(cflags) -DEXTW_USES_MOTIF ${srcdir}/ExternalClient.c
567 mv ExternalClient.o ExternalClient-Xm-shared.o
569 ExternalClient-Xt-shared.o: ${srcdir}/ExternalClient.c ExternalClient-Xt-nonshared.o
570 $(CC) -c $(pic_arg) $(cflags) ${srcdir}/ExternalClient.c
571 mv ExternalClient.o ExternalClient-Xt-shared.o
573 ExternalClient-Xlib-shared.o: ${srcdir}/ExternalClient-Xlib.c ExternalClient-Xlib-nonshared.o
574 $(CC) -c $(pic_arg) $(cflags) ${srcdir}/ExternalClient-Xlib.c
575 mv ExternalClient-Xlib.o ExternalClient-Xlib-shared.o
577 ExternalClient-Xm-nonshared.o: ${srcdir}/ExternalClient.c ExternalClient-Xt-nonshared.o
578 $(CC) -c $(cflags) -DEXTW_USES_MOTIF ${srcdir}/ExternalClient.c
579 mv ExternalClient.o ExternalClient-Xm-nonshared.o
581 ExternalClient-Xt-nonshared.o: ${srcdir}/ExternalClient.c
582 $(CC) -c $(cflags) ${srcdir}/ExternalClient.c
583 mv ExternalClient.o ExternalClient-Xt-nonshared.o
585 ExternalClient-Xlib-nonshared.o: ${srcdir}/ExternalClient-Xlib.c
586 $(CC) -c $(cflags) ${srcdir}/ExternalClient-Xlib.c
587 mv ExternalClient-Xlib.o ExternalClient-Xlib-nonshared.o
589 ## We compile the common files twice (once with PIC and once without)
590 ## because on some systems, compiling with PIC but not linking into
591 ## a shared library messes things up.
593 extw-Xt-shared.o: ${srcdir}/extw-Xt.c extw-Xt-nonshared.o
594 $(CC) -c $(pic_arg) $(cflags) ${srcdir}/extw-Xt.c
595 mv extw-Xt.o extw-Xt-shared.o
597 extw-Xlib-shared.o: ${srcdir}/extw-Xlib.c extw-Xlib-nonshared.o
598 $(CC) -c $(pic_arg) $(cflags) ${srcdir}/extw-Xlib.c
599 mv extw-Xlib.o extw-Xlib-shared.o
601 extw-Xt-nonshared.o: ${srcdir}/extw-Xt.c
602 $(CC) -c $(cflags) ${srcdir}/extw-Xt.c
603 mv extw-Xt.o extw-Xt-nonshared.o
605 extw-Xlib-nonshared.o: ${srcdir}/extw-Xlib.c
606 $(CC) -c $(cflags) ${srcdir}/extw-Xlib.c
607 mv extw-Xlib.o extw-Xlib-nonshared.o
609 libextcli_Xm.a: ${external_client_motif_objs_nonshared}
610 ar r libextcli_Xm.a ${external_client_motif_objs_nonshared}
612 libextcli_Xt.a: ${external_client_xt_objs_nonshared}
613 ar r libextcli_Xt.a ${external_client_xt_objs_nonshared}
615 libextcli_Xlib.a: ${external_client_xlib_objs_nonshared}
616 ar r libextcli_Xlib.a ${external_client_xlib_objs_nonshared}
620 libextcli_Xm.so.1: ${external_client_motif_objs_shared}
621 ${extw_link_beg} ${external_client_motif_objs_shared} ${extw_link_mid} libextcli_Xm.so.1 ${extw_link_end}
623 libextcli_Xt.so.1: ${external_client_xt_objs_shared}
624 ${extw_link_beg} ${external_client_xt_objs_shared} ${extw_link_mid} libextcli_Xt.so.1 ${extw_link_end}
626 libextcli_Xlib.so.1: ${external_client_xlib_objs_shared}
627 ${extw_link_beg} ${external_client_xlib_objs_shared} ${extw_link_mid} libextcli_Xlib.so.1 ${extw_link_end}
629 #endif /* EXTW_LINK */
631 #endif /* EXTERNAL_WIDGET */
633 config.h: ${srcdir}/config.h.in
634 Emacs.ad.h: ${srcdir}/${etcdir}Emacs.ad
636 config.h sheap-adjust.h paths.h Emacs.ad.h :
637 @echo "The file $@ needs to be re-generated."
638 @echo "Please run a make in the top level directory."
639 @echo "Consult the file \`INSTALL' for instructions for building XEmacs."
642 ## Some machines have alloca built-in.
643 ## They should define HAVE_ALLOCA, or may just let alloca.s
644 ## be used but generate no code.
645 ## Some have it written in assembler in alloca.s.
646 ## Some use the C version in alloca.c (these define C_ALLOCA in config.h).
650 ## We could put something in alloca.c to #define free and malloc
651 ## whenever emacs was #defined, but that's not appropriate for all
652 ## users of alloca in Emacs. Check out ../lib-src/getopt.c. */
654 alloca.o : ${srcdir}/alloca.c
655 $(CC) -c -Dfree=xfree -Dmalloc=xmalloc $(cflags) ${srcdir}/alloca.c
658 alloca.o : ${srcdir}/alloca.s config.h
659 ## $(CPP) is cc -E, which may get confused by filenames
660 ## that do not end in .c. So copy file to a safe name. */
661 ## cp ${srcdir}/alloca.s allocatem.c
662 ## Remove any ^L, blank lines, and preprocessor comments,
663 ## since some assemblers barf on them. Use a different basename for the
664 ## output file, since some stupid compilers (Green Hill) use that
665 ## name for the intermediate assembler file.
666 $(CPP) $(cppflags) allocatem.c | \
667 sed -e 's/
\f//' -e 's/^#.*//' | \
668 sed -n -e '/^..*$$/p' > allocax.s
670 ## Xenix, in particular, needs to run assembler via cc.
672 mv allocax.o alloca.o
673 $(RM) allocax.s allocatem.c
674 #endif /* HAVE_ALLOCA */
675 #endif /* ! defined (C_ALLOCA) */
677 #ifdef HAVE_NATIVE_SOUND
678 sunplay.o: ${srcdir}/sunplay.c
679 $(CC) -c $(sound_cflags) $(cflags) ${srcdir}/sunplay.c
680 hpplay.o: ${srcdir}/hpplay.c
681 $(CC) -c -Demacs $(sound_cflags) $(cflags) ${srcdir}/hpplay.c
682 #endif /* HAVE_NATIVE_SOUND */
684 ## System-specific programs to be made.
685 ## ${other_files}, $(objects_system) and $(objects_machine)
686 ## select which of these should be compiled. */
688 .PHONY: mostlyclean clean distclean realclean versionclean extraclean
690 $(RM) temacs puremacs quantmacs prefix-args *.o *.i \
691 core temacs.exe sheap-adjust.h
692 clean: mostlyclean versionclean
693 $(RM) libextcli* update-elc.stamp
694 ## This is used in making a distribution.
695 ## Do not use it on development directories!
697 $(RM) config.h paths.h Emacs.ad.h \
698 GNUmakefile Makefile Makefile.in TAGS ${PROGNAME}.*
701 $(RM) ${PROGNAME} ${PROGNAME}.exe ${libsrc}DOC
702 extraclean: realclean
703 $(RM) *~ \#* m/*~ m/\#* s/*~ s/\#*
706 SOURCES = *.[chm] *.pswm [sm]/* COPYING paths.h.in Makefile.in.in \
707 config.h.in README COPYING ChangeLog
714 ## Header files for ellcc
716 MAKEPATH=../lib-src/make-path
718 ${MAKEPATH} ${archlibdir}/include ${archlibdir}/include/m ${archlibdir}/include/s
719 -@echo "Copying include files for ellcc..."
721 cd ${srcdir}; hdrdir2=`pwd`; cd $$hdir; \
722 test "$$hdrdir2" != "$$hdir" && hdir="$$hdir $$hdrdir2"; \
723 (for thisdir in $$hdir; do \
726 for hdrfile in *.h; do \
727 hdrtars="$$hdrtars $$hdrfile"; \
729 test -d s && hdrtars="$$hdrtars s/*"; \
730 test -d m && hdrtars="$$hdrtars m/*"; \
731 test -n "$$hdrtars" && (tar cf - $$hdrtars) | \
732 (cd ${archlibdir}/include && umask 022 && tar xf -); \
733 chmod 755 ${archlibdir}/include; \
734 test -d ${archlibdir}/include/s && \
735 chmod 755 ${archlibdir}/include/s; \
736 test -d ${archlibdir}/include/m && \
737 chmod 755 ${archlibdir}/include/s;) \
741 ## Dependency processing using home-grown script, not makedepend
745 cd ${srcdir} && $(RM) depend.tmp && \
746 perl ./make-src-depend > depend.tmp && \
747 if cmp -s depend depend.tmp; \
748 then $(RM) depend.tmp; \
749 else $(RM) depend && mv depend.tmp depend; \