comparison src/Makefile.in.in @ 1330:4542b72c005e

[xemacs-hg @ 2003-03-01 07:25:26 by ben] build patch Makefile.in.in: Move src deletions to src/Makefile.in.in. dump-paths.el, dumped-lisp.el: Delete. Combine stuff into setup-paths.el. find-paths.el: Removed. Make this file contain generic routines only. Move stuff to compute Emacs roots to setup-paths.el. startup.el: Removed. Move these variables into setup-paths.el. setup-paths.el, startup.el: Removed. Combine all high-level code for computing the paths into setup-paths.el. Create new function startup-find-load-path to encapsulate all logic for computing `load-path'. Eliminate invocation-directory and invocation-name parameters since there is no point (false generality) -- the code references other globals, which cannot be specified. Eliminate some code duplicated between setup-paths.el and startup.el. Clean up the debug-paths code and output load-path in addition. Add logic to paths-emacs-root-p to support separated source and build trees. loadup.el, make-docfile.el, update-elc-2.el, update-elc.el: Rewrite to allow for separated source and build trees, as may occur in MS Windows. NOTE TO BUILD HACKERS: loadup.el, make-docfile.el, update-elc.el and update-elc-2.el made two assumptions that are no longer correct: (1) The source and build trees are in the same place. (2) They can make assumptions about where `.' is. These files now compute the locations of the source and build roots at the top of the file. *ALL* constant file names or path snippets must now be made absolute using expand-file-name and one of these roots. dumped-lisp.el, packages.el: Removed. Remove some unused lists of Lisp files. packages-hardcoded-lisp (empty, in any case) moved to dumped-lisp.el. startup.el: When a compiled init file is out-of-date wrt the uncompiled version, load the uncompiled version and issue a nasty warning. update-elc-2.el: Force touching of auto-autoloads files when REBUILD_AUTOLOADS was set. update-elc.el: Fix code that checks whether dumping is necessary to check against xemacs.dmp, not xemacs.exe, when Unix and pdump. lwlib-Xm.c: Fix compile warning. README, config.inc.samp, xemacs.mak: -- Major reorganization and cleanup. -- Add support for separated build tree and source tree. -- Delete all support for X Windows building, since it's totally bit-rotten and will never be fixed up. Instruct people to use Cygwin if they want such support. make-build-dir: New script to create a skeleton build tree for use with separated build and source tree compilation. m/acorn.h, m/alliant-2800.h, m/alliant.h, m/altos.h, m/amdahl.h, m/arm.h, m/att3b.h, m/aviion.h, m/clipper.h, m/cnvrgnt.h, m/convex.h, m/cydra5.h, m/delta.h, m/delta88k.h, m/dpx2.h, m/elxsi.h, m/ews4800r.h, m/gould.h, m/hp800.h, m/hp9000s300.h, m/i860.h, m/ibmps2-aix.h, m/ibmrs6000.h, m/ibmrt-aix.h, m/ibmrt.h, m/intel386.h, m/iris4d.h, m/iris5d.h, m/iris6d.h, m/irist.h, m/m68k.h, m/masscomp.h, m/mg1.h, m/mips-nec.h, m/mips-siemens.h, m/mips.h, m/nh3000.h, m/nh4000.h, m/ns32000.h, m/plexus.h, m/powerpc.h, m/sequent-ptx.h, m/sequent.h, m/sgi-challenge.h, m/stride.h, m/tad68k.h, m/targon31.h, m/tekxd88.h, m/template.h, m/tower32.h, m/tower32v3.h, m/ustation.h, m/wicat.h, m/xps100.h, data.c, doc.c, editfns.c, emacs.c, lrecord.h, ntheap.c, process-unix.c, sysdep.c, unexec.c: Delete all support for bit-rotten CANNOT_DUMP. Just use pdump. Makefile.in.in: Lots o' cleanup. Use names like LISP, SRC instead of lispdir, srcdir, for consistency with xemacs.mak and the conventions in the rest of the file. Eliminate use of ${...} in favor of $(...), to make it easier to move code between this file and xemacs.mak. Fix dependency handling wrt NEEDTODUMP to eliminate problems some people (e.g. Vin) have been seeing with non-GNU makes. Write a long section about the subtle but oh-so-important differences in dependency processing between nmake, make, and GNU make. Add unicode-encapsulate target, from xemacs.mak. chartab.c, lrecord.h: Fix crash due to attempt to free objects across dump/undump.
author ben
date Sat, 01 Mar 2003 07:25:56 +0000
parents 70841e88fbee
children 01c57eb70ae9
comparison
equal deleted inserted replaced
1329:389741884c65 1330:4542b72c005e
25 ## Synched up with: Not synched with FSF. 25 ## Synched up with: Not synched with FSF.
26 26
27 .PHONY: all 27 .PHONY: all
28 all: build-the-mofo 28 all: build-the-mofo
29 29
30 PROGNAME=@PROGNAME@
31
32 #define NOT_C_CODE 30 #define NOT_C_CODE
33 #include "config.h" 31 #include "config.h"
34 32
35 #ifdef PDUMP 33 ## Here are the things that we expect ../configure to edit.
36 DUMP_TARGET = ${PROGNAME}.dmp
37 EXE_TARGET = ${PROGNAME}
38 DUMP_ID = dump-id.o
39 #else
40 DUMP_TARGET = ${PROGNAME}
41 EXE_TARGET = temacs
42 #endif
43
44 ## For performance and consistency, no built-in rules.
45 .SUFFIXES:
46 .SUFFIXES: .c .h .o .i .s .dep
47 34
48 #ifdef USE_GNU_MAKE 35 #ifdef USE_GNU_MAKE
49 RECURSIVE_MAKE=$(MAKE) 36 RECURSIVE_MAKE=$(MAKE)
50 #else 37 #else
51 @SET_MAKE@ 38 @SET_MAKE@
52 RECURSIVE_MAKE=@RECURSIVE_MAKE@ 39 RECURSIVE_MAKE=@RECURSIVE_MAKE@
53 #endif 40 #endif
54 41
55 SHELL=/bin/sh 42 PROGNAME=@PROGNAME@
56 RM = rm -f
57
58 lispdir = ${srcdir}/../lisp/
59 moduledir = ${srcdir}/../modules/
60 libsrc = ../lib-src/
61 etcdir = ../etc/
62
63 ## Here are the things that we expect ../configure to edit.
64 prefix=@prefix@ 43 prefix=@prefix@
65 srcdir=@srcdir@ 44 SRC=@srcdir@
66 blddir=@blddir@ 45 blddir=@blddir@
67 version=@version@ 46 version=@version@
68 CC=@XEMACS_CC@ 47 CC=@XEMACS_CC@
69 CPP=@CPP@ 48 CPP=@CPP@
70 CFLAGS=@CFLAGS@ 49 CFLAGS=@CFLAGS@
112 vpath dump-id.c 91 vpath dump-id.c
113 #else 92 #else
114 VPATH=@srcdir@ 93 VPATH=@srcdir@
115 #endif 94 #endif
116 95
96 SHELL=/bin/sh
117 RM = rm -f 97 RM = rm -f
118 98
119 LWLIB_SRCDIR = ${srcdir}/../lwlib 99 LISP = $(SRC)/../lisp
120 100 ETC = $(SRC)/../etc
121 #ifdef HAVE_X_WINDOWS 101 SRCMODULES = $(SRC)/../modules
122 lwlib_libs = ../lwlib/liblw.a 102 LIB_SRC = ../lib-src
123 lwlib_deps = $(lwlib_libs) 103 BLDSRC = .
124 $(lwlib_libs) : 104 BLDMODULES = ../modules
125 cd ../lwlib && $(RECURSIVE_MAKE) 105 LWLIB_SRCDIR = $(SRC)/../lwlib
126
127 # ifdef AIX4
128 LIBI18N = -li18n
129 # endif
130
131 X11_libs = $(LIBI18N)
132 #endif /* HAVE_X_WINDOWS */
133 106
134 ######################################################################### 107 #########################################################################
135 108 ## Definitions of object files and other dependencies ##
136 ## Object files needed for compilation, and other rebuilt files. 109 #########################################################################
137 110
138 ## NOTE: Some of the object files are specified in this file, and others in 111 ## NOTE: Some of the object files are specified in this file, and others in
139 ## configure.in. The general rule is that they be specified here whenever 112 ## configure.in. The general rule is that they be specified here whenever
140 ## possible -- in practice, that means that they have clear dependencies on 113 ## possible -- in practice, that means that they have clear dependencies on
141 ## configure defines. They should be in configure.in when there is no 114 ## configure defines. They should be in configure.in when there is no
214 #ifdef HAVE_GPM 187 #ifdef HAVE_GPM
215 gpm_objs=gpmevent.o 188 gpm_objs=gpmevent.o
216 #endif 189 #endif
217 190
218 #if defined(HAVE_LDAP) && !defined(HAVE_SHLIB) 191 #if defined(HAVE_LDAP) && !defined(HAVE_SHLIB)
219 ldap_objs=../modules/ldap/eldap.o 192 ldap_objs=$(BLDMODULES)/ldap/eldap.o
220 #endif 193 #endif
221 194
222 #ifdef MULE 195 #ifdef MULE
223 mule_objs=mule-ccl.o mule-charset.o mule-coding.o 196 mule_objs=mule-ccl.o mule-charset.o mule-coding.o
224 #endif 197 #endif
230 #ifdef HAVE_WNN 203 #ifdef HAVE_WNN
231 mule_wnn_objs=mule-wnnfns.o 204 mule_wnn_objs=mule-wnnfns.o
232 #endif 205 #endif
233 206
234 #if defined(HAVE_POSTGRESQL) && !defined(HAVE_SHLIB) 207 #if defined(HAVE_POSTGRESQL) && !defined(HAVE_SHLIB)
235 postgresql_objs=../modules/postgresql/postgresql.o 208 postgresql_objs=$(BLDMODULES)/postgresql/postgresql.o
236 #endif 209 #endif
237 210
238 #ifdef HAVE_WIN32_PROCESSES 211 #ifdef HAVE_WIN32_PROCESSES
239 process_objs=process-nt.o 212 process_objs=process-nt.o
240 #elif defined (HAVE_UNIX_PROCESSES) 213 #elif defined (HAVE_UNIX_PROCESSES)
263 236
264 #if defined (WIN32_NATIVE) || defined (CYGWIN) 237 #if defined (WIN32_NATIVE) || defined (CYGWIN)
265 win32_objs=win32.o intl-win32.o intl-auto-encap-win32.o intl-encap-win32.o \ 238 win32_objs=win32.o intl-win32.o intl-auto-encap-win32.o intl-encap-win32.o \
266 xemacs_res.o 239 xemacs_res.o
267 #endif 240 #endif
268
269 ## -Demacs is needed to make some files produce the correct version
270 ## for use in Emacs.
271
272 cppflags = $(CPPFLAGS) -Demacs -I. $(c_switch_all)
273 cflags = $(CFLAGS) $(cppflags)
274 #if defined (WIN32_NATIVE) || defined (CYGWIN)
275 ldflags = $(LDFLAGS) -mwindows -e _mainCRTStartup $(ld_switch_all) $(ld_dynamic_link_flags)
276 # if defined (CYGWIN)
277 ldflags += -Wl,--script=s/cygwin.sc
278 # endif
279 #else
280 ldflags = $(LDFLAGS) $(ld_switch_all) $(ld_dynamic_link_flags)
281 #endif
282
283 #ifdef SOLARIS2
284 %.o : %.c
285 #else
286 .c.o:
287 #endif
288 $(CC) -c $(cflags) $<
289
290 ## Create preprocessor output (debugging purposes only)
291 .c.i:
292 #ifdef __GNUC__
293 $(CC) -E $(cppflags) -o $@ $<
294 #else /* works on Solaris; what about other systems? */
295 $(CC) -P $(cppflags) $<
296 #endif /* compiler */
297
298 ## Create assembler output (debugging purposes only)
299 .c.s:
300 $(CC) -S -c $(cflags) $<
301
302 ## Create RTL files
303 %.c.rtl : %.c
304 $(CC) -dr -c $(cflags) $<
305 241
306 ## lastfile must follow all files whose initialized data areas should 242 ## lastfile must follow all files whose initialized data areas should
307 ## be dumped as pure by dump-emacs. 243 ## be dumped as pure by dump-emacs.
308 244
309 ## NOTE: The last line cannot be all macros, because make will barf 245 ## NOTE: The last line cannot be all macros, because make will barf
372 #endif /* USE_DEBUG_MALLOC */ 308 #endif /* USE_DEBUG_MALLOC */
373 #endif /* SYSTEM_MALLOC */ 309 #endif /* SYSTEM_MALLOC */
374 310
375 #ifdef HAVE_X_WINDOWS 311 #ifdef HAVE_X_WINDOWS
376 312
313 lwlib_lib = ../lwlib/liblw.a
314
377 # ifdef EXTERNAL_WIDGET 315 # ifdef EXTERNAL_WIDGET
378 external_widget_objs = ExternalShell.o extw-Xt-nonshared.o extw-Xlib-nonshared.o 316 external_widget_objs = ExternalShell.o extw-Xt-nonshared.o extw-Xlib-nonshared.o
379 317
380 # ifdef LWLIB_USES_MOTIF 318 # ifdef LWLIB_USES_MOTIF
381 # ifdef EXTW_LINK 319 # ifdef EXTW_LINK
387 325
388 # ifdef EXTW_LINK 326 # ifdef EXTW_LINK
389 shared_other_files = libextcli_Xt.so.1 libextcli_Xlib.so.1 327 shared_other_files = libextcli_Xt.so.1 libextcli_Xlib.so.1
390 # endif 328 # endif
391 other_files=\ 329 other_files=\
392 ${motif_other_files}\ 330 $(motif_other_files)\
393 libextcli_Xt.a libextcli_Xlib.a\ 331 libextcli_Xt.a libextcli_Xlib.a\
394 ${shared_other_files} 332 $(shared_other_files)
395 333
396 # endif /* EXTERNAL_WIDGET */ 334 # endif /* EXTERNAL_WIDGET */
397 335
398 # if defined (HAVE_OFFIX_DND) || defined (HAVE_CDE) 336 # if defined (HAVE_OFFIX_DND) || defined (HAVE_CDE)
399 dnd_objs = @dnd_objs@ 337 dnd_objs = @dnd_objs@
406 ## should not be told about. 344 ## should not be told about.
407 otherobjs = lastfile.o $(mallocobjs) $(rallocobjs) $(X11_objs) 345 otherobjs = lastfile.o $(mallocobjs) $(rallocobjs) $(X11_objs)
408 otherrtls = $(otherobjs:.o=.c.rtl) 346 otherrtls = $(otherobjs:.o=.c.rtl)
409 othersrcs = $(otherobjs:.o=.c) 347 othersrcs = $(otherobjs:.o=.c)
410 348
411 LIBES = $(lwlib_libs) $(malloclib) $(ld_libs_all) $(lib_gcc) 349 LIBES = $(lwlib_lib) $(malloclib) $(ld_libs_all) $(lib_gcc)
412 350
413 #ifdef I18N3 351 #ifdef I18N3
414 mo_dir = ${etcdir} 352 mo_file = $(LIB_SRC)/emacs.mo
415 mo_file = ${mo_dir}emacs.mo
416 #endif 353 #endif
417 354
418 ######################################################################### 355 #########################################################################
419 356 ## Implicit rules ##
420 ## Primary rebuilding process 357 #########################################################################
421 358
422 DO_TEMACS = ${DUMPENV} ./${EXE_TARGET} 359 ## For performance and consistency, no built-in rules.
423 DO_XEMACS = ./${PROGNAME} 360 .SUFFIXES:
424 LISP = ${srcdir}/../lisp 361 .SUFFIXES: .c .h .o .i .s .dep
362
363 ## -Demacs is needed to make some files produce the correct version
364 ## for use in Emacs.
365
366 cppflags = $(CPPFLAGS) -Demacs -I. $(c_switch_all)
367 cflags = $(CFLAGS) $(cppflags)
368 #if defined (WIN32_NATIVE) || defined (CYGWIN)
369 ldflags = $(LDFLAGS) -mwindows -e _mainCRTStartup $(ld_switch_all) $(ld_dynamic_link_flags)
370 # if defined (CYGWIN)
371 ldflags += -Wl,--script=s/cygwin.sc
372 # endif
373 #else
374 ldflags = $(LDFLAGS) $(ld_switch_all) $(ld_dynamic_link_flags)
375 #endif
376
377 #ifdef SOLARIS2
378 %.o : %.c
379 #else
380 .c.o:
381 #endif
382 $(CC) -c $(cflags) $<
383
384 ## Create preprocessor output (debugging purposes only)
385 .c.i:
386 #ifdef __GNUC__
387 $(CC) -E $(cppflags) -o $@ $<
388 #else /* works on Solaris; what about other systems? */
389 $(CC) -P $(cppflags) $<
390 #endif /* compiler */
391
392 ## Create assembler output (debugging purposes only)
393 .c.s:
394 $(CC) -S -c $(cflags) $<
395
396 ## Create RTL files
397 %.c.rtl : %.c
398 $(CC) -dr -c $(cflags) $<
399
400 #########################################################################
401 ## Primary rebuilding process ##
402 #########################################################################
403
404 #ifdef PDUMP
405 DUMP_TARGET = $(PROGNAME).dmp
406 RAW_EXE = $(PROGNAME)
407 DUMP_ID = dump-id.o
408 #else
409 DUMP_TARGET = $(PROGNAME)
410 RAW_EXE = temacs
411 #endif
412
413 DO_TEMACS = $(DUMPENV) ./$(RAW_EXE)
414 DO_XEMACS = ./$(PROGNAME)
425 415
426 BATCH = -no-packages -batch 416 BATCH = -no-packages -batch
427 BATCH_PACKAGES = -vanilla -batch 417 BATCH_PACKAGES = -vanilla -batch
428 TEMACS_BATCH = $(DO_TEMACS) -nd $(BATCH) 418 TEMACS_BATCH = $(DO_TEMACS) -nd $(BATCH)
429 XEMACS_BATCH = $(DO_XEMACS) $(BATCH) 419 XEMACS_BATCH = $(DO_XEMACS) $(BATCH)
431 temacs_loadup_args = -l $(LISP)/loadup.el 421 temacs_loadup_args = -l $(LISP)/loadup.el
432 dump_temacs_args = $(temacs_loadup_args) dump 422 dump_temacs_args = $(temacs_loadup_args) dump
433 run_temacs_args = $(temacs_loadup_args) run-temacs 423 run_temacs_args = $(temacs_loadup_args) run-temacs
434 dump_temacs = $(TEMACS_BATCH) $(dump_temacs_args) 424 dump_temacs = $(TEMACS_BATCH) $(dump_temacs_args)
435 425
436 debug_temacs = gdb $(EXE_TARGET)
437
438 .PHONY : build-the-mofo release update-elc update-elc-2 load-shadows
439
440 ## Compile, dump, and make sure all .elc files are up-to-date. 426 ## Compile, dump, and make sure all .elc files are up-to-date.
441 427
442 ## NOTE: The dependencies would (should) look like the following 428 ## NOTE NOTE NOTE: There appears to be a fundamental but non-obvious
443 ## commented-out statement in linear order, but apparently this causes 429 ## difference between the way that standard `make', GNU Make, and `nmake'
444 ## problems with some versions of `make' because there is insufficient 430 ## handle dependencies, and this means we have to write the dependencies in
445 ## serialization of the build steps. Evidently the .NO_PARALLEL directive 431 ## Makefile.in.in and xemacs.mak differently. To illustrate this, consider
446 ## doesn't help. `make' really seems to be designed to have all 432 ## the following first:
447 ## dependencies proceed upward, not across, and to be all calculable before 433
448 ## actually running anything. The problem here is that update-elc may 434 ##.PHONY: all (`make' only)
449 ## touch NEEDTODUMP and thus create an additional dependency 435 ## all: test.exe
450 ## -- but *NOT UNTIL* that step is run. There is no way I can come up with 436 ##
451 ## to express such a dependency in upward fashion. 437 ##.PHONY: FRC.test.c (`make' only)
452 438 ##FRC.test.c:
453 ## build-the-mofo: ${EXE_TARGET} update-elc ${libsrc}DOC $(mo_file) ${other_files} ${DUMP_TARGET} update-elc-2 $(LISP)/finder-inf.el load-shadows 439 ##
454 440 ##test.c: FRC.test.c
455 build-the-mofo: ${EXE_TARGET} ${libsrc}DOC $(mo_file) ${other_files} ${DUMP_TARGET} load-shadows 441 ## if test ! -f foo ; then touch test.c; fi (`make' only)
456 .NO_PARALLEL: ${EXE_TARGET} update-elc ${libsrc}DOC ${DUMP_TARGET} update-elc-2 442 ## if not exist foo touch test.c (`nmake' only)
443 ##
444 ##test.obj: test.c
445 ## touch test.obj
446 ##
447 ##test.exe: test.obj
448 ## touch test.exe
449
450 ## (GNU Make doesn't need the .PHONY declarations, but evidently some versions
451 ## of `make' do. nmake doesn't need them and doesn't allow them, either.)
452
453 ## Running `make' rebuilds test.exe only if `foo' doesn't exist.
454 ## Running `nmake -f Makefile' rebuilds it regardless.
455
456 ## Both conclude that test.c needs to be rebuilt since its dependent is
457 ## non-existent. But `make' recalculates its dependencies after running
458 ## the commands for test.c, and notices that test.c hasn't changed, and
459 ## thus test.obj and test.exe are up-to-date. `nmake' doesn't.
460
461 ## On the other hand, consider the following:
462
463 ##.PHONY: all (`make' only)
464 ##all: check-foo test.exe
465 ##
466 ##.PHONY: check-foo (`make' only)
467 ##check-foo:
468 ## if test ! -f foo; then touch test.c; fi (`make' only)
469 ## if not exist foo touch test.c (`nmake' only)
470 ##
471 ##test.c:
472 ## touch test.c
473 ##
474 ##test.obj: test.c
475 ## touch test.obj
476 ##
477 ##test.exe: test.c test.obj
478 ## touch test.exe
479 ##
480
481 ## Running `nmake -f Makefile' (and `GNU make') rebuilds test.exe only if
482 ## `foo' doesn't exist.
483 ## Running some versions of non-GNU `make' does nothing at all once test.c,
484 ## test.obj and test.exe all exist.
485
486 ## It appears that `nmake' doesn't check dependencies for test.exe until it
487 ## actually needs to be rebuilt, so this "sideways" dependency script
488 ## works. GNU make evidently recalculates *all* dependencies after each
489 ## command so has no problem, either. But some makes apparently calculate
490 ## all dependencies at startup and then, after executing a command to build
491 ## a dependency, only recheck relationships involving that particular
492 ## dependency.
493
494 ## In XEmacs-land, the above situation exists wrt the `NEEDTODUMP'
495 ## dependency, recalculated by `update-elc.el'. Thus, Makefile.in.in must
496 ## use the method #1 above, and nmake must use method #2.
497
498 ## -ben
499
500 .PHONY: build-the-mofo
501 build-the-mofo: $(DUMP_TARGET) $(mo_file) $(other_files) update-elc-2 $(LISP)/finder-inf.el load-shadows
502 .NO_PARALLEL: $(DUMP_TARGET) update-elc-2 $(LISP)/finder-inf.el load-shadows
457 503
458 release: all 504 release: all
459 -if [ -w $(LISP) ]; then \ 505 -if [ -w $(LISP) ]; then \
460 w=`pwd`; cd ${srcdir} && $${w}/${EXE_TARGET} -nd ${BATCH} -l $(LISP)/inc-vers; \ 506 w=`pwd`; cd $(SRC) && $$w/$(RAW_EXE) -nd $(BATCH) -l $(LISP)/inc-vers; \
461 else true; fi 507 else true; fi
462 -${dump_temacs} 508 -$(dump_temacs)
463 touch release 509 touch release
464 510
465 update-elc: $(EXE_TARGET)
466 $(TEMACS_BATCH) -l $(LISP)/update-elc.el
467
468 ## Update out-of-date .elcs, other than needed for dumping. 511 ## Update out-of-date .elcs, other than needed for dumping.
469 update-elc-2: update-elc $(EXE_TARGET) $(DUMP_TARGET) 512 .PHONY: update-elc-2
513 update-elc-2:
470 $(XEMACS_BATCH) -no-autoloads -l update-elc-2.el -f batch-update-elc-2 $(LISP) 514 $(XEMACS_BATCH) -no-autoloads -l update-elc-2.el -f batch-update-elc-2 $(LISP)
471 515
472 $(LISP)/finder-inf.el: update-elc-2 $(EXE_TARGET) $(DUMP_TARGET) 516 $(LISP)/finder-inf.el:
473 @echo "Building finder database ..." 517 @echo "Building finder database ..."
474 $(XEMACS_BATCH) -eval '(setq finder-compile-keywords-quiet t)' \ 518 $(XEMACS_BATCH) -eval "(setq finder-compile-keywords-quiet t)" \
475 -l finder -f finder-compile-keywords 519 -l finder -f finder-compile-keywords
476 @echo "Building finder database ...(done)" 520 @echo "Building finder database ...(done)"
477 521
478 load-shadows: $(LISP)/finder-inf.el $(EXE_TARGET) $(DUMP_TARGET) 522 .PHONY: load-shadows
523 load-shadows:
479 #ifndef QUICK_BUILD 524 #ifndef QUICK_BUILD
480 @echo "Testing for Lisp shadows ..." 525 @echo "Testing for Lisp shadows ..."
481 @$(XEMACS_BATCH) -f list-load-path-shadows 526 @$(XEMACS_BATCH) -f list-load-path-shadows
482 #endif 527 #endif
483 528
529 .PHONY: FRC.needtodump
530 FRC.needtodump:
531
484 ## This file is touched by update-elc.el when redumping is necessary. 532 ## This file is touched by update-elc.el when redumping is necessary.
485 NEEDTODUMP: 533 ## We use $(BLDSRC) == `.' here to help keep sync with nt/xemacs.mak,
486 touch NEEDTODUMP 534 ## where $(BLDSRC) is not `.'.
487 535 $(BLDSRC)/NEEDTODUMP: FRC.needtodump
488 ${DUMP_TARGET}: ${EXE_TARGET} NEEDTODUMP 536 $(TEMACS_BATCH) -l $(LISP)/update-elc.el
537
538 $(DUMP_TARGET): $(RAW_EXE) $(BLDSRC)/NEEDTODUMP $(LIB_SRC)/DOC
489 #ifdef HEAP_IN_DATA 539 #ifdef HEAP_IN_DATA
490 @$(RM) $@ && touch SATISFIED 540 @$(RM) $@ && touch SATISFIED
491 ${dump_temacs} 541 $(dump_temacs)
492 @if test -f SATISFIED; then $(RM) SATISFIED; else $(RM) $@; \ 542 @if test -f SATISFIED; then $(RM) SATISFIED; else $(RM) $@; \
493 $(RECURSIVE_MAKE) $@; fi 543 $(RECURSIVE_MAKE) $@; fi
494 #else 544 #else
495 @$(RM) $@ 545 @$(RM) $@
496 ${dump_temacs} 546 $(dump_temacs)
497 #endif 547 #endif
548
549 #ifdef HAVE_X_WINDOWS
550 lwlib_deps = $(lwlib_lib)
551 $(lwlib_lib):
552 cd ../lwlib && $(RECURSIVE_MAKE)
553 #endif /* HAVE_X_WINDOWS */
498 554
499 #ifdef DYNODUMP 555 #ifdef DYNODUMP
500 dynodump_deps = ../dynodump/dynodump.so 556 dynodump_deps = ../dynodump/dynodump.so
501 ../dynodump/dynodump.so: 557 ../dynodump/dynodump.so:
502 cd ../dynodump && $(RECURSIVE_MAKE) 558 cd ../dynodump && $(RECURSIVE_MAKE)
503 #endif /* DYNODUMP */ 559 #endif /* DYNODUMP */
504 560
505 link_deps = $(start_files) ${objs} ${otherobjs} $(lwlib_deps) $(dynodump_deps) 561 link_deps = $(start_files) $(objs) $(otherobjs) $(lwlib_deps) $(dynodump_deps)
506 562
507 temacs_deps = $(link_deps) ${DUMP_ID} 563 temacs_deps = $(link_deps) $(DUMP_ID)
508 564
509 temacs_link_args = \ 565 temacs_link_args = \
510 ${start_flags} ${ldflags} \ 566 $(start_flags) $(ldflags) \
511 -o $@ ${start_files} ${objs} ${otherobjs} ${DUMP_ID} ${LIBES} 567 -o $@ $(start_files) $(objs) $(otherobjs) $(DUMP_ID) $(LIBES)
512 568
513 ${EXE_TARGET}: $(temacs_deps) 569 $(RAW_EXE): $(temacs_deps)
514 $(LD) $(temacs_link_args) 570 $(LD) $(temacs_link_args)
515 571
516 dump-id.c: ${libsrc}make-dump-id ${link_deps} 572 dump-id.c: $(LIB_SRC)/make-dump-id $(link_deps)
517 ${libsrc}make-dump-id 573 $(LIB_SRC)/make-dump-id
518 574
519 obj_src = $(objs:.o=.c) 575 obj_src = $(objs:.o=.c)
520 576
521 ${libsrc}DOC: ${libsrc}make-docfile NEEDTODUMP ${temacs_deps} ${EXE_TARGET} 577 $(LIB_SRC)/DOC: $(LIB_SRC)/make-docfile $(BLDSRC)/NEEDTODUMP $(temacs_deps)
522 #ifdef QUICK_BUILD 578 #ifdef QUICK_BUILD
523 if test ! -f $@ ; then \ 579 if test ! -f $@ ; then \
524 #else 580 #else
525 if true ; then \ 581 if true ; then \
526 #endif 582 #endif
527 $(TEMACS_BATCH) -l $(LISP)/make-docfile.el -- \ 583 $(TEMACS_BATCH) -l $(LISP)/make-docfile.el -- \
528 -o ${libsrc}DOC -d ${srcdir} -i ${libsrc}../site-packages \ 584 -o $(LIB_SRC)/DOC -d $(SRC) -i $(LIB_SRC)/../site-packages \
529 ${obj_src} ${mallocdocsrc} ${rallocdocsrc} \ 585 $(obj_src) $(mallocdocsrc) $(rallocdocsrc) \
530 ${extra_doc_files} ; fi 586 $(extra_doc_files) ; fi
531 587
532 ${libsrc}make-dump-id: 588 $(LIB_SRC)/make-dump-id:
533 cd ${libsrc} && $(RECURSIVE_MAKE) make-dump-id 589 cd $(LIB_SRC) && $(RECURSIVE_MAKE) make-dump-id
534 590
535 ${libsrc}make-docfile: 591 $(LIB_SRC)/make-docfile:
536 cd ${libsrc} && $(RECURSIVE_MAKE) make-docfile 592 cd $(LIB_SRC) && $(RECURSIVE_MAKE) make-docfile
537 593
538 .PHONY: fastdump 594 .PHONY: fastdump
539 fastdump: ${EXE_TARGET} 595 fastdump: $(RAW_EXE)
540 @$(RM) ${DUMP_TARGET} && touch SATISFIED 596 @$(RM) $(DUMP_TARGET) && touch SATISFIED
541 -${dump_temacs} 597 -$(dump_temacs)
542 @$(XEMACS_BATCH) -f list-load-path-shadows 598 @$(XEMACS_BATCH) -f list-load-path-shadows
543 599
544 .PHONY: all-elc 600 .PHONY: all-elc
545 all-elc: 601 all-elc:
546 cd .. && $(RECURSIVE_MAKE) 602 cd .. && $(RECURSIVE_MAKE)
547 603
548 ######################################################################### 604 #########################################################################
549 605 ## Subsidiary dependency rules ##
550 ## Subsidiary dependency rules 606 #########################################################################
551 607
552 #ifdef I18N3 608 #ifdef I18N3
553 609
554 # if defined(SPARC) && !defined(USG) 610 # if defined(SPARC) && !defined(USG)
555 xgettext= /usr/openwin/bin/xgettext 611 xgettext= /usr/openwin/bin/xgettext
559 xgettext= xgettext 615 xgettext= xgettext
560 xgettext_args= -s -d emacs -M_X messages 616 xgettext_args= -s -d emacs -M_X messages
561 msgfmt= msgfmt 617 msgfmt= msgfmt
562 #endif 618 #endif
563 619
564 ${mo_dir}emacs.po: ${libsrc}make-msgfile ${libsrc}make-po ${objs} 620 $(LIB_SRC)/emacs.po: $(LIB_SRC)/make-msgfile $(LIB_SRC)/make-po $(objs)
565 ${libsrc}make-msgfile -o ${libsrc}messages ${objs} 621 $(LIB_SRC)/make-msgfile -o $(LIB_SRC)/messages $(objs)
566 cd ${libsrc} && ${xgettext} ${xgettext_args} 622 cd $(LIB_SRC) && $(xgettext) $(xgettext_args)
567 $(RM) ${mo_dir}emacs.po 623 $(RM) $(LIB_SRC)/emacs.po
568 cd ${libsrc} && ${libsrc}make-po -a ${mo_dir}emacs.po DOC 624 cd $(LIB_SRC) && $(LIB_SRC)/make-po -a $(LIB_SRC)/emacs.po DOC
569 625
570 ${mo_dir}emacs.mo: ${mo_dir}emacs.po 626 $(LIB_SRC)/emacs.mo: $(LIB_SRC)/emacs.po
571 cd ${mo_dir} && ${msgfmt} -o emacs.mo emacs.po 627 cd $(LIB_SRC)/ && $(msgfmt) -o emacs.mo emacs.po
572 628
573 ${libsrc}make-msgfile: 629 $(LIB_SRC)/make-msgfile:
574 cd ${libsrc} && $(RECURSIVE_MAKE) make-msgfile 630 cd $(LIB_SRC) && $(RECURSIVE_MAKE) make-msgfile
575 631
576 ${libsrc}make-po: 632 $(LIB_SRC)/make-po:
577 cd ${libsrc} && $(RECURSIVE_MAKE) make-po 633 cd $(LIB_SRC) && $(RECURSIVE_MAKE) make-po
578 634
579 #endif /* I18N3 */ 635 #endif /* I18N3 */
580 636
581 TopLevelEmacsShell.o : ${srcdir}/EmacsShell-sub.c config.h xintrinsicp.h EmacsShellP.h 637 TopLevelEmacsShell.o : $(SRC)/EmacsShell-sub.c config.h xintrinsicp.h EmacsShellP.h
582 $(CC) -c $(cflags) -DDEFINE_TOP_LEVEL_EMACS_SHELL ${srcdir}/EmacsShell-sub.c 638 $(CC) -c $(cflags) -DDEFINE_TOP_LEVEL_EMACS_SHELL $(SRC)/EmacsShell-sub.c
583 mv EmacsShell-sub.o TopLevelEmacsShell.o 639 mv EmacsShell-sub.o TopLevelEmacsShell.o
584 640
585 TopLevelEmacsShell.c.rtl : ${srcdir}/EmacsShell-sub.c config.h xintrinsicp.h EmacsShellP.h 641 TopLevelEmacsShell.c.rtl : $(SRC)/EmacsShell-sub.c config.h xintrinsicp.h EmacsShellP.h
586 $(CC) -dr -c $(cflags) -DDEFINE_TOP_LEVEL_EMACS_SHELL ${srcdir}/EmacsShell-sub.c 642 $(CC) -dr -c $(cflags) -DDEFINE_TOP_LEVEL_EMACS_SHELL $(SRC)/EmacsShell-sub.c
587 mv EmacsShell-sub.c.rtl TopLevelEmacsShell.c.rtl 643 mv EmacsShell-sub.c.rtl TopLevelEmacsShell.c.rtl
588 644
589 TransientEmacsShell.o : ${srcdir}/EmacsShell-sub.c TopLevelEmacsShell.o config.h xintrinsicp.h EmacsShellP.h 645 TransientEmacsShell.o : $(SRC)/EmacsShell-sub.c TopLevelEmacsShell.o config.h xintrinsicp.h EmacsShellP.h
590 $(CC) -c $(cflags) -DDEFINE_TRANSIENT_EMACS_SHELL ${srcdir}/EmacsShell-sub.c 646 $(CC) -c $(cflags) -DDEFINE_TRANSIENT_EMACS_SHELL $(SRC)/EmacsShell-sub.c
591 mv EmacsShell-sub.o TransientEmacsShell.o 647 mv EmacsShell-sub.o TransientEmacsShell.o
592 648
593 TransientEmacsShell.c.rtl : ${srcdir}/EmacsShell-sub.c TopLevelEmacsShell.o config.h xintrinsicp.h EmacsShellP.h 649 TransientEmacsShell.c.rtl : $(SRC)/EmacsShell-sub.c TopLevelEmacsShell.o config.h xintrinsicp.h EmacsShellP.h
594 $(CC) -dr -c $(cflags) -DDEFINE_TRANSIENT_EMACS_SHELL ${srcdir}/EmacsShell-sub.c 650 $(CC) -dr -c $(cflags) -DDEFINE_TRANSIENT_EMACS_SHELL $(SRC)/EmacsShell-sub.c
595 mv EmacsShell-sub.c.rtl TransientEmacsShell.c.rtl 651 mv EmacsShell-sub.c.rtl TransientEmacsShell.c.rtl
596 652
597 ## The above rules are subject to a race condition if using a parallel make. 653 ## The above rules are subject to a race condition if using a parallel make.
598 TransientEmacsShell.o : TopLevelEmacsShell.o 654 TransientEmacsShell.o : TopLevelEmacsShell.o
599 TransientEmacsShell.c.rtl : TopLevelEmacsShell.c.rtl 655 TransientEmacsShell.c.rtl : TopLevelEmacsShell.c.rtl
615 external_client_motif_objs_nonshared = ExternalClient-Xm-nonshared.o extw-Xt-nonshared.o extw-Xlib-nonshared.o 671 external_client_motif_objs_nonshared = ExternalClient-Xm-nonshared.o extw-Xt-nonshared.o extw-Xlib-nonshared.o
616 external_client_xt_objs_nonshared = ExternalClient-Xt-nonshared.o extw-Xt-nonshared.o extw-Xlib-nonshared.o 672 external_client_xt_objs_nonshared = ExternalClient-Xt-nonshared.o extw-Xt-nonshared.o extw-Xlib-nonshared.o
617 external_client_xlib_objs_nonshared = ExternalClient-Xlib-nonshared.o extw-Xlib-nonshared.o 673 external_client_xlib_objs_nonshared = ExternalClient-Xlib-nonshared.o extw-Xlib-nonshared.o
618 674
619 ## Add dependencies so things work right with a parallel make 675 ## Add dependencies so things work right with a parallel make
620 ExternalClient-Xm-shared.o: ${srcdir}/ExternalClient.c ExternalClient-Xt-shared.o ExternalClient-Xm-nonshared.o 676 ExternalClient-Xm-shared.o: $(SRC)/ExternalClient.c ExternalClient-Xt-shared.o ExternalClient-Xm-nonshared.o
621 $(CC) -c $(pic_arg) $(cflags) -DEXTW_USES_MOTIF ${srcdir}/ExternalClient.c 677 $(CC) -c $(pic_arg) $(cflags) -DEXTW_USES_MOTIF $(SRC)/ExternalClient.c
622 mv ExternalClient.o ExternalClient-Xm-shared.o 678 mv ExternalClient.o ExternalClient-Xm-shared.o
623 679
624 ExternalClient-Xt-shared.o: ${srcdir}/ExternalClient.c ExternalClient-Xt-nonshared.o 680 ExternalClient-Xt-shared.o: $(SRC)/ExternalClient.c ExternalClient-Xt-nonshared.o
625 $(CC) -c $(pic_arg) $(cflags) ${srcdir}/ExternalClient.c 681 $(CC) -c $(pic_arg) $(cflags) $(SRC)/ExternalClient.c
626 mv ExternalClient.o ExternalClient-Xt-shared.o 682 mv ExternalClient.o ExternalClient-Xt-shared.o
627 683
628 ExternalClient-Xlib-shared.o: ${srcdir}/ExternalClient-Xlib.c ExternalClient-Xlib-nonshared.o 684 ExternalClient-Xlib-shared.o: $(SRC)/ExternalClient-Xlib.c ExternalClient-Xlib-nonshared.o
629 $(CC) -c $(pic_arg) $(cflags) ${srcdir}/ExternalClient-Xlib.c 685 $(CC) -c $(pic_arg) $(cflags) $(SRC)/ExternalClient-Xlib.c
630 mv ExternalClient-Xlib.o ExternalClient-Xlib-shared.o 686 mv ExternalClient-Xlib.o ExternalClient-Xlib-shared.o
631 687
632 ExternalClient-Xm-nonshared.o: ${srcdir}/ExternalClient.c ExternalClient-Xt-nonshared.o 688 ExternalClient-Xm-nonshared.o: $(SRC)/ExternalClient.c ExternalClient-Xt-nonshared.o
633 $(CC) -c $(cflags) -DEXTW_USES_MOTIF ${srcdir}/ExternalClient.c 689 $(CC) -c $(cflags) -DEXTW_USES_MOTIF $(SRC)/ExternalClient.c
634 mv ExternalClient.o ExternalClient-Xm-nonshared.o 690 mv ExternalClient.o ExternalClient-Xm-nonshared.o
635 691
636 ExternalClient-Xt-nonshared.o: ${srcdir}/ExternalClient.c 692 ExternalClient-Xt-nonshared.o: $(SRC)/ExternalClient.c
637 $(CC) -c $(cflags) ${srcdir}/ExternalClient.c 693 $(CC) -c $(cflags) $(SRC)/ExternalClient.c
638 mv ExternalClient.o ExternalClient-Xt-nonshared.o 694 mv ExternalClient.o ExternalClient-Xt-nonshared.o
639 695
640 ExternalClient-Xlib-nonshared.o: ${srcdir}/ExternalClient-Xlib.c 696 ExternalClient-Xlib-nonshared.o: $(SRC)/ExternalClient-Xlib.c
641 $(CC) -c $(cflags) ${srcdir}/ExternalClient-Xlib.c 697 $(CC) -c $(cflags) $(SRC)/ExternalClient-Xlib.c
642 mv ExternalClient-Xlib.o ExternalClient-Xlib-nonshared.o 698 mv ExternalClient-Xlib.o ExternalClient-Xlib-nonshared.o
643 699
644 ## We compile the common files twice (once with PIC and once without) 700 ## We compile the common files twice (once with PIC and once without)
645 ## because on some systems, compiling with PIC but not linking into 701 ## because on some systems, compiling with PIC but not linking into
646 ## a shared library messes things up. 702 ## a shared library messes things up.
647 703
648 extw-Xt-shared.o: ${srcdir}/extw-Xt.c extw-Xt-nonshared.o 704 extw-Xt-shared.o: $(SRC)/extw-Xt.c extw-Xt-nonshared.o
649 $(CC) -c $(pic_arg) $(cflags) ${srcdir}/extw-Xt.c 705 $(CC) -c $(pic_arg) $(cflags) $(SRC)/extw-Xt.c
650 mv extw-Xt.o extw-Xt-shared.o 706 mv extw-Xt.o extw-Xt-shared.o
651 707
652 extw-Xlib-shared.o: ${srcdir}/extw-Xlib.c extw-Xlib-nonshared.o 708 extw-Xlib-shared.o: $(SRC)/extw-Xlib.c extw-Xlib-nonshared.o
653 $(CC) -c $(pic_arg) $(cflags) ${srcdir}/extw-Xlib.c 709 $(CC) -c $(pic_arg) $(cflags) $(SRC)/extw-Xlib.c
654 mv extw-Xlib.o extw-Xlib-shared.o 710 mv extw-Xlib.o extw-Xlib-shared.o
655 711
656 extw-Xt-nonshared.o: ${srcdir}/extw-Xt.c 712 extw-Xt-nonshared.o: $(SRC)/extw-Xt.c
657 $(CC) -c $(cflags) ${srcdir}/extw-Xt.c 713 $(CC) -c $(cflags) $(SRC)/extw-Xt.c
658 mv extw-Xt.o extw-Xt-nonshared.o 714 mv extw-Xt.o extw-Xt-nonshared.o
659 715
660 extw-Xlib-nonshared.o: ${srcdir}/extw-Xlib.c 716 extw-Xlib-nonshared.o: $(SRC)/extw-Xlib.c
661 $(CC) -c $(cflags) ${srcdir}/extw-Xlib.c 717 $(CC) -c $(cflags) $(SRC)/extw-Xlib.c
662 mv extw-Xlib.o extw-Xlib-nonshared.o 718 mv extw-Xlib.o extw-Xlib-nonshared.o
663 719
664 libextcli_Xm.a: ${external_client_motif_objs_nonshared} 720 libextcli_Xm.a: $(external_client_motif_objs_nonshared)
665 ar r libextcli_Xm.a ${external_client_motif_objs_nonshared} 721 ar r libextcli_Xm.a $(external_client_motif_objs_nonshared)
666 722
667 libextcli_Xt.a: ${external_client_xt_objs_nonshared} 723 libextcli_Xt.a: $(external_client_xt_objs_nonshared)
668 ar r libextcli_Xt.a ${external_client_xt_objs_nonshared} 724 ar r libextcli_Xt.a $(external_client_xt_objs_nonshared)
669 725
670 libextcli_Xlib.a: ${external_client_xlib_objs_nonshared} 726 libextcli_Xlib.a: $(external_client_xlib_objs_nonshared)
671 ar r libextcli_Xlib.a ${external_client_xlib_objs_nonshared} 727 ar r libextcli_Xlib.a $(external_client_xlib_objs_nonshared)
672 728
673 ## Now we try to figure out how to link a shared library. 729 ## Now we try to figure out how to link a shared library.
674 ## If we cannot figure it out, leave EXTW_LINK undefined and a shared 730 ## If we cannot figure it out, leave EXTW_LINK undefined and a shared
675 ## library will not be created. 731 ## library will not be created.
676 732
687 extw_link_mid = -o 743 extw_link_mid = -o
688 extw_link_end = 744 extw_link_end =
689 # endif 745 # endif
690 # elif defined (USG5) 746 # elif defined (USG5)
691 # if defined (IRIX) 747 # if defined (IRIX)
692 # define EXTW_LINK(objs, output) $(LD) -shared -g -check_registry ${TOOLROOT}/usr/lib/so_locations objs -o output 748 # define EXTW_LINK(objs, output) $(LD) -shared -g -check_registry $(TOOLROOT)/usr/lib/so_locations objs -o output
693 extw_link_beg = $(LD) -shared -g -check_registry ${TOOLROOT}/usr/lib/so_locations 749 extw_link_beg = $(LD) -shared -g -check_registry $(TOOLROOT)/usr/lib/so_locations
694 extw_link_mid = -o 750 extw_link_mid = -o
695 extw_link_end = 751 extw_link_end =
696 # else /* not IRIX */ 752 # else /* not IRIX */
697 # define EXTW_LINK(objs, output) $(CC) -G objs -z text -o output 753 # define EXTW_LINK(objs, output) $(CC) -G objs -z text -o output
698 extw_link_beg = $(CC) -G 754 extw_link_beg = $(CC) -G
713 # endif /* !(DEC_ALPHA && OSF1) */ 769 # endif /* !(DEC_ALPHA && OSF1) */
714 # endif /* not USG5 */ 770 # endif /* not USG5 */
715 771
716 #ifdef EXTW_LINK 772 #ifdef EXTW_LINK
717 773
718 libextcli_Xm.so.1: ${external_client_motif_objs_shared} 774 libextcli_Xm.so.1: $(external_client_motif_objs_shared)
719 ${extw_link_beg} ${external_client_motif_objs_shared} ${extw_link_mid} libextcli_Xm.so.1 ${extw_link_end} 775 $(extw_link_beg) $(external_client_motif_objs_shared) $(extw_link_mid) libextcli_Xm.so.1 $(extw_link_end)
720 776
721 libextcli_Xt.so.1: ${external_client_xt_objs_shared} 777 libextcli_Xt.so.1: $(external_client_xt_objs_shared)
722 ${extw_link_beg} ${external_client_xt_objs_shared} ${extw_link_mid} libextcli_Xt.so.1 ${extw_link_end} 778 $(extw_link_beg) $(external_client_xt_objs_shared) $(extw_link_mid) libextcli_Xt.so.1 $(extw_link_end)
723 779
724 libextcli_Xlib.so.1: ${external_client_xlib_objs_shared} 780 libextcli_Xlib.so.1: $(external_client_xlib_objs_shared)
725 ${extw_link_beg} ${external_client_xlib_objs_shared} ${extw_link_mid} libextcli_Xlib.so.1 ${extw_link_end} 781 $(extw_link_beg) $(external_client_xlib_objs_shared) $(extw_link_mid) libextcli_Xlib.so.1 $(extw_link_end)
726 782
727 #endif /* EXTW_LINK */ 783 #endif /* EXTW_LINK */
728 784
729 #endif /* EXTERNAL_WIDGET */ 785 #endif /* EXTERNAL_WIDGET */
730 786
731 config.h: ${srcdir}/config.h.in 787 config.h: $(SRC)/config.h.in
732 Emacs.ad.h: ${srcdir}/${etcdir}Emacs.ad 788 Emacs.ad.h: $(ETC)/Emacs.ad
733 789
734 config.h sheap-adjust.h paths.h Emacs.ad.h : 790 config.h sheap-adjust.h paths.h Emacs.ad.h :
735 @echo "The file $@ needs to be re-generated." 791 @echo "The file $@ needs to be re-generated."
736 @echo "Please run a make in the top level directory." 792 @echo "Please run a make in the top level directory."
737 @echo "Consult the file \`INSTALL' for instructions for building XEmacs." 793 @echo "Consult the file \`INSTALL' for instructions for building XEmacs."
746 ## overflow. 802 ## overflow.
747 803
748 #ifdef C_ALLOCA 804 #ifdef C_ALLOCA
749 #else 805 #else
750 #ifndef HAVE_ALLOCA 806 #ifndef HAVE_ALLOCA
751 allocax.o : ${srcdir}/alloca.s config.h 807 allocax.o : $(SRC)/alloca.s config.h
752 ## $(CPP) is cc -E, which may get confused by filenames 808 ## $(CPP) is cc -E, which may get confused by filenames
753 ## that do not end in .c. So copy file to a safe name. */ 809 ## that do not end in .c. So copy file to a safe name. */
754 ## cp ${srcdir}/alloca.s allocatem.c 810 ## cp $(SRC)/alloca.s allocatem.c
755 ## Remove any ^L, blank lines, and preprocessor comments, 811 ## Remove any ^L, blank lines, and preprocessor comments,
756 ## since some assemblers barf on them. Use a different basename for the 812 ## since some assemblers barf on them. Use a different basename for the
757 ## output file, since some stupid compilers (Green Hill) use that 813 ## output file, since some stupid compilers (Green Hill) use that
758 ## name for the intermediate assembler file. 814 ## name for the intermediate assembler file.
759 $(CPP) $(cppflags) allocatem.c | \ 815 $(CPP) $(cppflags) allocatem.c | \
766 #endif /* HAVE_ALLOCA */ 822 #endif /* HAVE_ALLOCA */
767 #endif /* ! defined (C_ALLOCA) */ 823 #endif /* ! defined (C_ALLOCA) */
768 824
769 #ifdef HAVE_NATIVE_SOUND 825 #ifdef HAVE_NATIVE_SOUND
770 sound_cflags=@sound_cflags@ 826 sound_cflags=@sound_cflags@
771 sunplay.o: ${srcdir}/sunplay.c 827 sunplay.o: $(SRC)/sunplay.c
772 $(CC) -c $(sound_cflags) $(cflags) ${srcdir}/sunplay.c 828 $(CC) -c $(sound_cflags) $(cflags) $(SRC)/sunplay.c
773 hpplay.o: ${srcdir}/hpplay.c 829 hpplay.o: $(SRC)/hpplay.c
774 $(CC) -c -Demacs $(sound_cflags) $(cflags) ${srcdir}/hpplay.c 830 $(CC) -c -Demacs $(sound_cflags) $(cflags) $(SRC)/hpplay.c
775 #endif /* HAVE_NATIVE_SOUND */ 831 #endif /* HAVE_NATIVE_SOUND */
776 832
777 #if defined(HAVE_GLADE_GLADE_H) || defined(HAVE_GLADE_H) 833 #if defined(HAVE_GLADE_GLADE_H) || defined(HAVE_GLADE_H)
778 glade_files=glade.c 834 glade_files=glade.c
779 #endif 835 #endif
780 836
781 #ifdef HAVE_GTK 837 #ifdef HAVE_GTK
782 extra_doc_files=emacs-widget-accessors.c ui-byhand.c $(glade_files) 838 extra_doc_files=emacs-widget-accessors.c ui-byhand.c $(glade_files)
783 #endif 839 #endif
784 840
785 xemacs_res.o: ${srcdir}/../nt/xemacs.rc 841 xemacs_res.o: $(SRC)/../nt/xemacs.rc
786 windres --include-dir ${srcdir}/../nt -i ${srcdir}/../nt/xemacs.rc -o $@ 842 windres --include-dir $(SRC)/../nt -i $(SRC)/../nt/xemacs.rc -o $@
787 843
788 ######################################################################### 844 #########################################################################
789 845 ## Other random crap ##
790 ## Other random crap 846 #########################################################################
791 847
792 dortl : $(obj_rtl) $(otherrtls) 848 dortl : $(obj_rtl) $(otherrtls)
793 echo "(defvar source-files '(" > $(LISP)/source-files.el 849 echo "(defvar source-files '(" > $(LISP)/source-files.el
794 (for a in $(obj_src) $(othersrcs);do \ 850 (for a in $(obj_src) $(othersrcs);do \
795 echo -n "\""$$a"\"" >> $(LISP)/source-files.el ;\ 851 echo -n "\""$$a"\"" >> $(LISP)/source-files.el ;\
796 done) 852 done)
797 echo "))" >> $(LISP)/source-files.el 853 echo "))" >> $(LISP)/source-files.el
798 854
799 ## Lint Section 855 ###################### Lint
800 LINT.c=$(LINT) $(LINTFLAGS) $(LINTINCLUDES) 856 LINT.c=$(LINT) $(LINTFLAGS) $(LINTINCLUDES)
801 LINTFILES= $(objs:.o=.ln) 857 LINTFILES= $(objs:.o=.ln)
802 LINTINCLUDES = $(cppflags) 858 LINTINCLUDES = $(cppflags)
803 ## LINTFLAGS= -fd -m -p -s -u -v -x 859 ## LINTFLAGS= -fd -m -p -s -u -v -x
804 LINTFLAGS= -fd -m -s -u -v -x 860 LINTFLAGS= -fd -m -s -u -v -x
805 .PHONY: lint 861 .PHONY: lint
806 lint: $(LINTFILES) 862 lint: $(LINTFILES)
807 $(LINT.c) $(LINTFILES) 863 $(LINT.c) $(LINTFILES)
808 ## end of Lint Section 864
809 865 ###################### Automated tests
810 ## We have automated tests!! 866 testdir = $(SRC)/../tests/automated
811 testdir = ${srcdir}/../tests/automated 867 batch_test_emacs = $(BATCH_PACKAGES) -l $(testdir)/test-harness.el -f batch-test-emacs $(testdir)
812 batch_test_emacs = ${BATCH_PACKAGES} -l ${testdir}/test-harness.el -f batch-test-emacs ${testdir}
813 868
814 .PHONY: check check-temacs check-features 869 .PHONY: check check-temacs check-features
815 check: 870 check:
816 $(DO_XEMACS) $(batch_test_emacs) 871 $(DO_XEMACS) $(batch_test_emacs)
817 check-temacs: 872 check-temacs:
818 $(TEMACS_BATCH) $(run_temacs_args) $(batch_test_emacs) 873 $(TEMACS_BATCH) $(run_temacs_args) $(batch_test_emacs)
819 check-features: all 874 check-features: all
820 $(XEMACS_BATCH) -l check-features.el 875 $(XEMACS_BATCH) -l check-features.el
821 876
822 ## Debugging targets: 877 ###################### Debugging targets
823 ## 878
824 ## None of the debugging products work with a dumped xemacs binary, 879 ## None of the debugging products work with a dumped xemacs binary,
825 ## because it does unexpected things like free memory that has been 880 ## because it does unexpected things like free memory that has been
826 ## malloc'ed in a *different* process!! So we need to run these on 881 ## malloc'ed in a *different* process!! So we need to run these on
827 ## temacs. 882 ## temacs.
828 883
829 ## RTC is Sun WorkShop's Run Time Checking, integrated with dbx 884 ## RTC is Sun WorkShop's Run Time Checking, integrated with dbx
830 rtc_patch.o: 885 rtc_patch.o:
831 rtc_patch_area -o $@ 886 rtc_patch_area -o $@
832 887
833 rtcmacs: $(temacs_deps) rtc_patch.o 888 rtcmacs: $(temacs_deps) rtc_patch.o
834 $(RM) ${EXE_TARGET}; $(RECURSIVE_MAKE) ${EXE_TARGET} RTC_patch_objs=rtc_patch.o 889 $(RM) $(RAW_EXE); $(RECURSIVE_MAKE) $(RAW_EXE) RTC_patch_objs=rtc_patch.o
835 mv ${EXE_TARGET} rtcmacs 890 mv $(RAW_EXE) rtcmacs
836 891
837 .PHONY: run-rtcmacs 892 .PHONY: run-rtcmacs
838 run-rtcmacs: rtcmacs 893 run-rtcmacs: rtcmacs
839 dbx -q -C -c \ 894 dbx -q -C -c \
840 'dbxenv rtc_error_log_file_name /dev/fd/1; \ 895 'dbxenv rtc_error_log_file_name /dev/fd/1; \
841 dbxenv suppress_startup_message 5.0; \ 896 dbxenv suppress_startup_message 5.0; \
842 ignore POLL; \ 897 ignore POLL; \
843 check -access; \ 898 check -access; \
844 suppress rui; \ 899 suppress rui; \
845 runargs -nd ${BATCH} ${run_temacs_args} -vanilla; \ 900 runargs -nd $(BATCH) $(run_temacs_args) -vanilla; \
846 run' rtcmacs 901 run' rtcmacs
847 902
848 debug-temacs: ${EXE_TARGET} 903 debug-temacs: $(RAW_EXE)
849 -${debug_temacs} 904 -gdb $(RAW_EXE)
850 905
851 ## Purify, Quantify, PureCoverage are software quality products from 906 ## Purify, Quantify, PureCoverage are software quality products from
852 ## Rational, formerly Pure Atria, formerly Pure Software. 907 ## Rational, formerly Pure Atria, formerly Pure Software.
853 ## 908 ##
854 ## Purify 909 ## Purify
857 PURIFY_FLAGS =\ 912 PURIFY_FLAGS =\
858 #ifdef PDUMP 913 #ifdef PDUMP
859 -search-mmaps=yes\ 914 -search-mmaps=yes\
860 #endif 915 #endif
861 -chain-length=32 -ignore-signals=SIGPOLL\ 916 -chain-length=32 -ignore-signals=SIGPOLL\
862 -cache-dir=${blddir}/purecache -always-use-cache-dir=yes 917 -cache-dir=$(blddir)/purecache -always-use-cache-dir=yes
863 918
864 puremacs: $(temacs_deps) 919 puremacs: $(temacs_deps)
865 $(PURIFY_PROG) $(PURIFY_FLAGS) $(LD) $(temacs_link_args) $(PURIFY_LIBS) 920 $(PURIFY_PROG) $(PURIFY_FLAGS) $(LD) $(temacs_link_args) $(PURIFY_LIBS)
866 cp $@ ${EXE_TARGET} 921 cp $@ $(RAW_EXE)
867 922
868 ## Quantify 923 ## Quantify
869 #ifdef QUANTIFY 924 #ifdef QUANTIFY
870 QUANTIFY_PROG = quantify 925 QUANTIFY_PROG = quantify
871 QUANTIFY_HOME = `$(QUANTIFY_PROG) -print-home-dir` 926 QUANTIFY_HOME = `$(QUANTIFY_PROG) -print-home-dir`
873 cppflags += -I$(QUANTIFY_HOME) 928 cppflags += -I$(QUANTIFY_HOME)
874 temacs_link_args += $(QUANTIFY_HOME)/quantify_stubs.a 929 temacs_link_args += $(QUANTIFY_HOME)/quantify_stubs.a
875 930
876 quantmacs: $(temacs_deps) 931 quantmacs: $(temacs_deps)
877 $(QUANTIFY_PROG) $(QUANTIFY_FLAGS) $(LD) $(temacs_link_args) 932 $(QUANTIFY_PROG) $(QUANTIFY_FLAGS) $(LD) $(temacs_link_args)
878 cp $@ ${EXE_TARGET} 933 cp $@ $(RAW_EXE)
879 #endif /* QUANTIFY */ 934 #endif /* QUANTIFY */
880 935
881 PURECOV_PROG=purecov 936 PURECOV_PROG=purecov
882 covmacs: $(temacs_deps) 937 covmacs: $(temacs_deps)
883 $(PURECOV_PROG) $(LD) $(temacs_link_args) 938 $(PURECOV_PROG) $(LD) $(temacs_link_args)
884 939
940 ###################### Clean
941
885 .PHONY: mostlyclean clean distclean realclean versionclean extraclean 942 .PHONY: mostlyclean clean distclean realclean versionclean extraclean
886 mostlyclean: 943 mostlyclean:
887 $(RM) temacs puremacs quantmacs *.o *.i \ 944 $(RM) *.o *.i *.rtl *.ln core \
888 core temacs.exe sheap-adjust.h 945 temacs puremacs quantmacs covmacs rtcmacs temacs.exe \
946 sheap-adjust.h dump-id.c $(BLDSRC)/NEEDTODUMP SATISFIED \
947 $(LIB_SRC)/*.po $(LIB_SRC)/*.mo
948 versionclean:
949 $(RM) $(RAW_EXE) $(DUMP_TARGET) $(LIB_SRC)/DOC
950 ## Remove the generated load files here; they cause lots of problems
951 ## when they don't work right.
889 clean: mostlyclean versionclean 952 clean: mostlyclean versionclean
890 $(RM) libextcli* 953 $(RM) libextcli* $(LISP)/auto-autoloads.el* $(LISP)/custom-load.el* \
954 $(LISP)/mule/auto-autoloads.el* $(LISP)/mule/custom-load.el* \
955 $(SRCMODULES)/auto-autoloads.el* $(SRCMODULES)/custom-load.el*
891 ## This is used in making a distribution. 956 ## This is used in making a distribution.
892 ## Do not use it on development directories! 957 ## Do not use it on development directories!
893 distclean: clean 958 distclean: clean
894 $(RM) config.h paths.h Emacs.ad.h \ 959 $(RM) config.h paths.h Emacs.ad.h $(LISP)/finder-inf.el* \
895 GNUmakefile Makefile Makefile.in TAGS ${PROGNAME}.* 960 GNUmakefile Makefile Makefile.in TAGS $(PROGNAME).*
896 realclean: distclean 961 realclean: distclean
897 versionclean:
898 $(RM) ${EXE_TARGET} ${DUMP_TARGET} ${libsrc}DOC
899 extraclean: realclean 962 extraclean: realclean
900 $(RM) *~ \#* m/*~ m/\#* s/*~ s/\#* 963 $(RM) *~ \#* m/*~ m/\#* s/*~ s/\#*
964
965 ###################### Lock, unlock
901 966
902 .PHONY : lock unlock 967 .PHONY : lock unlock
903 SOURCES = *.[chm] *.pswm [sm]/* COPYING paths.h.in Makefile.in.in \ 968 SOURCES = *.[chm] *.pswm [sm]/* COPYING paths.h.in Makefile.in.in \
904 config.h.in README COPYING ChangeLog 969 config.h.in README COPYING ChangeLog
905 unlock: 970 unlock:
906 chmod u+w $(SOURCES) 971 chmod u+w $(SOURCES)
907 972
908 relock: 973 relock:
909 chmod -w $(SOURCES) 974 chmod -w $(SOURCES)
910 975
976 ###################### Installation
977
911 ## Header files for ellcc 978 ## Header files for ellcc
912 #ifdef HAVE_SHLIB 979 #ifdef HAVE_SHLIB
913 MAKEPATH=../lib-src/make-path 980 MAKEPATH=../lib-src/make-path
914 install: ${PROGNAME} 981 install: $(PROGNAME)
915 ${MAKEPATH} ${archlibdir}/include ${archlibdir}/include/m ${archlibdir}/include/s 982 $(MAKEPATH) $(archlibdir)/include $(archlibdir)/include/m $(archlibdir)/include/s
916 -@echo "Copying include files for ellcc..." 983 -@echo "Copying include files for ellcc..."
917 -@hdir=`pwd`; \ 984 -@hdir=`pwd`; \
918 cd ${srcdir}; hdrdir2=`pwd`; cd $$hdir; \ 985 cd $(SRC); hdrdir2=`pwd`; cd $$hdir; \
919 test "$$hdrdir2" != "$$hdir" && hdir="$$hdir $$hdrdir2"; \ 986 test "$$hdrdir2" != "$$hdir" && hdir="$$hdir $$hdrdir2"; \
920 (for thisdir in $$hdir; do \ 987 (for thisdir in $$hdir; do \
921 cd $$thisdir && \ 988 cd $$thisdir && \
922 (hdrtars=; \ 989 (hdrtars=; \
923 for hdrfile in *.h; do \ 990 for hdrfile in *.h; do \
924 hdrtars="$$hdrtars $$hdrfile"; \ 991 hdrtars="$$hdrtars $$hdrfile"; \
925 done; \ 992 done; \
926 test -d s && hdrtars="$$hdrtars s/*"; \ 993 test -d s && hdrtars="$$hdrtars s/*"; \
927 test -d m && hdrtars="$$hdrtars m/*"; \ 994 test -d m && hdrtars="$$hdrtars m/*"; \
928 test -n "$$hdrtars" && (tar cf - $$hdrtars) | \ 995 test -n "$$hdrtars" && (tar cf - $$hdrtars) | \
929 (cd ${archlibdir}/include && umask 022 && tar xf -); \ 996 (cd $(archlibdir)/include && umask 022 && tar xf -); \
930 chmod 755 ${archlibdir}/include; \ 997 chmod 755 $(archlibdir)/include; \
931 test -d ${archlibdir}/include/s && \ 998 test -d $(archlibdir)/include/s && \
932 chmod 755 ${archlibdir}/include/s; \ 999 chmod 755 $(archlibdir)/include/s; \
933 test -d ${archlibdir}/include/m && \ 1000 test -d $(archlibdir)/include/m && \
934 chmod 755 ${archlibdir}/include/s;) \ 1001 chmod 755 $(archlibdir)/include/s;) \
935 done) 1002 done)
936 #endif 1003 #endif
1004
1005 ###################### Dependencies
937 1006
938 ## Dependency processing using home-grown script, not makedepend 1007 ## Dependency processing using home-grown script, not makedepend
939 .PHONY: depend 1008 .PHONY: depend
940 FRC.depend: 1009 FRC.depend:
941 depend: FRC.depend 1010 depend: FRC.depend
942 cd ${srcdir} && $(RM) depend.tmp && \ 1011 cd $(SRC) && $(RM) depend.tmp && \
943 perl ./make-src-depend > depend.tmp && \ 1012 perl ./make-src-depend > depend.tmp && \
944 if cmp -s depend depend.tmp; \ 1013 if cmp -s depend depend.tmp; \
945 then $(RM) depend.tmp; \ 1014 then $(RM) depend.tmp; \
946 else $(RM) depend && mv depend.tmp depend; \ 1015 else $(RM) depend && mv depend.tmp depend; \
947 fi 1016 fi
1017
1018 ###################### Unicode encapsulation
1019
1020 .PHONY: unicode-encapsulate
1021 FRC.unicode-encapsulate:
1022 unicode-encapsulate: FRC.unicode-encapsulate
1023 cd $(SRC) && \
1024 perl ../lib-src/make-mswin-unicode.pl --c-output intl-auto-encap-win32.c --h-output intl-auto-encap-win32.h intl-encap-win32.c