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