428
|
1 ## Makefile for src subdirectory in XEmacs.
|
|
2 ## Copyright (C) 1985, 1987, 1988, 1993, 1994 Free Software Foundation, Inc.
|
|
3 ## Copyright (C) 1994, 1995 Board of Trustees, University of Illinois
|
|
4 ## Copyright (C) 1996, 1997 Sun Microsystems, Inc.
|
|
5 ## Copyright (C) 1998, 1999 J. Kean Johnston.
|
3062
|
6 ## Copyright (C) 2001, 2002, 2003, 2005 Ben Wing.
|
428
|
7
|
|
8 ## This file is part of XEmacs.
|
|
9
|
|
10 ## XEmacs is free software; you can redistribute it and/or modify it
|
|
11 ## under the terms of the GNU General Public License as published by the
|
|
12 ## Free Software Foundation; either version 2, or (at your option) any
|
|
13 ## later version.
|
|
14
|
|
15 ## XEmacs is distributed in the hope that it will be useful, but WITHOUT
|
|
16 ## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
17 ## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
18 ## for more details.
|
|
19
|
|
20 ## You should have received a copy of the GNU General Public License
|
|
21 ## along with XEmacs; see the file COPYING. If not, write to
|
|
22 ## the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
23 ## Boston, MA 02111-1307, USA.
|
|
24
|
|
25 ## Synched up with: Not synched with FSF.
|
|
26
|
1315
|
27 .PHONY: all
|
|
28 all: build-the-mofo
|
|
29
|
442
|
30 #define NOT_C_CODE
|
|
31 #include "config.h"
|
|
32
|
1330
|
33 ## Here are the things that we expect ../configure to edit.
|
428
|
34
|
|
35 #ifdef USE_GNU_MAKE
|
2427
|
36 RECURSIVE_MAKE_ARGS=
|
428
|
37 #else
|
|
38 @SET_MAKE@
|
2427
|
39 RECURSIVE_MAKE_ARGS=@RECURSIVE_MAKE_ARGS@
|
428
|
40 #endif
|
|
41
|
1330
|
42 PROGNAME=@PROGNAME@
|
428
|
43 prefix=@prefix@
|
1330
|
44 SRC=@srcdir@
|
428
|
45 blddir=@blddir@
|
|
46 version=@version@
|
|
47 CC=@XEMACS_CC@
|
|
48 CPP=@CPP@
|
1889
|
49 CFLAGS=@XE_CFLAGS@
|
428
|
50 CPPFLAGS=@CPPFLAGS@
|
|
51 LDFLAGS=@LDFLAGS@
|
|
52
|
|
53 c_switch_all=@c_switch_all@
|
|
54 ld_switch_all=@ld_switch_all@
|
|
55 ld_libs_all=@ld_libs_all@
|
|
56 ld_dynamic_link_flags=@ld_dynamic_link_flags@
|
|
57
|
|
58 extra_objs=@extra_objs@
|
|
59 LN_S=@LN_S@
|
|
60
|
|
61 ld_switch_shared=@ld_switch_shared@
|
|
62 start_files=@start_files@
|
|
63 start_flags=@start_flags@
|
|
64 LD=@ld@
|
|
65 lib_gcc=@lib_gcc@
|
|
66 ##libmcheck=@libmcheck@
|
|
67
|
|
68
|
|
69 ## With the traditional VPATH setting, it is not possible to
|
|
70 ## simultaneously compile in-place and in another directory. The
|
|
71 ## mistaken definition is that *all* dependencies are searched for in
|
|
72 ## the VPATH directory, rather than just the dependencies that are not
|
|
73 ## themselves targets. Thus, if there is an up-to-date .o file in the
|
|
74 ## in-place location, it will not get recompiled in the not-in-place
|
|
75 ## location.
|
|
76
|
|
77 ## The GNU Make "vpath" directive continues this tradition, but at
|
|
78 ## least lets you restrict the classes of files that it applies to.
|
|
79 ## This allows us to kludge around the problem.
|
|
80
|
|
81 #ifdef USE_GNU_MAKE
|
|
82 vpath %.c @srcdir@
|
|
83 vpath %.h @srcdir@
|
|
84 ## now list files that should NOT be searched in the srcdir.
|
|
85 ## This includes any .c or .h built from something else
|
|
86 ## (e.g. a .in file).
|
|
87 vpath config.h
|
|
88 vpath paths.h
|
|
89 vpath Emacs.ad.h
|
|
90 vpath sheap-adjust.h
|
442
|
91 vpath dump-id.c
|
428
|
92 #else
|
|
93 VPATH=@srcdir@
|
|
94 #endif
|
|
95
|
1330
|
96 SHELL=/bin/sh
|
428
|
97 RM = rm -f
|
|
98
|
1330
|
99 LISP = $(SRC)/../lisp
|
|
100 ETC = $(SRC)/../etc
|
|
101 SRCMODULES = $(SRC)/../modules
|
|
102 LIB_SRC = ../lib-src
|
|
103 BLDSRC = .
|
|
104 BLDMODULES = ../modules
|
|
105 LWLIB_SRCDIR = $(SRC)/../lwlib
|
428
|
106
|
771
|
107 #########################################################################
|
1330
|
108 ## Definitions of object files and other dependencies ##
|
|
109 #########################################################################
|
771
|
110
|
1315
|
111 ## NOTE: Some of the object files are specified in this file, and others in
|
|
112 ## configure.in. The general rule is that they be specified here whenever
|
|
113 ## possible -- in practice, that means that they have clear dependencies on
|
|
114 ## configure defines. They should be in configure.in when there is no
|
|
115 ## configure define or when there is extremely hairy code to determine
|
|
116 ## which files are needed (e.g. native sound support) and it would be
|
|
117 ## pointless to duplicate that code.
|
771
|
118
|
793
|
119 gui_objs= gui.o
|
771
|
120 #ifdef HAVE_MENUBARS
|
|
121 gui_objs += menubar.o
|
|
122 #endif
|
|
123 #ifdef HAVE_SCROLLBARS
|
|
124 gui_objs += scrollbar.o
|
|
125 #endif
|
|
126 #ifdef HAVE_DIALOGS
|
|
127 gui_objs += dialog.o
|
|
128 #endif
|
|
129 #ifdef HAVE_TOOLBARS
|
|
130 gui_objs += toolbar.o
|
|
131 #endif
|
|
132
|
|
133 #ifdef HAVE_X_WINDOWS
|
|
134 x_objs=console-x.o device-x.o event-Xt.o frame-x.o \
|
|
135 glyphs-x.o objects-x.o redisplay-x.o select-x.o xgccache.o intl-x.o
|
|
136 x_gui_objs=$(gui_objs:.o=-x.o)
|
|
137 #ifdef HAVE_TOOLBARS
|
|
138 x_gui_objs += toolbar-common.o
|
|
139 #endif
|
|
140 #endif
|
|
141
|
|
142 #ifdef HAVE_MS_WINDOWS
|
|
143 mswindows_objs=console-msw.o device-msw.o event-msw.o frame-msw.o \
|
|
144 objects-msw.o select-msw.o redisplay-msw.o glyphs-msw.o
|
|
145 mswindows_gui_objs=$(gui_objs:.o=-msw.o)
|
|
146 #endif
|
|
147
|
|
148 #ifdef HAVE_TTY
|
|
149 tty_objs=console-tty.o device-tty.o event-tty.o frame-tty.o objects-tty.o \
|
|
150 redisplay-tty.o cm.o
|
|
151 #endif
|
|
152
|
|
153 #ifdef HAVE_GTK
|
|
154 gtk_objs=console-gtk.o device-gtk.o event-gtk.o frame-gtk.o \
|
|
155 objects-gtk.o redisplay-gtk.o glyphs-gtk.o select-gtk.o gccache-gtk.o \
|
|
156 gtk-xemacs.o ui-gtk.o
|
|
157 gtk_gui_objs=$(gui_objs:.o=-gtk.o)
|
|
158 #ifdef HAVE_TOOLBARS
|
|
159 gtk_gui_objs += toolbar-common.o
|
|
160 #endif
|
|
161 #endif
|
|
162
|
|
163 #ifdef HAVE_BALLOON_HELP
|
|
164 balloon_help_objs=balloon_help.o balloon-x.o
|
|
165 #endif
|
|
166
|
|
167 #ifdef CLASH_DETECTION
|
|
168 clash_detection_objs=filelock.o
|
|
169 #endif
|
|
170
|
|
171 #ifdef HAVE_DATABASE
|
|
172 database_objs=database.o
|
|
173 #endif
|
|
174
|
|
175 #ifdef DEBUG_XEMACS
|
|
176 debug_objs=debug.o tests.o
|
|
177 #endif
|
|
178
|
|
179 #ifdef HAVE_UNIXOID_EVENT_LOOP
|
|
180 event_unixoid_objs=event-unixoid.o
|
|
181 #endif
|
|
182
|
|
183 #ifdef HAVE_GIF
|
|
184 gif_objs=dgif_lib.o gif_io.o
|
|
185 #endif
|
|
186
|
|
187 #ifdef HAVE_GPM
|
|
188 gpm_objs=gpmevent.o
|
|
189 #endif
|
|
190
|
996
|
191 #if defined(HAVE_LDAP) && !defined(HAVE_SHLIB)
|
1330
|
192 ldap_objs=$(BLDMODULES)/ldap/eldap.o
|
771
|
193 #endif
|
|
194
|
|
195 #ifdef MULE
|
|
196 mule_objs=mule-ccl.o mule-charset.o mule-coding.o
|
|
197 #endif
|
|
198
|
2973
|
199 #if defined(HAVE_CANNA) && !defined(HAVE_SHLIB)
|
3010
|
200 mule_canna_objs=$(BLDMODULES)/canna/canna_api.o
|
771
|
201 #endif
|
|
202
|
|
203 #ifdef HAVE_WNN
|
|
204 mule_wnn_objs=mule-wnnfns.o
|
|
205 #endif
|
|
206
|
1983
|
207 #ifdef WITH_GMP
|
|
208 number_objs=number-gmp.o number.o
|
|
209 #endif
|
|
210 #ifdef WITH_MP
|
|
211 number_objs=number-mp.o number.o
|
|
212 #endif
|
|
213
|
996
|
214 #if defined(HAVE_POSTGRESQL) && !defined(HAVE_SHLIB)
|
1330
|
215 postgresql_objs=$(BLDMODULES)/postgresql/postgresql.o
|
771
|
216 #endif
|
|
217
|
|
218 #ifdef HAVE_WIN32_PROCESSES
|
|
219 process_objs=process-nt.o
|
|
220 #elif defined (HAVE_UNIX_PROCESSES)
|
|
221 process_objs=process-unix.o
|
|
222 #endif
|
|
223
|
|
224 #ifdef HAVE_SETITIMER
|
|
225 profile_objs=profile.o
|
|
226 #endif
|
|
227
|
442
|
228 #if defined (HEAP_IN_DATA) && !defined (PDUMP)
|
|
229 sheap_objs=sheap.o
|
|
230 #endif
|
|
231
|
771
|
232 #ifdef HAVE_SHLIB
|
1750
|
233 shlib_objs=sysdll.o
|
1632
|
234 # ifdef HAVE_MS_WINDOWS
|
|
235 export_lib=xemacs-export.o
|
|
236 xemacs-export.o: xemacs.def
|
|
237 dlltool -D xemacs-${version}.exe -d $< -l xemacs-import.a -e $@
|
|
238 # endif
|
771
|
239 #endif
|
|
240
|
|
241 #ifdef SUNPRO
|
|
242 sunpro_objs=sunpro.o
|
428
|
243 #endif
|
|
244
|
771
|
245 #ifdef TOOLTALK
|
|
246 tooltalk_objs=tooltalk.o
|
|
247 #endif
|
|
248
|
|
249 #if defined (WIN32_NATIVE) || defined (CYGWIN)
|
|
250 win32_objs=win32.o intl-win32.o intl-auto-encap-win32.o intl-encap-win32.o \
|
|
251 xemacs_res.o
|
611
|
252 #endif
|
|
253
|
2720
|
254 #ifdef MC_ALLOC
|
|
255 mc_alloc_objs=mc-alloc.o
|
|
256 #endif
|
|
257
|
3092
|
258 #ifdef NEW_GC
|
|
259 new_gc_objs=vdb.o
|
|
260 # if defined (WIN32_ANY) || defined (VDB_WIN32)
|
|
261 vdb_objs=vdb-win32.o
|
|
262 # elif defined (VDB_MACH)
|
|
263 vdb_objs=vdb-mach.o
|
|
264 # elif defined (VDB_POSIX)
|
|
265 vdb_objs=vdb-posix.o
|
|
266 # else /* VDB_FAKE */
|
|
267 vdb_objs=vdb-fake.o
|
|
268 # endif
|
|
269 #endif /* NEW_GC */
|
|
270
|
428
|
271 ## lastfile must follow all files whose initialized data areas should
|
|
272 ## be dumped as pure by dump-emacs.
|
|
273
|
|
274 ## NOTE: The last line cannot be all macros, because make will barf
|
|
275 ## if they all come out null.
|
|
276
|
|
277 objs=\
|
851
|
278 abbrev.o alloc.o alloca.o \
|
|
279 $(balloon_help_objs) blocktype.o buffer.o bytecode.o \
|
853
|
280 callint.o casefiddle.o casetab.o chartab.o \
|
851
|
281 $(clash_detection_objs) cmdloop.o cmds.o $(coding_system_objs) console.o \
|
|
282 console-stream.o\
|
771
|
283 data.o $(database_objs) $(debug_objs) device.o dired.o doc.o doprnt.o\
|
851
|
284 dynarr.o \
|
1750
|
285 editfns.o elhash.o emacs.o emodules.o eval.o events.o\
|
771
|
286 event-stream.o $(event_unixoid_objs) $(extra_objs) extents.o\
|
|
287 faces.o file-coding.o fileio.o $(LOCK_OBJ) filemode.o floatfns.o fns.o \
|
|
288 font-lock.o frame.o\
|
3092
|
289 gc.o general.o $(gif_objs) glyphs.o glyphs-eimage.o glyphs-shared.o\
|
793
|
290 glyphs-widget.o $(gpm_objs) $(gtk_objs) $(gtk_gui_objs) $(gui_objs) \
|
|
291 gutter.o\
|
771
|
292 hash.o imgproc.o indent.o insdel.o intl.o\
|
|
293 keymap.o $(RTC_patch_objs) line-number.o $(ldap_objs) lread.o lstream.o\
|
3092
|
294 $(mc_alloc_objs) $(new_gc_objs) $(vdb_objs) \
|
771
|
295 macros.o marker.o md5.o minibuf.o $(mswindows_objs) $(mswindows_gui_objs)\
|
1983
|
296 $(mule_objs) $(mule_canna_objs) $(mule_wnn_objs) $(number_objs) objects.o\
|
|
297 opaque.o $(postgresql_objs) print.o process.o $(process_objs) $(profile_objs)\
|
771
|
298 rangetab.o realpath.o redisplay.o redisplay-output.o regex.o\
|
|
299 search.o select.o $(sheap_objs) $(shlib_objs) signal.o sound.o\
|
|
300 specifier.o strftime.o $(sunpro_objs) symbols.o syntax.o sysdep.o\
|
|
301 text.o $(tooltalk_objs) $(tty_objs) undo.o unicode.o $(x_objs) $(x_gui_objs)\
|
|
302 widget.o window.o $(win32_objs)
|
428
|
303
|
|
304 obj_rtl = $(objs:.o=.c.rtl)
|
|
305
|
|
306 #ifdef REL_ALLOC
|
|
307 rallocdocsrc = ralloc.c
|
|
308 rallocobjs = ralloc.o
|
|
309 #endif
|
|
310
|
|
311 malloclib = $(libmcheck)
|
|
312 #ifndef SYSTEM_MALLOC
|
|
313 # ifdef GNU_MALLOC /* GNU malloc */
|
|
314 # ifdef ERROR_CHECK_MALLOC
|
|
315 #ifdef DOUG_LEA_MALLOC
|
|
316 mallocobjs = free-hook.o vm-limit.o
|
|
317 #else
|
|
318 mallocobjs = gmalloc.o free-hook.o vm-limit.o
|
|
319 #endif
|
|
320 mallocdocsrc = free-hook.c
|
|
321 # else /* New GNU malloc, sans error checking */
|
|
322 #ifdef DOUG_LEA_MALLOC
|
|
323 mallocobjs = vm-limit.o
|
|
324 #else
|
|
325 mallocobjs = gmalloc.o vm-limit.o
|
|
326 #endif
|
|
327 mallocdocsrc =
|
|
328 # endif /* ERROR_CHECK_MALLOC */
|
|
329 # else /* Older GNU malloc */
|
|
330 mallocobjs = malloc.o
|
|
331 mallocdocsrc =
|
|
332 # endif /* Older GNU malloc */
|
|
333 #else /* SYSTEM_MALLOC */
|
|
334 mallocobjs =
|
|
335 mallocdocsrc =
|
|
336 #ifdef USE_DEBUG_MALLOC
|
|
337 malloclib = -ldmalloc
|
|
338 #endif /* USE_DEBUG_MALLOC */
|
|
339 #endif /* SYSTEM_MALLOC */
|
|
340
|
|
341 #ifdef HAVE_X_WINDOWS
|
|
342
|
1330
|
343 lwlib_lib = ../lwlib/liblw.a
|
|
344
|
428
|
345 # ifdef EXTERNAL_WIDGET
|
|
346 external_widget_objs = ExternalShell.o extw-Xt-nonshared.o extw-Xlib-nonshared.o
|
|
347
|
|
348 # ifdef LWLIB_USES_MOTIF
|
|
349 # ifdef EXTW_LINK
|
|
350 motif_other_files = libextcli_Xm.a libextcli_Xm.so.1
|
|
351 # else
|
|
352 motif_other_files = libextcli_Xm.a
|
|
353 # endif
|
|
354 #endif /* LWLIB_USES_MOTIF */
|
|
355
|
|
356 # ifdef EXTW_LINK
|
|
357 shared_other_files = libextcli_Xt.so.1 libextcli_Xlib.so.1
|
|
358 # endif
|
|
359 other_files=\
|
1330
|
360 $(motif_other_files)\
|
428
|
361 libextcli_Xt.a libextcli_Xlib.a\
|
1330
|
362 $(shared_other_files)
|
428
|
363
|
|
364 # endif /* EXTERNAL_WIDGET */
|
|
365
|
|
366 # if defined (HAVE_OFFIX_DND) || defined (HAVE_CDE)
|
|
367 dnd_objs = @dnd_objs@
|
|
368 # endif /* HAVE_OFFIX_DND || HAVE_CDE */
|
|
369
|
|
370 X11_objs = EmacsFrame.o EmacsShell.o TopLevelEmacsShell.o TransientEmacsShell.o EmacsManager.o $(external_widget_objs) $(dnd_objs)
|
|
371 #endif /* HAVE_X_WINDOWS */
|
|
372
|
|
373 ## define otherobjs as list of object files that make-docfile
|
|
374 ## should not be told about.
|
1632
|
375 otherobjs = lastfile.o $(mallocobjs) $(rallocobjs) $(X11_objs) $(export_lib)
|
428
|
376 otherrtls = $(otherobjs:.o=.c.rtl)
|
|
377 othersrcs = $(otherobjs:.o=.c)
|
|
378
|
1330
|
379 LIBES = $(lwlib_lib) $(malloclib) $(ld_libs_all) $(lib_gcc)
|
428
|
380
|
|
381 #ifdef I18N3
|
1330
|
382 mo_file = $(LIB_SRC)/emacs.mo
|
428
|
383 #endif
|
|
384
|
1315
|
385 #########################################################################
|
1330
|
386 ## Implicit rules ##
|
|
387 #########################################################################
|
1315
|
388
|
1330
|
389 ## For performance and consistency, no built-in rules.
|
|
390 .SUFFIXES:
|
|
391 .SUFFIXES: .c .h .o .i .s .dep
|
|
392
|
|
393 ## -Demacs is needed to make some files produce the correct version
|
|
394 ## for use in Emacs.
|
|
395
|
2958
|
396 cppflags = $(CPPFLAGS) -Demacs -I. -I$(SRC) $(c_switch_all)
|
1330
|
397 cflags = $(CFLAGS) $(cppflags)
|
2502
|
398 #if defined (WIN32_NATIVE)
|
1330
|
399 ldflags = $(LDFLAGS) -mwindows -e _mainCRTStartup $(ld_switch_all) $(ld_dynamic_link_flags)
|
|
400 #else
|
|
401 ldflags = $(LDFLAGS) $(ld_switch_all) $(ld_dynamic_link_flags)
|
|
402 #endif
|
|
403
|
2502
|
404 #if defined (CYGWIN) && !defined (PDUMP)
|
|
405 ldflags += -Wl,--script=s/cygwin.sc
|
|
406 #endif
|
|
407
|
1330
|
408 #ifdef SOLARIS2
|
|
409 %.o : %.c
|
|
410 #else
|
|
411 .c.o:
|
|
412 #endif
|
|
413 $(CC) -c $(cflags) $<
|
1315
|
414
|
1330
|
415 ## Create preprocessor output (debugging purposes only)
|
|
416 .c.i:
|
|
417 #ifdef __GNUC__
|
|
418 $(CC) -E $(cppflags) -o $@ $<
|
|
419 #else /* works on Solaris; what about other systems? */
|
|
420 $(CC) -P $(cppflags) $<
|
|
421 #endif /* compiler */
|
|
422
|
|
423 ## Create assembler output (debugging purposes only)
|
|
424 .c.s:
|
|
425 $(CC) -S -c $(cflags) $<
|
|
426
|
|
427 ## Create RTL files
|
|
428 %.c.rtl : %.c
|
|
429 $(CC) -dr -c $(cflags) $<
|
|
430
|
|
431 #########################################################################
|
|
432 ## Primary rebuilding process ##
|
|
433 #########################################################################
|
|
434
|
|
435 #ifdef PDUMP
|
|
436 DUMP_TARGET = $(PROGNAME).dmp
|
|
437 RAW_EXE = $(PROGNAME)
|
|
438 DUMP_ID = dump-id.o
|
2720
|
439 #if !defined(WIN32_NATIVE) && defined(DUMP_IN_EXEC)
|
2015
|
440 DUMP_TARGET = $(PROGNAME)
|
2388
|
441 #ifndef CYGWIN
|
2015
|
442 RAW_EXE = temacs
|
2388
|
443 #else
|
|
444 RAW_EXE = temacs.exe
|
|
445 #endif
|
2015
|
446 #endif
|
1330
|
447 #else
|
|
448 DUMP_TARGET = $(PROGNAME)
|
|
449 RAW_EXE = temacs
|
|
450 #endif
|
|
451
|
|
452 DO_TEMACS = $(DUMPENV) ./$(RAW_EXE)
|
|
453 DO_XEMACS = ./$(PROGNAME)
|
1315
|
454
|
|
455 BATCH = -no-packages -batch
|
|
456 BATCH_PACKAGES = -vanilla -batch
|
|
457 TEMACS_BATCH = $(DO_TEMACS) -nd $(BATCH)
|
|
458 XEMACS_BATCH = $(DO_XEMACS) $(BATCH)
|
|
459 XEMACS_BATCH_PACKAGES = $(DO_XEMACS) $(BATCH_PACKAGES)
|
|
460 temacs_loadup_args = -l $(LISP)/loadup.el
|
|
461 dump_temacs_args = $(temacs_loadup_args) dump
|
|
462 run_temacs_args = $(temacs_loadup_args) run-temacs
|
|
463 dump_temacs = $(TEMACS_BATCH) $(dump_temacs_args)
|
|
464
|
|
465 ## Compile, dump, and make sure all .elc files are up-to-date.
|
|
466
|
1330
|
467 ## NOTE NOTE NOTE: There appears to be a fundamental but non-obvious
|
|
468 ## difference between the way that standard `make', GNU Make, and `nmake'
|
|
469 ## handle dependencies, and this means we have to write the dependencies in
|
|
470 ## Makefile.in.in and xemacs.mak differently. To illustrate this, consider
|
|
471 ## the following first:
|
|
472
|
|
473 ##.PHONY: all (`make' only)
|
|
474 ## all: test.exe
|
|
475 ##
|
|
476 ##.PHONY: FRC.test.c (`make' only)
|
|
477 ##FRC.test.c:
|
|
478 ##
|
|
479 ##test.c: FRC.test.c
|
|
480 ## if test ! -f foo ; then touch test.c; fi (`make' only)
|
|
481 ## if not exist foo touch test.c (`nmake' only)
|
|
482 ##
|
|
483 ##test.obj: test.c
|
|
484 ## touch test.obj
|
|
485 ##
|
|
486 ##test.exe: test.obj
|
|
487 ## touch test.exe
|
|
488
|
|
489 ## (GNU Make doesn't need the .PHONY declarations, but evidently some versions
|
|
490 ## of `make' do. nmake doesn't need them and doesn't allow them, either.)
|
|
491
|
|
492 ## Running `make' rebuilds test.exe only if `foo' doesn't exist.
|
|
493 ## Running `nmake -f Makefile' rebuilds it regardless.
|
|
494
|
|
495 ## Both conclude that test.c needs to be rebuilt since its dependent is
|
|
496 ## non-existent. But `make' recalculates its dependencies after running
|
|
497 ## the commands for test.c, and notices that test.c hasn't changed, and
|
|
498 ## thus test.obj and test.exe are up-to-date. `nmake' doesn't.
|
|
499
|
|
500 ## On the other hand, consider the following:
|
428
|
501
|
1330
|
502 ##.PHONY: all (`make' only)
|
|
503 ##all: check-foo test.exe
|
|
504 ##
|
|
505 ##.PHONY: check-foo (`make' only)
|
|
506 ##check-foo:
|
|
507 ## if test ! -f foo; then touch test.c; fi (`make' only)
|
|
508 ## if not exist foo touch test.c (`nmake' only)
|
|
509 ##
|
|
510 ##test.c:
|
|
511 ## touch test.c
|
|
512 ##
|
|
513 ##test.obj: test.c
|
|
514 ## touch test.obj
|
|
515 ##
|
|
516 ##test.exe: test.c test.obj
|
|
517 ## touch test.exe
|
|
518 ##
|
1315
|
519
|
1330
|
520 ## Running `nmake -f Makefile' (and `GNU make') rebuilds test.exe only if
|
|
521 ## `foo' doesn't exist.
|
|
522 ## Running some versions of non-GNU `make' does nothing at all once test.c,
|
|
523 ## test.obj and test.exe all exist.
|
|
524
|
|
525 ## It appears that `nmake' doesn't check dependencies for test.exe until it
|
|
526 ## actually needs to be rebuilt, so this "sideways" dependency script
|
|
527 ## works. GNU make evidently recalculates *all* dependencies after each
|
|
528 ## command so has no problem, either. But some makes apparently calculate
|
|
529 ## all dependencies at startup and then, after executing a command to build
|
|
530 ## a dependency, only recheck relationships involving that particular
|
|
531 ## dependency.
|
|
532
|
|
533 ## In XEmacs-land, the above situation exists wrt the `NEEDTODUMP'
|
|
534 ## dependency, recalculated by `update-elc.el'. Thus, Makefile.in.in must
|
|
535 ## use the method #1 above, and nmake must use method #2.
|
|
536
|
|
537 ## -ben
|
|
538
|
|
539 .PHONY: build-the-mofo
|
1346
|
540 build-the-mofo: update-elc-2 $(mo_file) $(other_files) $(LISP)/finder-inf.el load-shadows
|
1315
|
541
|
1346
|
542 ## (1) Compile all dependencies of the XEmacs executable
|
428
|
543
|
1330
|
544 #ifdef HAVE_X_WINDOWS
|
|
545 lwlib_deps = $(lwlib_lib)
|
|
546 $(lwlib_lib):
|
2427
|
547 cd ../lwlib && $(MAKE) $(RECURSIVE_MAKE_ARGS)
|
1330
|
548 #endif /* HAVE_X_WINDOWS */
|
|
549
|
428
|
550 #ifdef DYNODUMP
|
|
551 dynodump_deps = ../dynodump/dynodump.so
|
|
552 ../dynodump/dynodump.so:
|
2427
|
553 cd ../dynodump && $(MAKE) $(RECURSIVE_MAKE_ARGS)
|
428
|
554 #endif /* DYNODUMP */
|
|
555
|
1330
|
556 link_deps = $(start_files) $(objs) $(otherobjs) $(lwlib_deps) $(dynodump_deps)
|
1315
|
557
|
1346
|
558 $(LIB_SRC)/make-dump-id:
|
2427
|
559 cd $(LIB_SRC) && $(MAKE) $(RECURSIVE_MAKE_ARGS) make-dump-id
|
1346
|
560
|
|
561 dump-id.c: $(LIB_SRC)/make-dump-id $(link_deps)
|
|
562 $(LIB_SRC)/make-dump-id
|
|
563
|
|
564 ## (2) Link the XEmacs executable
|
|
565
|
2720
|
566 #if !defined(PDUMP) || !defined(DUMP_IN_EXEC) || defined(WIN32_NATIVE)
|
2015
|
567 $(RAW_EXE): $(link_deps) $(DUMP_ID)
|
|
568 $(LD) $(start_flags) $(ldflags) -o $@ $(start_files) $(objs) $(otherobjs) $(DUMP_ID) $(LIBES)
|
|
569 #else
|
|
570 $(RAW_EXE): $(link_deps) $(DUMP_ID)
|
|
571 if test -f dump-size ; then \
|
|
572 $(CC) -c $(cflags) -DMAX_SIZE=`cat dump-size` $(SRC)/dump-data.c ;\
|
|
573 else \
|
|
574 $(CC) -c $(cflags) -DMAX_SIZE=0 $(SRC)/dump-data.c ;\
|
|
575 fi
|
|
576 $(LD) $(start_flags) $(ldflags) -o $@ $(start_files) $(objs) $(otherobjs) $(DUMP_ID) dump-data.o $(LIBES)
|
|
577 #endif
|
1315
|
578
|
1346
|
579 ## (3) Update the .elc's needed for dumping
|
|
580
|
|
581 .PHONY: FRC.needtodump
|
|
582 FRC.needtodump:
|
|
583
|
|
584 ## This file is touched by update-elc.el when redumping is necessary.
|
|
585 ## We use $(BLDSRC) == `.' here to help keep sync with nt/xemacs.mak,
|
|
586 ## where $(BLDSRC) is not `.'.
|
1406
|
587 $(BLDSRC)/NEEDTODUMP: $(RAW_EXE) FRC.needtodump
|
1346
|
588 $(TEMACS_BATCH) -l $(LISP)/update-elc.el
|
|
589
|
|
590 ## (4) Build the DOC file
|
1315
|
591
|
|
592 obj_src = $(objs:.o=.c)
|
|
593
|
1346
|
594 $(LIB_SRC)/make-docfile:
|
2427
|
595 cd $(LIB_SRC) && $(MAKE) $(RECURSIVE_MAKE_ARGS) make-docfile
|
1346
|
596
|
1330
|
597 $(LIB_SRC)/DOC: $(LIB_SRC)/make-docfile $(BLDSRC)/NEEDTODUMP $(temacs_deps)
|
1303
|
598 #ifdef QUICK_BUILD
|
|
599 if test ! -f $@ ; then \
|
|
600 #else
|
|
601 if true ; then \
|
|
602 #endif
|
1315
|
603 $(TEMACS_BATCH) -l $(LISP)/make-docfile.el -- \
|
1330
|
604 -o $(LIB_SRC)/DOC -d $(SRC) -i $(LIB_SRC)/../site-packages \
|
|
605 $(obj_src) $(mallocdocsrc) $(rallocdocsrc) \
|
|
606 $(extra_doc_files) ; fi
|
428
|
607
|
1346
|
608 ## (5) Dump
|
|
609
|
|
610 $(DUMP_TARGET): $(RAW_EXE) $(BLDSRC)/NEEDTODUMP $(LIB_SRC)/DOC
|
|
611 #ifdef HEAP_IN_DATA
|
|
612 @$(RM) $@ && touch SATISFIED
|
|
613 $(dump_temacs)
|
|
614 @if test -f SATISFIED; then $(RM) SATISFIED; else $(RM) $@; \
|
2427
|
615 $(MAKE) $(RECURSIVE_MAKE_ARGS) $@; fi
|
1346
|
616 #else
|
|
617 @$(RM) $@
|
|
618 $(dump_temacs)
|
|
619 #endif
|
2720
|
620 #if defined(PDUMP) && defined(DUMP_IN_EXEC) && !defined(WIN32_NATIVE)
|
2015
|
621 if test -f dump-size; then \
|
|
622 $(LIB_SRC)/insert-data-in-exec $(RAW_EXE) $(DUMP_TARGET).dmp $(DUMP_TARGET) `$(DO_TEMACS) -si`; \
|
|
623 ret=$$? ; \
|
|
624 if test $${ret} -eq 2; then \
|
|
625 $(RM) dump-size ; \
|
|
626 else \
|
|
627 if test $${ret} -eq 1; then \
|
|
628 exit 1; \
|
|
629 else \
|
|
630 chmod +x $(DUMP_TARGET) ; \
|
|
631 fi ; \
|
|
632 fi ; \
|
|
633 fi
|
2644
|
634 if test ! -f dump-size; then \
|
2015
|
635 $(LIB_SRC)/insert-data-in-exec -s $(DUMP_TARGET).dmp > dump-size ; \
|
|
636 $(RM) dump-data.o $(DUMP_TARGET) $(DUMP_TARGET).dmp $(RAW_EXE);\
|
2427
|
637 $(MAKE) $(RECURSIVE_MAKE_ARGS) $@; \
|
2015
|
638 fi
|
|
639 #endif
|
1346
|
640
|
|
641 ## (6) Update the remaining .elc's, post-dumping
|
|
642
|
|
643 .PHONY: update-elc-2
|
|
644 update-elc-2: $(DUMP_TARGET)
|
|
645 $(XEMACS_BATCH) -no-autoloads -l update-elc-2.el -f batch-update-elc-2 $(LISP)
|
|
646
|
|
647 ## (7) Other random stuff
|
1315
|
648
|
1346
|
649 $(LISP)/finder-inf.el: update-elc-2
|
|
650 @echo "Building finder database ..."
|
2027
|
651 $(RM) $(LISP)/finder-inf.el
|
1346
|
652 $(XEMACS_BATCH) -eval "(setq finder-compile-keywords-quiet t)" \
|
|
653 -l finder -f finder-compile-keywords
|
|
654 @echo "Building finder database ...(done)"
|
|
655
|
|
656 .PHONY: load-shadows
|
|
657 load-shadows: update-elc-2
|
|
658 #ifndef QUICK_BUILD
|
|
659 @echo "Testing for Lisp shadows ..."
|
|
660 @$(XEMACS_BATCH) -f list-load-path-shadows
|
|
661 #endif
|
|
662
|
|
663 ###################### Misc targets
|
|
664
|
|
665 release: all
|
|
666 -if [ -w $(LISP) ]; then \
|
|
667 w=`pwd`; cd $(SRC) && $$w/$(RAW_EXE) -nd $(BATCH) -l $(LISP)/inc-vers; \
|
|
668 else true; fi
|
|
669 -$(dump_temacs)
|
|
670 touch release
|
428
|
671
|
1315
|
672 .PHONY: fastdump
|
1330
|
673 fastdump: $(RAW_EXE)
|
|
674 @$(RM) $(DUMP_TARGET) && touch SATISFIED
|
|
675 -$(dump_temacs)
|
1315
|
676 @$(XEMACS_BATCH) -f list-load-path-shadows
|
428
|
677
|
1315
|
678 .PHONY: all-elc
|
|
679 all-elc:
|
2427
|
680 cd .. && $(MAKE) $(RECURSIVE_MAKE_ARGS)
|
1315
|
681
|
|
682 #########################################################################
|
1330
|
683 ## Subsidiary dependency rules ##
|
|
684 #########################################################################
|
428
|
685
|
|
686 #ifdef I18N3
|
|
687
|
|
688 # if defined(SPARC) && !defined(USG)
|
|
689 xgettext= /usr/openwin/bin/xgettext
|
|
690 xgettext_args= -o emacs -m_X messages
|
|
691 msgfmt= /usr/openwin/bin/msgfmt
|
|
692 # else
|
|
693 xgettext= xgettext
|
|
694 xgettext_args= -s -d emacs -M_X messages
|
|
695 msgfmt= msgfmt
|
|
696 #endif
|
|
697
|
1330
|
698 $(LIB_SRC)/emacs.po: $(LIB_SRC)/make-msgfile $(LIB_SRC)/make-po $(objs)
|
|
699 $(LIB_SRC)/make-msgfile -o $(LIB_SRC)/messages $(objs)
|
|
700 cd $(LIB_SRC) && $(xgettext) $(xgettext_args)
|
|
701 $(RM) $(LIB_SRC)/emacs.po
|
|
702 cd $(LIB_SRC) && $(LIB_SRC)/make-po -a $(LIB_SRC)/emacs.po DOC
|
428
|
703
|
1330
|
704 $(LIB_SRC)/emacs.mo: $(LIB_SRC)/emacs.po
|
|
705 cd $(LIB_SRC)/ && $(msgfmt) -o emacs.mo emacs.po
|
428
|
706
|
1330
|
707 $(LIB_SRC)/make-msgfile:
|
2427
|
708 cd $(LIB_SRC) && $(MAKE) $(RECURSIVE_MAKE_ARGS) make-msgfile
|
428
|
709
|
1330
|
710 $(LIB_SRC)/make-po:
|
2427
|
711 cd $(LIB_SRC) && $(MAKE) $(RECURSIVE_MAKE_ARGS) make-po
|
428
|
712
|
|
713 #endif /* I18N3 */
|
|
714
|
1330
|
715 TopLevelEmacsShell.o : $(SRC)/EmacsShell-sub.c config.h xintrinsicp.h EmacsShellP.h
|
|
716 $(CC) -c $(cflags) -DDEFINE_TOP_LEVEL_EMACS_SHELL $(SRC)/EmacsShell-sub.c
|
428
|
717 mv EmacsShell-sub.o TopLevelEmacsShell.o
|
|
718
|
1330
|
719 TopLevelEmacsShell.c.rtl : $(SRC)/EmacsShell-sub.c config.h xintrinsicp.h EmacsShellP.h
|
|
720 $(CC) -dr -c $(cflags) -DDEFINE_TOP_LEVEL_EMACS_SHELL $(SRC)/EmacsShell-sub.c
|
428
|
721 mv EmacsShell-sub.c.rtl TopLevelEmacsShell.c.rtl
|
|
722
|
1330
|
723 TransientEmacsShell.o : $(SRC)/EmacsShell-sub.c TopLevelEmacsShell.o config.h xintrinsicp.h EmacsShellP.h
|
|
724 $(CC) -c $(cflags) -DDEFINE_TRANSIENT_EMACS_SHELL $(SRC)/EmacsShell-sub.c
|
428
|
725 mv EmacsShell-sub.o TransientEmacsShell.o
|
|
726
|
1330
|
727 TransientEmacsShell.c.rtl : $(SRC)/EmacsShell-sub.c TopLevelEmacsShell.o config.h xintrinsicp.h EmacsShellP.h
|
|
728 $(CC) -dr -c $(cflags) -DDEFINE_TRANSIENT_EMACS_SHELL $(SRC)/EmacsShell-sub.c
|
428
|
729 mv EmacsShell-sub.c.rtl TransientEmacsShell.c.rtl
|
|
730
|
442
|
731 ## The above rules are subject to a race condition if using a parallel make.
|
|
732 TransientEmacsShell.o : TopLevelEmacsShell.o
|
|
733 TransientEmacsShell.c.rtl : TopLevelEmacsShell.c.rtl
|
|
734
|
428
|
735 ## Position-independent code for shared library creation
|
|
736 #if USE_GCC
|
|
737 pic_arg = -fpic
|
|
738 #elif defined (IRIX)
|
|
739 pic_arg = -KPIC
|
|
740 # else
|
|
741 pic_arg = -K pic
|
|
742 #endif
|
|
743
|
|
744 #ifdef EXTERNAL_WIDGET
|
|
745
|
|
746 external_client_motif_objs_shared = ExternalClient-Xm-shared.o extw-Xt-shared.o extw-Xlib-shared.o
|
|
747 external_client_xt_objs_shared = ExternalClient-Xt-shared.o extw-Xt-shared.o extw-Xlib-shared.o
|
|
748 external_client_xlib_objs_shared = ExternalClient-Xlib-shared.o extw-Xlib-shared.o
|
|
749 external_client_motif_objs_nonshared = ExternalClient-Xm-nonshared.o extw-Xt-nonshared.o extw-Xlib-nonshared.o
|
|
750 external_client_xt_objs_nonshared = ExternalClient-Xt-nonshared.o extw-Xt-nonshared.o extw-Xlib-nonshared.o
|
|
751 external_client_xlib_objs_nonshared = ExternalClient-Xlib-nonshared.o extw-Xlib-nonshared.o
|
|
752
|
|
753 ## Add dependencies so things work right with a parallel make
|
1330
|
754 ExternalClient-Xm-shared.o: $(SRC)/ExternalClient.c ExternalClient-Xt-shared.o ExternalClient-Xm-nonshared.o
|
|
755 $(CC) -c $(pic_arg) $(cflags) -DEXTW_USES_MOTIF $(SRC)/ExternalClient.c
|
428
|
756 mv ExternalClient.o ExternalClient-Xm-shared.o
|
|
757
|
1330
|
758 ExternalClient-Xt-shared.o: $(SRC)/ExternalClient.c ExternalClient-Xt-nonshared.o
|
|
759 $(CC) -c $(pic_arg) $(cflags) $(SRC)/ExternalClient.c
|
428
|
760 mv ExternalClient.o ExternalClient-Xt-shared.o
|
|
761
|
1330
|
762 ExternalClient-Xlib-shared.o: $(SRC)/ExternalClient-Xlib.c ExternalClient-Xlib-nonshared.o
|
|
763 $(CC) -c $(pic_arg) $(cflags) $(SRC)/ExternalClient-Xlib.c
|
428
|
764 mv ExternalClient-Xlib.o ExternalClient-Xlib-shared.o
|
|
765
|
1330
|
766 ExternalClient-Xm-nonshared.o: $(SRC)/ExternalClient.c ExternalClient-Xt-nonshared.o
|
|
767 $(CC) -c $(cflags) -DEXTW_USES_MOTIF $(SRC)/ExternalClient.c
|
428
|
768 mv ExternalClient.o ExternalClient-Xm-nonshared.o
|
|
769
|
1330
|
770 ExternalClient-Xt-nonshared.o: $(SRC)/ExternalClient.c
|
|
771 $(CC) -c $(cflags) $(SRC)/ExternalClient.c
|
428
|
772 mv ExternalClient.o ExternalClient-Xt-nonshared.o
|
|
773
|
1330
|
774 ExternalClient-Xlib-nonshared.o: $(SRC)/ExternalClient-Xlib.c
|
|
775 $(CC) -c $(cflags) $(SRC)/ExternalClient-Xlib.c
|
428
|
776 mv ExternalClient-Xlib.o ExternalClient-Xlib-nonshared.o
|
|
777
|
|
778 ## We compile the common files twice (once with PIC and once without)
|
|
779 ## because on some systems, compiling with PIC but not linking into
|
|
780 ## a shared library messes things up.
|
|
781
|
1330
|
782 extw-Xt-shared.o: $(SRC)/extw-Xt.c extw-Xt-nonshared.o
|
|
783 $(CC) -c $(pic_arg) $(cflags) $(SRC)/extw-Xt.c
|
428
|
784 mv extw-Xt.o extw-Xt-shared.o
|
|
785
|
1330
|
786 extw-Xlib-shared.o: $(SRC)/extw-Xlib.c extw-Xlib-nonshared.o
|
|
787 $(CC) -c $(pic_arg) $(cflags) $(SRC)/extw-Xlib.c
|
428
|
788 mv extw-Xlib.o extw-Xlib-shared.o
|
|
789
|
1330
|
790 extw-Xt-nonshared.o: $(SRC)/extw-Xt.c
|
|
791 $(CC) -c $(cflags) $(SRC)/extw-Xt.c
|
428
|
792 mv extw-Xt.o extw-Xt-nonshared.o
|
|
793
|
1330
|
794 extw-Xlib-nonshared.o: $(SRC)/extw-Xlib.c
|
|
795 $(CC) -c $(cflags) $(SRC)/extw-Xlib.c
|
428
|
796 mv extw-Xlib.o extw-Xlib-nonshared.o
|
|
797
|
1330
|
798 libextcli_Xm.a: $(external_client_motif_objs_nonshared)
|
|
799 ar r libextcli_Xm.a $(external_client_motif_objs_nonshared)
|
428
|
800
|
1330
|
801 libextcli_Xt.a: $(external_client_xt_objs_nonshared)
|
|
802 ar r libextcli_Xt.a $(external_client_xt_objs_nonshared)
|
428
|
803
|
1330
|
804 libextcli_Xlib.a: $(external_client_xlib_objs_nonshared)
|
|
805 ar r libextcli_Xlib.a $(external_client_xlib_objs_nonshared)
|
428
|
806
|
1315
|
807 ## Now we try to figure out how to link a shared library.
|
|
808 ## If we cannot figure it out, leave EXTW_LINK undefined and a shared
|
|
809 ## library will not be created.
|
|
810
|
|
811 # ifdef USE_GCC
|
|
812 # ifdef USG5
|
|
813 # define EXTW_LINK(objs, output) $(CC) -shared objs -Xlinker -z -Xlinker text -o output
|
|
814 extw_link_beg = $(CC) -shared
|
|
815 extw_link_mid = -Xlinker -z -Xlinker text -o
|
|
816 extw_link_end =
|
|
817 ## I cannot figure out how to do shared a.out libraries, so just punt.
|
|
818 # elif !defined (LINUX) || defined (__ELF__)
|
|
819 # define EXTW_LINK(objs, output) $(CC) -shared objs -o output
|
|
820 extw_link_beg = $(CC) -shared
|
|
821 extw_link_mid = -o
|
|
822 extw_link_end =
|
|
823 # endif
|
|
824 # elif defined (USG5)
|
|
825 # if defined (IRIX)
|
1330
|
826 # define EXTW_LINK(objs, output) $(LD) -shared -g -check_registry $(TOOLROOT)/usr/lib/so_locations objs -o output
|
|
827 extw_link_beg = $(LD) -shared -g -check_registry $(TOOLROOT)/usr/lib/so_locations
|
1315
|
828 extw_link_mid = -o
|
|
829 extw_link_end =
|
|
830 # else /* not IRIX */
|
|
831 # define EXTW_LINK(objs, output) $(CC) -G objs -z text -o output
|
|
832 extw_link_beg = $(CC) -G
|
|
833 extw_link_mid = -z text -o
|
|
834 extw_link_end =
|
|
835 # endif /* not IRIX */
|
|
836 # else /* not USG5 */
|
|
837 # if defined (DEC_ALPHA) && defined (OSF1)
|
|
838 # define EXTW_LINK(objs, output) $(LD) $(ldflags) $(ld_switch_shared) -d objs -o output $(LIBES)
|
|
839 extw_link_beg = $(LD) $(ldflags) $(ld_switch_shared) -d
|
|
840 extw_link_mid = -o
|
|
841 extw_link_end = $(LIBES)
|
|
842 # else /* !(DEC_ALPHA && OSF1) */
|
|
843 # define EXTW_LINK(objs, output) $(LD) -dc objs -assert pure-text -o output
|
|
844 extw_link_beg = $(LD) -dc
|
|
845 extw_link_mid = -assert pure-text -o
|
|
846 extw_link_end =
|
|
847 # endif /* !(DEC_ALPHA && OSF1) */
|
|
848 # endif /* not USG5 */
|
|
849
|
428
|
850 #ifdef EXTW_LINK
|
|
851
|
1330
|
852 libextcli_Xm.so.1: $(external_client_motif_objs_shared)
|
|
853 $(extw_link_beg) $(external_client_motif_objs_shared) $(extw_link_mid) libextcli_Xm.so.1 $(extw_link_end)
|
428
|
854
|
1330
|
855 libextcli_Xt.so.1: $(external_client_xt_objs_shared)
|
|
856 $(extw_link_beg) $(external_client_xt_objs_shared) $(extw_link_mid) libextcli_Xt.so.1 $(extw_link_end)
|
428
|
857
|
1330
|
858 libextcli_Xlib.so.1: $(external_client_xlib_objs_shared)
|
|
859 $(extw_link_beg) $(external_client_xlib_objs_shared) $(extw_link_mid) libextcli_Xlib.so.1 $(extw_link_end)
|
428
|
860
|
|
861 #endif /* EXTW_LINK */
|
|
862
|
|
863 #endif /* EXTERNAL_WIDGET */
|
|
864
|
1330
|
865 config.h: $(SRC)/config.h.in
|
|
866 Emacs.ad.h: $(ETC)/Emacs.ad
|
428
|
867
|
|
868 config.h sheap-adjust.h paths.h Emacs.ad.h :
|
|
869 @echo "The file $@ needs to be re-generated."
|
|
870 @echo "Please run a make in the top level directory."
|
|
871 @echo "Consult the file \`INSTALL' for instructions for building XEmacs."
|
|
872 @exit 1
|
|
873
|
|
874 ## Some machines have alloca built-in.
|
|
875 ## They should define HAVE_ALLOCA, or may just let alloca.s
|
|
876 ## be used but generate no code.
|
|
877 ## Some have it written in assembler in alloca.s.
|
|
878 ## Some use the C version in alloca.c (these define C_ALLOCA in config.h).
|
851
|
879 ## Nowadays we always compile in the C version and use it to avoid stack
|
|
880 ## overflow.
|
428
|
881
|
|
882 #ifdef C_ALLOCA
|
|
883 #else
|
|
884 #ifndef HAVE_ALLOCA
|
1330
|
885 allocax.o : $(SRC)/alloca.s config.h
|
428
|
886 ## $(CPP) is cc -E, which may get confused by filenames
|
|
887 ## that do not end in .c. So copy file to a safe name. */
|
1330
|
888 ## cp $(SRC)/alloca.s allocatem.c
|
428
|
889 ## Remove any ^L, blank lines, and preprocessor comments,
|
|
890 ## since some assemblers barf on them. Use a different basename for the
|
|
891 ## output file, since some stupid compilers (Green Hill) use that
|
|
892 ## name for the intermediate assembler file.
|
|
893 $(CPP) $(cppflags) allocatem.c | \
|
|
894 sed -e 's///' -e 's/^#.*//' | \
|
|
895 sed -n -e '/^..*$$/p' > allocax.s
|
|
896 @$(RM) alloca.o
|
|
897 ## Xenix, in particular, needs to run assembler via cc.
|
|
898 $(CC) -c allocax.s
|
|
899 $(RM) allocax.s allocatem.c
|
|
900 #endif /* HAVE_ALLOCA */
|
|
901 #endif /* ! defined (C_ALLOCA) */
|
|
902
|
|
903 #ifdef HAVE_NATIVE_SOUND
|
442
|
904 sound_cflags=@sound_cflags@
|
1330
|
905 sunplay.o: $(SRC)/sunplay.c
|
|
906 $(CC) -c $(sound_cflags) $(cflags) $(SRC)/sunplay.c
|
|
907 hpplay.o: $(SRC)/hpplay.c
|
|
908 $(CC) -c -Demacs $(sound_cflags) $(cflags) $(SRC)/hpplay.c
|
428
|
909 #endif /* HAVE_NATIVE_SOUND */
|
|
910
|
462
|
911 #if defined(HAVE_GLADE_GLADE_H) || defined(HAVE_GLADE_H)
|
|
912 glade_files=glade.c
|
|
913 #endif
|
|
914
|
|
915 #ifdef HAVE_GTK
|
|
916 extra_doc_files=emacs-widget-accessors.c ui-byhand.c $(glade_files)
|
|
917 #endif
|
|
918
|
1330
|
919 xemacs_res.o: $(SRC)/../nt/xemacs.rc
|
|
920 windres --include-dir $(SRC)/../nt -i $(SRC)/../nt/xemacs.rc -o $@
|
442
|
921
|
1315
|
922 #########################################################################
|
1330
|
923 ## Other random crap ##
|
|
924 #########################################################################
|
1315
|
925
|
|
926 dortl : $(obj_rtl) $(otherrtls)
|
|
927 echo "(defvar source-files '(" > $(LISP)/source-files.el
|
|
928 (for a in $(obj_src) $(othersrcs);do \
|
|
929 echo -n "\""$$a"\"" >> $(LISP)/source-files.el ;\
|
|
930 done)
|
|
931 echo "))" >> $(LISP)/source-files.el
|
|
932
|
1330
|
933 ###################### Lint
|
1315
|
934 LINT.c=$(LINT) $(LINTFLAGS) $(LINTINCLUDES)
|
|
935 LINTFILES= $(objs:.o=.ln)
|
|
936 LINTINCLUDES = $(cppflags)
|
|
937 ## LINTFLAGS= -fd -m -p -s -u -v -x
|
|
938 LINTFLAGS= -fd -m -s -u -v -x
|
|
939 .PHONY: lint
|
|
940 lint: $(LINTFILES)
|
|
941 $(LINT.c) $(LINTFILES)
|
|
942
|
1330
|
943 ###################### Automated tests
|
|
944 testdir = $(SRC)/../tests/automated
|
|
945 batch_test_emacs = $(BATCH_PACKAGES) -l $(testdir)/test-harness.el -f batch-test-emacs $(testdir)
|
1315
|
946
|
|
947 .PHONY: check check-temacs check-features
|
|
948 check:
|
|
949 $(DO_XEMACS) $(batch_test_emacs)
|
|
950 check-temacs:
|
|
951 $(TEMACS_BATCH) $(run_temacs_args) $(batch_test_emacs)
|
|
952 check-features: all
|
|
953 $(XEMACS_BATCH) -l check-features.el
|
|
954
|
1330
|
955 ###################### Debugging targets
|
|
956
|
1315
|
957 ## None of the debugging products work with a dumped xemacs binary,
|
|
958 ## because it does unexpected things like free memory that has been
|
|
959 ## malloc'ed in a *different* process!! So we need to run these on
|
|
960 ## temacs.
|
|
961
|
|
962 ## RTC is Sun WorkShop's Run Time Checking, integrated with dbx
|
|
963 rtc_patch.o:
|
|
964 rtc_patch_area -o $@
|
|
965
|
|
966 rtcmacs: $(temacs_deps) rtc_patch.o
|
2427
|
967 $(RM) $(RAW_EXE); $(MAKE) $(RECURSIVE_MAKE_ARGS) $(RAW_EXE) RTC_patch_objs=rtc_patch.o
|
1330
|
968 mv $(RAW_EXE) rtcmacs
|
1315
|
969
|
|
970 .PHONY: run-rtcmacs
|
|
971 run-rtcmacs: rtcmacs
|
|
972 dbx -q -C -c \
|
|
973 'dbxenv rtc_error_log_file_name /dev/fd/1; \
|
|
974 dbxenv suppress_startup_message 5.0; \
|
|
975 ignore POLL; \
|
|
976 check -access; \
|
|
977 suppress rui; \
|
1330
|
978 runargs -nd $(BATCH) $(run_temacs_args) -vanilla; \
|
1315
|
979 run' rtcmacs
|
|
980
|
1330
|
981 debug-temacs: $(RAW_EXE)
|
|
982 -gdb $(RAW_EXE)
|
1315
|
983
|
|
984 ## Purify, Quantify, PureCoverage are software quality products from
|
|
985 ## Rational, formerly Pure Atria, formerly Pure Software.
|
|
986 ##
|
|
987 ## Purify
|
|
988 PURIFY_PROG = purify
|
|
989 PURIFY_LIBS =
|
|
990 PURIFY_FLAGS =\
|
|
991 #ifdef PDUMP
|
|
992 -search-mmaps=yes\
|
|
993 #endif
|
|
994 -chain-length=32 -ignore-signals=SIGPOLL\
|
1330
|
995 -cache-dir=$(blddir)/purecache -always-use-cache-dir=yes
|
1315
|
996
|
|
997 puremacs: $(temacs_deps)
|
|
998 $(PURIFY_PROG) $(PURIFY_FLAGS) $(LD) $(temacs_link_args) $(PURIFY_LIBS)
|
1330
|
999 cp $@ $(RAW_EXE)
|
1315
|
1000
|
|
1001 ## Quantify
|
|
1002 #ifdef QUANTIFY
|
|
1003 QUANTIFY_PROG = quantify
|
|
1004 QUANTIFY_HOME = `$(QUANTIFY_PROG) -print-home-dir`
|
|
1005 QUANTIFY_FLAGS = -cache-dir=./purecache -always-use-cache-dir=yes
|
|
1006 cppflags += -I$(QUANTIFY_HOME)
|
|
1007 temacs_link_args += $(QUANTIFY_HOME)/quantify_stubs.a
|
|
1008
|
|
1009 quantmacs: $(temacs_deps)
|
|
1010 $(QUANTIFY_PROG) $(QUANTIFY_FLAGS) $(LD) $(temacs_link_args)
|
1330
|
1011 cp $@ $(RAW_EXE)
|
1315
|
1012 #endif /* QUANTIFY */
|
|
1013
|
|
1014 PURECOV_PROG=purecov
|
|
1015 covmacs: $(temacs_deps)
|
|
1016 $(PURECOV_PROG) $(LD) $(temacs_link_args)
|
428
|
1017
|
1330
|
1018 ###################### Clean
|
|
1019
|
428
|
1020 .PHONY: mostlyclean clean distclean realclean versionclean extraclean
|
3062
|
1021 .PHONY: distclean-noconfig realclean-noconfig extraclean-noconfig
|
428
|
1022 mostlyclean:
|
3083
|
1023 -$(RM) *.o *.i *.rtl *.ln core \
|
1330
|
1024 temacs puremacs quantmacs covmacs rtcmacs temacs.exe \
|
|
1025 sheap-adjust.h dump-id.c $(BLDSRC)/NEEDTODUMP SATISFIED \
|
|
1026 $(LIB_SRC)/*.po $(LIB_SRC)/*.mo
|
|
1027 versionclean:
|
3083
|
1028 -$(RM) $(RAW_EXE) $(DUMP_TARGET) $(LIB_SRC)/DOC
|
1330
|
1029 ## Remove the generated load files here; they cause lots of problems
|
|
1030 ## when they don't work right.
|
428
|
1031 clean: mostlyclean versionclean
|
3083
|
1032 -$(RM) libextcli* $(LISP)/auto-autoloads.el* $(LISP)/custom-load.el* \
|
1330
|
1033 $(LISP)/mule/auto-autoloads.el* $(LISP)/mule/custom-load.el* \
|
|
1034 $(SRCMODULES)/auto-autoloads.el* $(SRCMODULES)/custom-load.el*
|
428
|
1035 ## This is used in making a distribution.
|
|
1036 ## Do not use it on development directories!
|
3062
|
1037 distclean-noconfig: clean
|
3083
|
1038 -$(RM) config.h paths.h Emacs.ad.h $(LISP)/finder-inf.el* \
|
3062
|
1039 TAGS xemacs.def xemacs.def.in
|
|
1040 ## This is used in making a distribution.
|
|
1041 ## Do not use it on development directories!
|
|
1042 distclean: distclean-noconfig
|
3083
|
1043 -$(RM) GNUmakefile Makefile Makefile.in
|
3062
|
1044 realclean-noconfig: distclean-noconfig
|
428
|
1045 realclean: distclean
|
3062
|
1046 extraclean-noconfig: realclean-noconfig
|
3083
|
1047 -$(RM) *~ \#* m/*~ m/\#* s/*~ s/\#*
|
428
|
1048 extraclean: realclean
|
3083
|
1049 -$(RM) *~ \#* m/*~ m/\#* s/*~ s/\#*
|
428
|
1050
|
1330
|
1051 ###################### Lock, unlock
|
|
1052
|
428
|
1053 .PHONY : lock unlock
|
|
1054 SOURCES = *.[chm] *.pswm [sm]/* COPYING paths.h.in Makefile.in.in \
|
|
1055 config.h.in README COPYING ChangeLog
|
|
1056 unlock:
|
|
1057 chmod u+w $(SOURCES)
|
|
1058
|
|
1059 relock:
|
|
1060 chmod -w $(SOURCES)
|
|
1061
|
1330
|
1062 ###################### Installation
|
|
1063
|
428
|
1064 ## Header files for ellcc
|
|
1065 #ifdef HAVE_SHLIB
|
|
1066 MAKEPATH=../lib-src/make-path
|
1330
|
1067 install: $(PROGNAME)
|
|
1068 $(MAKEPATH) $(archlibdir)/include $(archlibdir)/include/m $(archlibdir)/include/s
|
428
|
1069 -@echo "Copying include files for ellcc..."
|
|
1070 -@hdir=`pwd`; \
|
1330
|
1071 cd $(SRC); hdrdir2=`pwd`; cd $$hdir; \
|
428
|
1072 test "$$hdrdir2" != "$$hdir" && hdir="$$hdir $$hdrdir2"; \
|
|
1073 (for thisdir in $$hdir; do \
|
448
|
1074 cd $$thisdir && \
|
428
|
1075 (hdrtars=; \
|
|
1076 for hdrfile in *.h; do \
|
|
1077 hdrtars="$$hdrtars $$hdrfile"; \
|
|
1078 done; \
|
|
1079 test -d s && hdrtars="$$hdrtars s/*"; \
|
|
1080 test -d m && hdrtars="$$hdrtars m/*"; \
|
|
1081 test -n "$$hdrtars" && (tar cf - $$hdrtars) | \
|
1330
|
1082 (cd $(archlibdir)/include && umask 022 && tar xf -); \
|
|
1083 chmod 755 $(archlibdir)/include; \
|
|
1084 test -d $(archlibdir)/include/s && \
|
|
1085 chmod 755 $(archlibdir)/include/s; \
|
|
1086 test -d $(archlibdir)/include/m && \
|
|
1087 chmod 755 $(archlibdir)/include/s;) \
|
428
|
1088 done)
|
|
1089 #endif
|
|
1090
|
1330
|
1091 ###################### Dependencies
|
|
1092
|
428
|
1093 ## Dependency processing using home-grown script, not makedepend
|
|
1094 .PHONY: depend
|
|
1095 FRC.depend:
|
|
1096 depend: FRC.depend
|
1330
|
1097 cd $(SRC) && $(RM) depend.tmp && \
|
428
|
1098 perl ./make-src-depend > depend.tmp && \
|
|
1099 if cmp -s depend depend.tmp; \
|
|
1100 then $(RM) depend.tmp; \
|
|
1101 else $(RM) depend && mv depend.tmp depend; \
|
|
1102 fi
|
1330
|
1103
|
|
1104 ###################### Unicode encapsulation
|
|
1105
|
|
1106 .PHONY: unicode-encapsulate
|
|
1107 FRC.unicode-encapsulate:
|
|
1108 unicode-encapsulate: FRC.unicode-encapsulate
|
|
1109 cd $(SRC) && \
|
|
1110 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
|