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