XEmacs 21.2-b1
[chise/xemacs-chise.git.1] / src / Makefile.in.in
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
6 ## This file is part of XEmacs.
7
8 ## XEmacs is free software; you can redistribute it and/or modify it
9 ## under the terms of the GNU General Public License as published by the
10 ## Free Software Foundation; either version 2, or (at your option) any
11 ## later version.
12
13 ## XEmacs is distributed in the hope that it will be useful, but WITHOUT
14 ## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 ## FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
16 ## for more details.
17
18 ## You should have received a copy of the GNU General Public License
19 ## along with XEmacs; see the file COPYING.  If not, write to
20 ## the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21 ## Boston, MA 02111-1307, USA.
22
23 ## Synched up with: Not synched with FSF.
24
25 PROGNAME=@PROGNAME@
26
27 all: ${PROGNAME}
28 .PHONY : all release dump-elc dump-elcs all-elc all-elcs lint
29
30 ## For performance and consistency, no built-in rules.
31 .SUFFIXES:
32 .SUFFIXES: .c .h .o .i .s .dep
33
34 @SET_MAKE@
35 SHELL=/bin/sh
36 RM = rm -f
37
38 lispdir = ${srcdir}/../lisp/
39 libsrc = ../lib-src/
40 etcdir = ../etc/
41
42 ## Here are the things that we expect ../configure to edit.
43 prefix=@prefix@
44 srcdir=@srcdir@
45 blddir=@blddir@
46 version=@version@
47 CC=@CC@
48 CPP=@CPP@
49 CFLAGS=@CFLAGS@
50 CPPFLAGS=@CPPFLAGS@
51 LDFLAGS=@LDFLAGS@
52 RECURSIVE_MAKE=@RECURSIVE_MAKE@
53
54 c_switch_all=@c_switch_all@
55 ld_switch_all=@ld_switch_all@
56 ld_libs_all=@ld_libs_all@
57 ld_dynamic_link_flags=@ld_dynamic_link_flags@
58
59 extra_objs=@extra_objs@
60 LN_S=@LN_S@
61
62 ld_switch_shared=@ld_switch_shared@
63 start_files=@start_files@
64 start_flags=@start_flags@
65 LD=@ld@
66 lib_gcc=@lib_gcc@
67 ##libmcheck=@libmcheck@
68
69 #define NOT_C_CODE
70 #include "config.h"
71
72 ## With the traditional VPATH setting, it is not possible to
73 ## simultaneously compile in-place and in another directory.  The
74 ## mistaken definition is that *all* dependencies are searched for in
75 ## the VPATH directory, rather than just the dependencies that are not
76 ## themselves targets.  Thus, if there is an up-to-date .o file in the
77 ## in-place location, it will not get recompiled in the not-in-place
78 ## location.
79
80 ## The GNU Make "vpath" directive continues this tradition, but at
81 ## least lets you restrict the classes of files that it applies to.
82 ## This allows us to kludge around the problem.
83
84 #ifdef USE_GNU_MAKE
85 vpath %.c @srcdir@
86 vpath %.h @srcdir@
87 ## now list files that should NOT be searched in the srcdir.
88 ## This includes any .c or .h built from something else
89 ## (e.g. a .in file).
90 vpath config.h
91 vpath paths.h
92 vpath Emacs.ad.h
93 vpath puresize-adjust.h
94 vpath sheap-adjust.h
95 #else
96 VPATH=@srcdir@
97 #endif
98
99 RM = rm -f
100
101 #ifdef HAVE_NATIVE_SOUND
102 sound_cflags=@sound_cflags@
103 #endif
104
105 LWLIB_SRCDIR = ${srcdir}/../lwlib
106
107 #ifdef HAVE_X_WINDOWS
108 lwlib_libs = ../lwlib/liblw.a
109 lwlib_deps = $(lwlib_libs)
110 $(lwlib_libs) :
111         cd ../lwlib && $(RECURSIVE_MAKE)
112
113 x_objs=balloon_help.o balloon-x.o console-x.o device-x.o event-Xt.o frame-x.o\
114  glyphs-x.o objects-x.o redisplay-x.o xgccache.o xselect.o 
115
116 #ifdef AIX4
117 LIBI18N = -li18n
118 #endif /* AIX4 */
119
120 X11_libs = $(LIBI18N)
121 #endif /* HAVE_X_WINDOWS */
122
123 #ifdef HEAP_IN_DATA
124 sheap_obj=sheap.o
125 #endif
126
127 ## -Demacs is needed to make some files produce the correct version
128 ## for use in Emacs.
129
130 cppflags = $(CPPFLAGS) -Demacs -I. $(c_switch_all)
131 cflags   = $(CFLAGS) $(cppflags)
132 ldflags  = $(LDFLAGS) $(ld_switch_all) $(ld_dynamic_link_flags)
133
134 #ifdef SOLARIS2
135 %.o : %.c
136 #else
137 .c.o:
138 #endif
139         $(CC) -c $(cflags) $<
140
141 ## Create preprocessor output (debugging purposes only)
142 .c.i:
143 #ifdef __GNUC__
144         $(CC) -E $(cppflags) -o $@ $<
145 #else /* works on Solaris; what about other systems? */
146         $(CC) -P $(cppflags) $<
147 #endif /* compiler */
148
149 ## Create assembler output (debugging purposes only)
150 .c.s:
151         $(CC) -S -c $(cflags) $<
152
153 ## Create RTL files
154 %.c.rtl : %.c
155         $(CC) -dr -c $(cflags) $<
156
157 ## lastfile must follow all files whose initialized data areas should
158 ## be dumped as pure by dump-emacs.
159
160 ## NOTE: The last line cannot be all macros, because make will barf
161 ## if they all come out null.
162
163 objs=\
164  abbrev.o alloc.o blocktype.o buffer.o bytecode.o\
165  callint.o callproc.o casefiddle.o casetab.o chartab.o\
166  cmdloop.o cmds.o console.o console-stream.o\
167  data.o device.o dired.o doc.o doprnt.o dynarr.o\
168  editfns.o elhash.o emacs.o\
169  eval.o events.o $(extra_objs)\
170  event-stream.o extents.o faces.o\
171  fileio.o $(LOCK_OBJ) filemode.o floatfns.o fns.o font-lock.o\
172  frame.o general.o getloadavg.o glyphs.o glyphs-eimage.o\
173  $(gui_objs) hash.o imgproc.o indent.o insdel.o intl.o\
174  keymap.o $(RTC_patch_objs) line-number.o lread.o lstream.o\
175  macros.o marker.o md5.o minibuf.o objects.o opaque.o\
176  print.o process.o profile.o pure.o\
177  rangetab.o redisplay.o redisplay-output.o regex.o\
178  search.o $(sheap_obj) signal.o sound.o\
179  specifier.o strftime.o symbols.o syntax.o sysdep.o\
180  undo.o $(x_objs) widget.o window.o
181
182 obj_rtl = $(objs:.o=.c.rtl)
183
184 #ifdef REL_ALLOC
185 rallocdocsrc = ralloc.c
186 rallocobjs = ralloc.o
187 #endif
188
189 malloclib = $(libmcheck)
190 #ifndef SYSTEM_MALLOC
191 # ifdef GNU_MALLOC  /* GNU malloc */
192 #  ifdef ERROR_CHECK_MALLOC
193 #ifdef DOUG_LEA_MALLOC
194 mallocobjs = free-hook.o vm-limit.o
195 #else
196 mallocobjs = gmalloc.o free-hook.o vm-limit.o
197 #endif
198 mallocdocsrc = free-hook.c
199 #  else /* New GNU malloc, sans error checking */
200 #ifdef DOUG_LEA_MALLOC
201 mallocobjs = vm-limit.o
202 #else
203 mallocobjs = gmalloc.o vm-limit.o
204 #endif
205 mallocdocsrc =
206 #  endif /* ERROR_CHECK_MALLOC */
207 # else /* Older GNU malloc */
208 mallocobjs = malloc.o
209 mallocdocsrc =
210 # endif /* Older GNU malloc */
211 #else /* SYSTEM_MALLOC */
212 mallocobjs =
213 mallocdocsrc =
214 #ifdef USE_DEBUG_MALLOC
215 malloclib = -ldmalloc
216 #endif /* USE_DEBUG_MALLOC */
217 #endif /* SYSTEM_MALLOC */
218
219 #ifdef HAVE_X_WINDOWS
220
221 # ifdef EXTERNAL_WIDGET
222 external_widget_objs = ExternalShell.o extw-Xt-nonshared.o extw-Xlib-nonshared.o
223
224 ## Now we try to figure out how to link a shared library.
225 ## If we cannot figure it out, leave EXTW_LINK undefined and a shared
226 ## library will not be created.
227
228 # ifdef USE_GCC
229 #  ifdef USG5
230 #   define EXTW_LINK(objs, output) $(CC) -shared objs -Xlinker -z -Xlinker text -o output
231 extw_link_beg = $(CC) -shared
232 extw_link_mid = -Xlinker -z -Xlinker text -o
233 extw_link_end = 
234 ## I cannot figure out how to do shared a.out libraries, so just punt.
235 #  elif !defined (LINUX) || defined (__ELF__)
236 #   define EXTW_LINK(objs, output) $(CC) -shared objs -o output
237 extw_link_beg = $(CC) -shared
238 extw_link_mid = -o
239 extw_link_end = 
240 #  endif
241 # elif defined (USG5)
242 #  if defined (IRIX)
243 #   define EXTW_LINK(objs, output) $(LD) -shared -g -check_registry ${TOOLROOT}/usr/lib/so_locations objs -o output
244 extw_link_beg = $(LD) -shared -g -check_registry ${TOOLROOT}/usr/lib/so_locations 
245 extw_link_mid =  -o 
246 extw_link_end = 
247 #  else /* not IRIX */
248 #   define EXTW_LINK(objs, output) $(CC) -G objs -z text -o output
249 extw_link_beg = $(CC) -G
250 extw_link_mid = -z text -o
251 extw_link_end = 
252 #  endif /* not IRIX */
253 # else /* not USG5 */
254 #  if defined (DEC_ALPHA) && defined (OSF1)
255 #   define EXTW_LINK(objs, output) $(LD) $(ldflags) $(ld_switch_shared) -d objs -o output $(LIBES)
256 extw_link_beg = $(LD) $(ldflags) $(ld_switch_shared) -d 
257 extw_link_mid = -o 
258 extw_link_end = $(LIBES)
259 #  else /* !(DEC_ALPHA && OSF1) */
260 #   define EXTW_LINK(objs, output) $(LD) -dc objs -assert pure-text -o output
261 extw_link_beg = $(LD) -dc
262 extw_link_mid = -assert pure-text -o
263 extw_link_end = 
264 #  endif /* !(DEC_ALPHA && OSF1) */
265 # endif /* not USG5 */
266
267 #  ifdef LWLIB_USES_MOTIF
268 #    ifdef EXTW_LINK
269 motif_other_files = libextcli_Xm.a libextcli_Xm.so.1
270 #    else
271 motif_other_files = libextcli_Xm.a
272 #    endif
273 #endif /* LWLIB_USES_MOTIF */
274
275 #  ifdef EXTW_LINK
276 shared_other_files = libextcli_Xt.so.1 libextcli_Xlib.so.1
277 #  endif
278 other_files=\
279  ${motif_other_files}\
280  libextcli_Xt.a libextcli_Xlib.a\
281  ${shared_other_files}
282
283 all: ${other_files}
284 # endif /* EXTERNAL_WIDGET */
285
286 # if defined (HAVE_OFFIX_DND) || defined (HAVE_CDE)
287 dnd_objs = @dnd_objs@
288 # endif /* HAVE_OFFIX_DND || HAVE_CDE */
289
290 X11_objs =  EmacsFrame.o EmacsShell.o TopLevelEmacsShell.o TransientEmacsShell.o EmacsManager.o $(external_widget_objs) $(dnd_objs)
291 #endif /* HAVE_X_WINDOWS */
292
293 ## define otherobjs as list of object files that make-docfile
294 ## should not be told about.
295 otherobjs = $(BTL_objs) lastfile.o $(mallocobjs) $(rallocobjs) $(X11_objs)
296 otherrtls = $(otherobjs:.o=.c.rtl)
297 othersrcs = $(otherobjs:.o=.c)
298
299 LIBES = $(lwlib_libs) $(quantify_libs) $(malloclib) $(ld_libs_all) $(lib_gcc)
300
301 #ifdef I18N3
302 mo_dir = ${etcdir}
303 mo_file = ${mo_dir}emacs.mo
304 #endif
305
306 LOADPATH =  EMACSBOOTSTRAPLOADPATH="${lispdir}:${blddir}"
307 DUMPENV = $(LOADPATH)
308
309 release: temacs ${libsrc}DOC $(mo_file) ${other_files}
310 #ifdef CANNOT_DUMP
311         ln temacs ${PROGNAME}
312 #else
313 #ifdef HAVE_SHM
314         -if [ -w ${srcdir}/../lisp ]; then \
315           w=`pwd`; cd ${srcdir} && $${w}/temacs -nl -batch -l ${srcdir}/../lisp/inc-vers; \
316         else true; fi
317         @touch SATISFIED
318         -$(DUMPENV) ./temacs -nl -batch -l ${srcdir}/../lisp/loadup.el dump
319         @if test ! -f SATISFIED; then $(RECURSIVE_MAKE) $@; fi
320         @$(RM) SATISFIED
321 #else /* ! defined (HAVE_SHM) */
322         -if [ -w ${srcdir}/../lisp ]; then \
323           w=`pwd`; cd ${srcdir} && $${w}/temacs -batch -l ${srcdir}/../lisp/inc-vers; \
324         else true; fi
325         @touch SATISFIED
326         -$(DUMPENV) ./temacs -batch -l ${srcdir}/../lisp/loadup.el dump
327         @if test ! -f SATISFIED; then $(RECURSIVE_MAKE) $@; fi
328         @$(RM) SATISFIED
329 #endif /* ! defined (HAVE_SHM) */
330         touch release
331 #endif /* ! defined (CANNOT_DUMP) */
332
333 ${PROGNAME}: temacs ${libsrc}DOC $(mo_file) ${other_files} update-elc.stamp
334         @$(RM) $@ && touch SATISFIED
335         -$(DUMPENV) ./temacs -batch -l ${srcdir}/../lisp/loadup.el dump
336         @if test -f $@;        then if test -f SATISFIED; then \
337                 echo "Testing for Lisp shadows ..."; \
338                 ./${PROGNAME} -batch -vanilla -f list-load-path-shadows; fi; \
339                 $(RM) SATISFIED; exit 0; fi; \
340         if test -f SATISFIED; then $(RM) SATISFIED; exit 1; fi; \
341         $(RECURSIVE_MAKE) $@;
342
343 fastdump: temacs 
344         @$(RM) ${PROGNAME} && touch SATISFIED
345         -$(DUMPENV) ./temacs -batch -l ${srcdir}/../lisp/loadup.el dump
346         @if test -f ${PROGNAME};        then if test -f SATISFIED; then \
347                 ./${PROGNAME} -batch -vanilla -f list-load-path-shadows; fi; \
348                 $(RM) SATISFIED; exit 0; fi; \
349         if test -f SATISFIED; then $(RM) SATISFIED; exit 1; fi;
350
351 FRC.update-elc.stamp :
352
353 update-elc.stamp : temacs FRC.update-elc.stamp
354         @touch NOBYTECOMPILE
355         ${DUMPENV} ./temacs -batch -l ${srcdir}/../lisp/update-elc.el
356         @if test ! -f $@ -o -f NOBYTECOMPILE; then touch $@; fi; \
357          $(RM) NOBYTECOMPILE
358
359 obj_src = $(objs:.o=.c)
360
361 dortl : $(obj_rtl) $(otherrtls)
362         echo "(defvar source-files '(" > ${srcdir}/../lisp/source-files.el
363         (for a in $(obj_src) $(othersrcs);do \
364         echo -n "\""$$a"\"" >> ${srcdir}/../lisp/source-files.el ;\
365         done)
366         echo "))" >> ${srcdir}/../lisp/source-files.el
367
368 #ifdef DYNODUMP
369 dynodump_deps = ../dynodump/dynodump.so
370 ../dynodump/dynodump.so:
371         cd ../dynodump && $(RECURSIVE_MAKE)
372 #endif /* DYNODUMP */
373
374 ${libsrc}DOC: temacs update-elc.stamp
375         $(RM) ${libsrc}DOC; \
376         ${DUMPENV} ./temacs -batch -l ${srcdir}/../lisp/make-docfile.el -- \
377                 -o ${libsrc}DOC -d ${srcdir} -i ${libsrc}../site-packages \
378                 ${obj_src} ${mallocdocsrc} ${rallocdocsrc}
379
380 dump_elcs: dump-elcs
381
382 dump-elcs: temacs
383         -${DUMPENV} ./temacs -batch -l ${srcdir}/../lisp/update-elc.el
384
385 all-elc all-elcs:
386         cd .. && $(RECURSIVE_MAKE) all-elc
387
388 #ifdef I18N3
389
390 # if defined(SPARC) && !defined(USG)
391    xgettext=             /usr/openwin/bin/xgettext
392    xgettext_args=        -o emacs -m_X messages
393    msgfmt=               /usr/openwin/bin/msgfmt
394 # else
395    xgettext=             xgettext
396    xgettext_args=        -s -d emacs -M_X messages
397    msgfmt=               msgfmt
398 #endif
399
400 ${mo_dir}emacs.po: ${libsrc}make-msgfile ${libsrc}make-po ${objs}
401         ${libsrc}make-msgfile -o ${libsrc}messages ${objs}
402         cd ${libsrc} && ${xgettext} ${xgettext_args}
403         $(RM) ${mo_dir}emacs.po
404         cd ${libsrc} && ${libsrc}make-po -a ${mo_dir}emacs.po DOC
405
406 ${mo_dir}emacs.mo: ${mo_dir}emacs.po
407         cd ${mo_dir} && ${msgfmt} -o emacs.mo emacs.po
408
409 ${libsrc}make-msgfile:
410         cd ${libsrc} && $(RECURSIVE_MAKE) make-msgfile
411
412 ${libsrc}make-po:
413         cd ${libsrc} && $(RECURSIVE_MAKE) make-po
414
415 #endif /* I18N3 */
416
417 ${libsrc}make-docfile:
418         cd ${libsrc} && $(RECURSIVE_MAKE) make-docfile
419
420 ## Lint Section
421 LINT.c=$(LINT) $(LINTFLAGS) $(LINTINCLUDES)
422 LINTFILES= $(objs:.o=.ln)
423 LINTINCLUDES = $(cppflags)
424 ## LINTFLAGS= -fd -m -p -s -u -v -x
425 LINTFLAGS= -fd -m -s -u -v -x
426 lint: $(LINTFILES)
427         $(LINT.c) $(LINTFILES)
428 ## end of Lint Section
429
430 temacs_deps=\
431  $(start_files) ${objs} ${otherobjs}\
432  $(lwlib_deps) $(dynodump_deps)
433
434 temacs_link_args=\
435  ${start_flags} ${ldflags}\
436  -o $@ ${start_files} ${objs} ${otherobjs} ${LIBES}
437
438 temacs: $(temacs_deps)
439         $(LD) $(temacs_link_args)
440
441 .PHONY : run-temacs
442
443 run-temacs: temacs
444         -$(DUMPENV) ./temacs -batch -l ${srcdir}/../lisp/loadup.el run-temacs
445
446 ## Debugging targets:
447 ##
448 ## RTC is Sun WorkShop's Run Time Checking
449 ##
450 ## Purify, Quantify, PureCoverage are software quality products from
451 ## Rational, formerly Pure Atria, formerly Pure Software.
452 ##
453 ## None of these products work with a dumped xemacs binary, because it
454 ## does unexpected things like free memory that has been malloc'ed in
455 ## a *different* process!!  So we need to run these on temacs.
456 ##
457
458 .PHONY : run-rtcmacs run-puremacs run-quantmacs
459
460 rtc_patch.o:
461         rtc_patch_area -o $@
462
463 rtcmacs: $(temacs_deps) rtc_patch.o
464         $(RM) temacs; $(RECURSIVE_MAKE) temacs RTC_patch_objs=rtc_patch.o
465         mv temacs rtcmacs
466
467 run-rtcmacs: rtcmacs
468         dbx -q -C -c \
469         'dbxenv rtc_error_log_file_name /dev/fd/1; \
470         dbxenv suppress_startup_message 5.0; \
471         ignore POLL; \
472         check -access; \
473         suppress rui; \
474         runargs -batch -l ${srcdir}/../lisp/loadup.el run-temacs -q; \
475         run' rtcmacs
476
477 ## Purify
478 PURIFY_PROG=purify
479 PURIFY_FLAGS=-chain-length=32 -ignore-signals=SIGPOLL -threads=yes \
480  -cache-dir=./purecache -always-use-cache-dir=yes -pointer-mask=0x0fffffff
481 puremacs: $(temacs_deps)
482         $(PURIFY_PROG) $(PURIFY_FLAGS) $(LD) $(temacs_link_args) -lpthread
483
484 run-puremacs: puremacs
485         -$(DUMPENV) ./puremacs -batch -l ${srcdir}/../lisp/loadup.el run-temacs
486
487 ## Quantify
488 #ifdef  QUANTIFY
489 quantify_prog  = quantify
490 quantify_flags = -windows=no -record-data=no
491 quantify_includes = -I/local/include
492 quantify_libs = /local/lib/quantify_stubs.a
493
494 quantmacs: $(temacs_deps)
495         $(quantify_prog) $(quantify_flags) $(LD) $(temacs_link_args)
496 #endif /* QUANTIFY */
497
498 PURECOV_PROG=purecov
499 covmacs: $(temacs_deps)
500         $(PURECOV_PROG) $(LD) $(temacs_link_args)
501
502
503 TopLevelEmacsShell.o : ${srcdir}/EmacsShell-sub.c config.h xintrinsicp.h EmacsShellP.h
504         $(CC) -c $(cflags) -DDEFINE_TOP_LEVEL_EMACS_SHELL ${srcdir}/EmacsShell-sub.c
505         mv EmacsShell-sub.o TopLevelEmacsShell.o
506
507 TopLevelEmacsShell.c.rtl : ${srcdir}/EmacsShell-sub.c config.h xintrinsicp.h EmacsShellP.h
508         $(CC) -dr -c $(cflags) -DDEFINE_TOP_LEVEL_EMACS_SHELL ${srcdir}/EmacsShell-sub.c
509         mv EmacsShell-sub.c.rtl TopLevelEmacsShell.c.rtl
510
511 TransientEmacsShell.o : ${srcdir}/EmacsShell-sub.c TopLevelEmacsShell.o config.h xintrinsicp.h EmacsShellP.h
512         $(CC) -c $(cflags) -DDEFINE_TRANSIENT_EMACS_SHELL ${srcdir}/EmacsShell-sub.c
513         mv EmacsShell-sub.o TransientEmacsShell.o
514
515 TransientEmacsShell.c.rtl : ${srcdir}/EmacsShell-sub.c TopLevelEmacsShell.o config.h xintrinsicp.h EmacsShellP.h
516         $(CC) -dr -c $(cflags) -DDEFINE_TRANSIENT_EMACS_SHELL ${srcdir}/EmacsShell-sub.c
517         mv EmacsShell-sub.c.rtl TransientEmacsShell.c.rtl
518
519 ## Position-independent code for shared library creation
520 #if USE_GCC
521 pic_arg = -fpic
522 #elif defined (IRIX)
523 pic_arg = -KPIC
524 # else
525 pic_arg = -K pic
526 #endif
527
528 #ifdef EXTERNAL_WIDGET
529
530 external_client_motif_objs_shared    = ExternalClient-Xm-shared.o extw-Xt-shared.o extw-Xlib-shared.o
531 external_client_xt_objs_shared       = ExternalClient-Xt-shared.o extw-Xt-shared.o extw-Xlib-shared.o
532 external_client_xlib_objs_shared     = ExternalClient-Xlib-shared.o extw-Xlib-shared.o
533 external_client_motif_objs_nonshared = ExternalClient-Xm-nonshared.o extw-Xt-nonshared.o extw-Xlib-nonshared.o
534 external_client_xt_objs_nonshared    = ExternalClient-Xt-nonshared.o extw-Xt-nonshared.o extw-Xlib-nonshared.o
535 external_client_xlib_objs_nonshared  = ExternalClient-Xlib-nonshared.o extw-Xlib-nonshared.o
536
537 ## Add dependencies so things work right with a parallel make
538 ExternalClient-Xm-shared.o: ${srcdir}/ExternalClient.c ExternalClient-Xt-shared.o ExternalClient-Xm-nonshared.o
539         $(CC) -c $(pic_arg) $(cflags) -DEXTW_USES_MOTIF ${srcdir}/ExternalClient.c
540         mv ExternalClient.o ExternalClient-Xm-shared.o
541
542 ExternalClient-Xt-shared.o: ${srcdir}/ExternalClient.c ExternalClient-Xt-nonshared.o
543         $(CC) -c $(pic_arg) $(cflags) ${srcdir}/ExternalClient.c
544         mv ExternalClient.o ExternalClient-Xt-shared.o
545
546 ExternalClient-Xlib-shared.o: ${srcdir}/ExternalClient-Xlib.c ExternalClient-Xlib-nonshared.o
547         $(CC) -c $(pic_arg) $(cflags) ${srcdir}/ExternalClient-Xlib.c
548         mv ExternalClient-Xlib.o ExternalClient-Xlib-shared.o
549
550 ExternalClient-Xm-nonshared.o: ${srcdir}/ExternalClient.c ExternalClient-Xt-nonshared.o
551         $(CC) -c $(cflags) -DEXTW_USES_MOTIF ${srcdir}/ExternalClient.c
552         mv ExternalClient.o ExternalClient-Xm-nonshared.o
553
554 ExternalClient-Xt-nonshared.o: ${srcdir}/ExternalClient.c
555         $(CC) -c $(cflags) ${srcdir}/ExternalClient.c
556         mv ExternalClient.o ExternalClient-Xt-nonshared.o
557
558 ExternalClient-Xlib-nonshared.o: ${srcdir}/ExternalClient-Xlib.c
559         $(CC) -c $(cflags) ${srcdir}/ExternalClient-Xlib.c
560         mv ExternalClient-Xlib.o ExternalClient-Xlib-nonshared.o
561
562 ## We compile the common files twice (once with PIC and once without)
563 ## because on some systems, compiling with PIC but not linking into
564 ## a shared library messes things up.
565
566 extw-Xt-shared.o: ${srcdir}/extw-Xt.c extw-Xt-nonshared.o
567         $(CC) -c $(pic_arg) $(cflags) ${srcdir}/extw-Xt.c
568         mv extw-Xt.o extw-Xt-shared.o
569
570 extw-Xlib-shared.o: ${srcdir}/extw-Xlib.c extw-Xlib-nonshared.o
571         $(CC) -c $(pic_arg) $(cflags) ${srcdir}/extw-Xlib.c
572         mv extw-Xlib.o extw-Xlib-shared.o
573
574 extw-Xt-nonshared.o: ${srcdir}/extw-Xt.c
575         $(CC) -c $(cflags) ${srcdir}/extw-Xt.c
576         mv extw-Xt.o extw-Xt-nonshared.o
577
578 extw-Xlib-nonshared.o: ${srcdir}/extw-Xlib.c
579         $(CC) -c $(cflags) ${srcdir}/extw-Xlib.c
580         mv extw-Xlib.o extw-Xlib-nonshared.o
581
582 libextcli_Xm.a: ${external_client_motif_objs_nonshared}
583         ar r libextcli_Xm.a ${external_client_motif_objs_nonshared}
584
585 libextcli_Xt.a: ${external_client_xt_objs_nonshared}
586         ar r libextcli_Xt.a ${external_client_xt_objs_nonshared}
587
588 libextcli_Xlib.a: ${external_client_xlib_objs_nonshared}
589         ar r libextcli_Xlib.a ${external_client_xlib_objs_nonshared}
590
591 #ifdef EXTW_LINK
592
593 libextcli_Xm.so.1: ${external_client_motif_objs_shared}
594         ${extw_link_beg} ${external_client_motif_objs_shared} ${extw_link_mid} libextcli_Xm.so.1 ${extw_link_end}
595
596 libextcli_Xt.so.1: ${external_client_xt_objs_shared}
597         ${extw_link_beg} ${external_client_xt_objs_shared} ${extw_link_mid} libextcli_Xt.so.1 ${extw_link_end}
598
599 libextcli_Xlib.so.1: ${external_client_xlib_objs_shared}
600         ${extw_link_beg} ${external_client_xlib_objs_shared} ${extw_link_mid} libextcli_Xlib.so.1 ${extw_link_end}
601
602 #endif /* EXTW_LINK */
603
604 #endif /* EXTERNAL_WIDGET */
605
606 config.h: ${srcdir}/config.h.in
607 puresize-adjust.h: ${srcdir}/puresize.h
608 Emacs.ad.h: ${srcdir}/${etcdir}Emacs.ad
609
610 config.h puresize-adjust.h sheap-adjust.h paths.h Emacs.ad.h :
611         @echo "The file $@ needs to be re-generated."
612         @echo "Please run a make in the top level directory."
613         @echo "Consult the file \`INSTALL' for instructions for building XEmacs."
614         @exit 1
615
616 ## Some machines have alloca built-in.
617 ## They should define HAVE_ALLOCA, or may just let alloca.s
618 ## be used but generate no code.
619 ## Some have it written in assembler in alloca.s.
620 ## Some use the C version in alloca.c (these define C_ALLOCA in config.h).
621
622
623 #ifdef C_ALLOCA
624 ## We could put something in alloca.c to #define free and malloc
625 ## whenever emacs was #defined, but that's not appropriate for all
626 ## users of alloca in Emacs.  Check out ../lib-src/getopt.c.  */
627
628 alloca.o : ${srcdir}/alloca.c
629         $(CC) -c -Dfree=xfree -Dmalloc=xmalloc $(cflags) ${srcdir}/alloca.c
630 #else
631 #ifndef HAVE_ALLOCA
632 alloca.o : ${srcdir}/alloca.s config.h
633 ## $(CPP) is cc -E, which may get confused by filenames
634 ## that do not end in .c.  So copy file to a safe name.  */
635 ##      cp ${srcdir}/alloca.s allocatem.c
636 ## Remove any ^L, blank lines, and preprocessor comments,
637 ## since some assemblers barf on them.  Use a different basename for the
638 ## output file, since some stupid compilers (Green Hill) use that
639 ## name for the intermediate assembler file.
640         $(CPP) $(cppflags) allocatem.c | \
641         sed -e 's/\f//' -e 's/^#.*//' | \
642         sed -n -e '/^..*$$/p' > allocax.s
643         @$(RM) alloca.o
644 ## Xenix, in particular, needs to run assembler via cc.
645         $(CC) -c allocax.s
646         mv allocax.o alloca.o
647         $(RM) allocax.s allocatem.c
648 #endif /* HAVE_ALLOCA */
649 #endif /* ! defined (C_ALLOCA) */
650
651 #ifdef EMACS_BTL
652 BTL_includes = -I$(BTL_dir)
653 BTL_compile = -DEMACS_BTL -D`lucid-arch` -I. $(BTL_includes) $(BTL_dir)/$(@:.o=.c)
654
655 cadillac-btl.o cadillac-btl-process.o cadillac-btl-emacs.o:
656         $(CC) $(CFLAGS) -c $(BTL_compile)
657 cadillac-btl-asm.o:
658         $(CC) $(CFLAGS) -c $(BTL_compile)
659 #endif /* EMACS_BTL */
660
661 #ifdef HAVE_NATIVE_SOUND
662 sunplay.o: ${srcdir}/sunplay.c
663         $(CC) -c  $(sound_cflags) $(cflags) ${srcdir}/sunplay.c
664 hpplay.o: ${srcdir}/hpplay.c
665         $(CC) -c -Demacs $(sound_cflags) $(cflags) ${srcdir}/hpplay.c
666 #endif /* HAVE_NATIVE_SOUND */
667
668 ## System-specific programs to be made.
669 ## ${other_files}, $(objects_system) and $(objects_machine)
670 ## select which of these should be compiled.  */
671
672 .PHONY: mostlyclean clean distclean realclean versionclean extraclean
673 mostlyclean:
674         $(RM) temacs puremacs quantmacs prefix-args *.o *.i  \
675           core temacs.exe puresize-adjust.h sheap-adjust.h
676 clean: mostlyclean versionclean
677         $(RM) libextcli* update-elc.stamp
678 ## This is used in making a distribution.
679 ## Do not use it on development directories!
680 distclean: clean
681         $(RM) config.h paths.h Emacs.ad.h \
682           Makefile Makefile.in TAGS ${PROGNAME}.*
683 realclean: distclean
684 versionclean:
685         $(RM) ${PROGNAME} ${PROGNAME}.exe ${libsrc}DOC
686 extraclean: realclean
687         $(RM) *~ \#* m/*~ m/\#* s/*~ s/\#*
688
689 .PHONY : lock unlock
690 SOURCES = *.[chm] *.pswm [sm]/* COPYING paths.h.in Makefile.in.in \
691         config.h.in README COPYING ChangeLog
692 unlock:
693         chmod u+w $(SOURCES)
694
695 relock:
696         chmod -w $(SOURCES)
697
698 ## Dependency processing using home-grown script, not makedepend
699 depend: FRC.depend
700         $(RM) ${srcdir}/depend depend.tmp
701         perl ${srcdir}/make-src-depend > depend.tmp
702         mv depend.tmp ${srcdir}/depend