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
|
3094
|
136 #ifdef USE_XFT
|
3354
|
137 x_objs += font-mgr.o
|
3094
|
138 #endif
|
771
|
139 x_gui_objs=$(gui_objs:.o=-x.o)
|
|
140 #ifdef HAVE_TOOLBARS
|
|
141 x_gui_objs += toolbar-common.o
|
|
142 #endif
|
|
143 #endif
|
|
144
|
|
145 #ifdef HAVE_MS_WINDOWS
|
|
146 mswindows_objs=console-msw.o device-msw.o event-msw.o frame-msw.o \
|
|
147 objects-msw.o select-msw.o redisplay-msw.o glyphs-msw.o
|
|
148 mswindows_gui_objs=$(gui_objs:.o=-msw.o)
|
|
149 #endif
|
|
150
|
|
151 #ifdef HAVE_TTY
|
|
152 tty_objs=console-tty.o device-tty.o event-tty.o frame-tty.o objects-tty.o \
|
|
153 redisplay-tty.o cm.o
|
|
154 #endif
|
|
155
|
|
156 #ifdef HAVE_GTK
|
|
157 gtk_objs=console-gtk.o device-gtk.o event-gtk.o frame-gtk.o \
|
|
158 objects-gtk.o redisplay-gtk.o glyphs-gtk.o select-gtk.o gccache-gtk.o \
|
|
159 gtk-xemacs.o ui-gtk.o
|
|
160 gtk_gui_objs=$(gui_objs:.o=-gtk.o)
|
|
161 #ifdef HAVE_TOOLBARS
|
|
162 gtk_gui_objs += toolbar-common.o
|
|
163 #endif
|
|
164 #endif
|
|
165
|
|
166 #ifdef HAVE_BALLOON_HELP
|
|
167 balloon_help_objs=balloon_help.o balloon-x.o
|
|
168 #endif
|
|
169
|
|
170 #ifdef CLASH_DETECTION
|
|
171 clash_detection_objs=filelock.o
|
|
172 #endif
|
|
173
|
|
174 #ifdef HAVE_DATABASE
|
|
175 database_objs=database.o
|
|
176 #endif
|
|
177
|
|
178 #ifdef DEBUG_XEMACS
|
|
179 debug_objs=debug.o tests.o
|
|
180 #endif
|
|
181
|
|
182 #ifdef HAVE_UNIXOID_EVENT_LOOP
|
|
183 event_unixoid_objs=event-unixoid.o
|
|
184 #endif
|
|
185
|
|
186 #ifdef HAVE_GIF
|
|
187 gif_objs=dgif_lib.o gif_io.o
|
|
188 #endif
|
|
189
|
|
190 #ifdef HAVE_GPM
|
|
191 gpm_objs=gpmevent.o
|
|
192 #endif
|
|
193
|
996
|
194 #if defined(HAVE_LDAP) && !defined(HAVE_SHLIB)
|
1330
|
195 ldap_objs=$(BLDMODULES)/ldap/eldap.o
|
771
|
196 #endif
|
|
197
|
|
198 #ifdef MULE
|
|
199 mule_objs=mule-ccl.o mule-charset.o mule-coding.o
|
|
200 #endif
|
|
201
|
2973
|
202 #if defined(HAVE_CANNA) && !defined(HAVE_SHLIB)
|
3010
|
203 mule_canna_objs=$(BLDMODULES)/canna/canna_api.o
|
771
|
204 #endif
|
|
205
|
|
206 #ifdef HAVE_WNN
|
|
207 mule_wnn_objs=mule-wnnfns.o
|
|
208 #endif
|
|
209
|
1983
|
210 #ifdef WITH_GMP
|
|
211 number_objs=number-gmp.o number.o
|
|
212 #endif
|
|
213 #ifdef WITH_MP
|
|
214 number_objs=number-mp.o number.o
|
|
215 #endif
|
|
216
|
996
|
217 #if defined(HAVE_POSTGRESQL) && !defined(HAVE_SHLIB)
|
1330
|
218 postgresql_objs=$(BLDMODULES)/postgresql/postgresql.o
|
771
|
219 #endif
|
|
220
|
|
221 #ifdef HAVE_WIN32_PROCESSES
|
|
222 process_objs=process-nt.o
|
|
223 #elif defined (HAVE_UNIX_PROCESSES)
|
|
224 process_objs=process-unix.o
|
|
225 #endif
|
|
226
|
|
227 #ifdef HAVE_SETITIMER
|
|
228 profile_objs=profile.o
|
|
229 #endif
|
|
230
|
442
|
231 #if defined (HEAP_IN_DATA) && !defined (PDUMP)
|
|
232 sheap_objs=sheap.o
|
|
233 #endif
|
|
234
|
771
|
235 #ifdef HAVE_SHLIB
|
1750
|
236 shlib_objs=sysdll.o
|
1632
|
237 # ifdef HAVE_MS_WINDOWS
|
|
238 export_lib=xemacs-export.o
|
|
239 xemacs-export.o: xemacs.def
|
|
240 dlltool -D xemacs-${version}.exe -d $< -l xemacs-import.a -e $@
|
|
241 # endif
|
771
|
242 #endif
|
|
243
|
|
244 #ifdef SUNPRO
|
|
245 sunpro_objs=sunpro.o
|
428
|
246 #endif
|
|
247
|
771
|
248 #ifdef TOOLTALK
|
|
249 tooltalk_objs=tooltalk.o
|
|
250 #endif
|
|
251
|
|
252 #if defined (WIN32_NATIVE) || defined (CYGWIN)
|
|
253 win32_objs=win32.o intl-win32.o intl-auto-encap-win32.o intl-encap-win32.o \
|
|
254 xemacs_res.o
|
611
|
255 #endif
|
|
256
|
3092
|
257 #ifdef NEW_GC
|
3263
|
258 new_gc_objs=mc-alloc.o vdb.o
|
3092
|
259 # if defined (WIN32_ANY) || defined (VDB_WIN32)
|
|
260 vdb_objs=vdb-win32.o
|
|
261 # elif defined (VDB_MACH)
|
|
262 vdb_objs=vdb-mach.o
|
|
263 # elif defined (VDB_POSIX)
|
|
264 vdb_objs=vdb-posix.o
|
|
265 # else /* VDB_FAKE */
|
|
266 vdb_objs=vdb-fake.o
|
|
267 # endif
|
|
268 #endif /* NEW_GC */
|
|
269
|
428
|
270 ## lastfile must follow all files whose initialized data areas should
|
|
271 ## be dumped as pure by dump-emacs.
|
|
272
|
|
273 ## NOTE: The last line cannot be all macros, because make will barf
|
|
274 ## if they all come out null.
|
|
275
|
|
276 objs=\
|
851
|
277 abbrev.o alloc.o alloca.o \
|
|
278 $(balloon_help_objs) blocktype.o buffer.o bytecode.o \
|
853
|
279 callint.o casefiddle.o casetab.o chartab.o \
|
851
|
280 $(clash_detection_objs) cmdloop.o cmds.o $(coding_system_objs) console.o \
|
|
281 console-stream.o\
|
771
|
282 data.o $(database_objs) $(debug_objs) device.o dired.o doc.o doprnt.o\
|
851
|
283 dynarr.o \
|
1750
|
284 editfns.o elhash.o emacs.o emodules.o eval.o events.o\
|
771
|
285 event-stream.o $(event_unixoid_objs) $(extra_objs) extents.o\
|
|
286 faces.o file-coding.o fileio.o $(LOCK_OBJ) filemode.o floatfns.o fns.o \
|
|
287 font-lock.o frame.o\
|
3092
|
288 gc.o general.o $(gif_objs) glyphs.o glyphs-eimage.o glyphs-shared.o\
|
793
|
289 glyphs-widget.o $(gpm_objs) $(gtk_objs) $(gtk_gui_objs) $(gui_objs) \
|
|
290 gutter.o\
|
771
|
291 hash.o imgproc.o indent.o insdel.o intl.o\
|
|
292 keymap.o $(RTC_patch_objs) line-number.o $(ldap_objs) lread.o lstream.o\
|
3263
|
293 $(new_gc_objs) $(vdb_objs) \
|
771
|
294 macros.o marker.o md5.o minibuf.o $(mswindows_objs) $(mswindows_gui_objs)\
|
1983
|
295 $(mule_objs) $(mule_canna_objs) $(mule_wnn_objs) $(number_objs) objects.o\
|
|
296 opaque.o $(postgresql_objs) print.o process.o $(process_objs) $(profile_objs)\
|
771
|
297 rangetab.o realpath.o redisplay.o redisplay-output.o regex.o\
|
|
298 search.o select.o $(sheap_objs) $(shlib_objs) signal.o sound.o\
|
|
299 specifier.o strftime.o $(sunpro_objs) symbols.o syntax.o sysdep.o\
|
|
300 text.o $(tooltalk_objs) $(tty_objs) undo.o unicode.o $(x_objs) $(x_gui_objs)\
|
|
301 widget.o window.o $(win32_objs)
|
428
|
302
|
|
303 obj_rtl = $(objs:.o=.c.rtl)
|
|
304
|
|
305 #ifdef REL_ALLOC
|
|
306 rallocdocsrc = ralloc.c
|
|
307 rallocobjs = ralloc.o
|
|
308 #endif
|
|
309
|
|
310 malloclib = $(libmcheck)
|
|
311 #ifndef SYSTEM_MALLOC
|
|
312 # ifdef GNU_MALLOC /* GNU malloc */
|
|
313 # ifdef ERROR_CHECK_MALLOC
|
|
314 #ifdef DOUG_LEA_MALLOC
|
|
315 mallocobjs = free-hook.o vm-limit.o
|
|
316 #else
|
|
317 mallocobjs = gmalloc.o free-hook.o vm-limit.o
|
|
318 #endif
|
|
319 mallocdocsrc = free-hook.c
|
|
320 # else /* New GNU malloc, sans error checking */
|
|
321 #ifdef DOUG_LEA_MALLOC
|
|
322 mallocobjs = vm-limit.o
|
|
323 #else
|
|
324 mallocobjs = gmalloc.o vm-limit.o
|
|
325 #endif
|
|
326 mallocdocsrc =
|
|
327 # endif /* ERROR_CHECK_MALLOC */
|
|
328 # else /* Older GNU malloc */
|
|
329 mallocobjs = malloc.o
|
|
330 mallocdocsrc =
|
|
331 # endif /* Older GNU malloc */
|
|
332 #else /* SYSTEM_MALLOC */
|
|
333 mallocobjs =
|
|
334 mallocdocsrc =
|
|
335 #ifdef USE_DEBUG_MALLOC
|
|
336 malloclib = -ldmalloc
|
|
337 #endif /* USE_DEBUG_MALLOC */
|
|
338 #endif /* SYSTEM_MALLOC */
|
|
339
|
|
340 #ifdef HAVE_X_WINDOWS
|
|
341
|
1330
|
342 lwlib_lib = ../lwlib/liblw.a
|
|
343
|
428
|
344 # ifdef EXTERNAL_WIDGET
|
|
345 external_widget_objs = ExternalShell.o extw-Xt-nonshared.o extw-Xlib-nonshared.o
|
|
346
|
|
347 # ifdef LWLIB_USES_MOTIF
|
|
348 # ifdef EXTW_LINK
|
|
349 motif_other_files = libextcli_Xm.a libextcli_Xm.so.1
|
|
350 # else
|
|
351 motif_other_files = libextcli_Xm.a
|
|
352 # endif
|
|
353 #endif /* LWLIB_USES_MOTIF */
|
|
354
|
|
355 # ifdef EXTW_LINK
|
|
356 shared_other_files = libextcli_Xt.so.1 libextcli_Xlib.so.1
|
|
357 # endif
|
|
358 other_files=\
|
1330
|
359 $(motif_other_files)\
|
428
|
360 libextcli_Xt.a libextcli_Xlib.a\
|
1330
|
361 $(shared_other_files)
|
428
|
362
|
|
363 # endif /* EXTERNAL_WIDGET */
|
|
364
|
|
365 # if defined (HAVE_OFFIX_DND) || defined (HAVE_CDE)
|
|
366 dnd_objs = @dnd_objs@
|
|
367 # endif /* HAVE_OFFIX_DND || HAVE_CDE */
|
|
368
|
|
369 X11_objs = EmacsFrame.o EmacsShell.o TopLevelEmacsShell.o TransientEmacsShell.o EmacsManager.o $(external_widget_objs) $(dnd_objs)
|
|
370 #endif /* HAVE_X_WINDOWS */
|
|
371
|
|
372 ## define otherobjs as list of object files that make-docfile
|
|
373 ## should not be told about.
|
1632
|
374 otherobjs = lastfile.o $(mallocobjs) $(rallocobjs) $(X11_objs) $(export_lib)
|
428
|
375 otherrtls = $(otherobjs:.o=.c.rtl)
|
|
376 othersrcs = $(otherobjs:.o=.c)
|
|
377
|
1330
|
378 LIBES = $(lwlib_lib) $(malloclib) $(ld_libs_all) $(lib_gcc)
|
428
|
379
|
|
380 #ifdef I18N3
|
1330
|
381 mo_file = $(LIB_SRC)/emacs.mo
|
428
|
382 #endif
|
|
383
|
1315
|
384 #########################################################################
|
1330
|
385 ## Implicit rules ##
|
|
386 #########################################################################
|
1315
|
387
|
1330
|
388 ## For performance and consistency, no built-in rules.
|
|
389 .SUFFIXES:
|
|
390 .SUFFIXES: .c .h .o .i .s .dep
|
|
391
|
|
392 ## -Demacs is needed to make some files produce the correct version
|
|
393 ## for use in Emacs.
|
|
394
|
2958
|
395 cppflags = $(CPPFLAGS) -Demacs -I. -I$(SRC) $(c_switch_all)
|
1330
|
396 cflags = $(CFLAGS) $(cppflags)
|
2502
|
397 #if defined (WIN32_NATIVE)
|
1330
|
398 ldflags = $(LDFLAGS) -mwindows -e _mainCRTStartup $(ld_switch_all) $(ld_dynamic_link_flags)
|
|
399 #else
|
|
400 ldflags = $(LDFLAGS) $(ld_switch_all) $(ld_dynamic_link_flags)
|
|
401 #endif
|
|
402
|
2502
|
403 #if defined (CYGWIN) && !defined (PDUMP)
|
|
404 ldflags += -Wl,--script=s/cygwin.sc
|
|
405 #endif
|
|
406
|
1330
|
407 #ifdef SOLARIS2
|
|
408 %.o : %.c
|
|
409 #else
|
|
410 .c.o:
|
|
411 #endif
|
|
412 $(CC) -c $(cflags) $<
|
1315
|
413
|
1330
|
414 ## Create preprocessor output (debugging purposes only)
|
|
415 .c.i:
|
|
416 #ifdef __GNUC__
|
|
417 $(CC) -E $(cppflags) -o $@ $<
|
|
418 #else /* works on Solaris; what about other systems? */
|
|
419 $(CC) -P $(cppflags) $<
|
|
420 #endif /* compiler */
|
|
421
|
|
422 ## Create assembler output (debugging purposes only)
|
|
423 .c.s:
|
|
424 $(CC) -S -c $(cflags) $<
|
|
425
|
|
426 ## Create RTL files
|
|
427 %.c.rtl : %.c
|
|
428 $(CC) -dr -c $(cflags) $<
|
|
429
|
|
430 #########################################################################
|
|
431 ## Primary rebuilding process ##
|
|
432 #########################################################################
|
|
433
|
|
434 #ifdef PDUMP
|
|
435 DUMP_TARGET = $(PROGNAME).dmp
|
|
436 RAW_EXE = $(PROGNAME)
|
|
437 DUMP_ID = dump-id.o
|
2720
|
438 #if !defined(WIN32_NATIVE) && defined(DUMP_IN_EXEC)
|
2015
|
439 DUMP_TARGET = $(PROGNAME)
|
2388
|
440 #ifndef CYGWIN
|
2015
|
441 RAW_EXE = temacs
|
2388
|
442 #else
|
|
443 RAW_EXE = temacs.exe
|
|
444 #endif
|
2015
|
445 #endif
|
1330
|
446 #else
|
|
447 DUMP_TARGET = $(PROGNAME)
|
|
448 RAW_EXE = temacs
|
|
449 #endif
|
|
450
|
|
451 DO_TEMACS = $(DUMPENV) ./$(RAW_EXE)
|
|
452 DO_XEMACS = ./$(PROGNAME)
|
1315
|
453
|
|
454 BATCH = -no-packages -batch
|
|
455 BATCH_PACKAGES = -vanilla -batch
|
|
456 TEMACS_BATCH = $(DO_TEMACS) -nd $(BATCH)
|
|
457 XEMACS_BATCH = $(DO_XEMACS) $(BATCH)
|
|
458 XEMACS_BATCH_PACKAGES = $(DO_XEMACS) $(BATCH_PACKAGES)
|
|
459 temacs_loadup_args = -l $(LISP)/loadup.el
|
|
460 dump_temacs_args = $(temacs_loadup_args) dump
|
|
461 run_temacs_args = $(temacs_loadup_args) run-temacs
|
|
462 dump_temacs = $(TEMACS_BATCH) $(dump_temacs_args)
|
|
463
|
|
464 ## Compile, dump, and make sure all .elc files are up-to-date.
|
|
465
|
1330
|
466 ## NOTE NOTE NOTE: There appears to be a fundamental but non-obvious
|
|
467 ## difference between the way that standard `make', GNU Make, and `nmake'
|
|
468 ## handle dependencies, and this means we have to write the dependencies in
|
|
469 ## Makefile.in.in and xemacs.mak differently. To illustrate this, consider
|
|
470 ## the following first:
|
|
471
|
|
472 ##.PHONY: all (`make' only)
|
|
473 ## all: test.exe
|
|
474 ##
|
|
475 ##.PHONY: FRC.test.c (`make' only)
|
|
476 ##FRC.test.c:
|
|
477 ##
|
|
478 ##test.c: FRC.test.c
|
|
479 ## if test ! -f foo ; then touch test.c; fi (`make' only)
|
|
480 ## if not exist foo touch test.c (`nmake' only)
|
|
481 ##
|
|
482 ##test.obj: test.c
|
|
483 ## touch test.obj
|
|
484 ##
|
|
485 ##test.exe: test.obj
|
|
486 ## touch test.exe
|
|
487
|
|
488 ## (GNU Make doesn't need the .PHONY declarations, but evidently some versions
|
|
489 ## of `make' do. nmake doesn't need them and doesn't allow them, either.)
|
|
490
|
|
491 ## Running `make' rebuilds test.exe only if `foo' doesn't exist.
|
|
492 ## Running `nmake -f Makefile' rebuilds it regardless.
|
|
493
|
|
494 ## Both conclude that test.c needs to be rebuilt since its dependent is
|
|
495 ## non-existent. But `make' recalculates its dependencies after running
|
|
496 ## the commands for test.c, and notices that test.c hasn't changed, and
|
|
497 ## thus test.obj and test.exe are up-to-date. `nmake' doesn't.
|
|
498
|
|
499 ## On the other hand, consider the following:
|
428
|
500
|
1330
|
501 ##.PHONY: all (`make' only)
|
|
502 ##all: check-foo test.exe
|
|
503 ##
|
|
504 ##.PHONY: check-foo (`make' only)
|
|
505 ##check-foo:
|
|
506 ## if test ! -f foo; then touch test.c; fi (`make' only)
|
|
507 ## if not exist foo touch test.c (`nmake' only)
|
|
508 ##
|
|
509 ##test.c:
|
|
510 ## touch test.c
|
|
511 ##
|
|
512 ##test.obj: test.c
|
|
513 ## touch test.obj
|
|
514 ##
|
|
515 ##test.exe: test.c test.obj
|
|
516 ## touch test.exe
|
|
517 ##
|
1315
|
518
|
1330
|
519 ## Running `nmake -f Makefile' (and `GNU make') rebuilds test.exe only if
|
|
520 ## `foo' doesn't exist.
|
|
521 ## Running some versions of non-GNU `make' does nothing at all once test.c,
|
|
522 ## test.obj and test.exe all exist.
|
|
523
|
|
524 ## It appears that `nmake' doesn't check dependencies for test.exe until it
|
|
525 ## actually needs to be rebuilt, so this "sideways" dependency script
|
|
526 ## works. GNU make evidently recalculates *all* dependencies after each
|
|
527 ## command so has no problem, either. But some makes apparently calculate
|
|
528 ## all dependencies at startup and then, after executing a command to build
|
|
529 ## a dependency, only recheck relationships involving that particular
|
|
530 ## dependency.
|
|
531
|
|
532 ## In XEmacs-land, the above situation exists wrt the `NEEDTODUMP'
|
|
533 ## dependency, recalculated by `update-elc.el'. Thus, Makefile.in.in must
|
|
534 ## use the method #1 above, and nmake must use method #2.
|
|
535
|
|
536 ## -ben
|
|
537
|
|
538 .PHONY: build-the-mofo
|
1346
|
539 build-the-mofo: update-elc-2 $(mo_file) $(other_files) $(LISP)/finder-inf.el load-shadows
|
1315
|
540
|
1346
|
541 ## (1) Compile all dependencies of the XEmacs executable
|
428
|
542
|
1330
|
543 #ifdef HAVE_X_WINDOWS
|
|
544 lwlib_deps = $(lwlib_lib)
|
|
545 $(lwlib_lib):
|
2427
|
546 cd ../lwlib && $(MAKE) $(RECURSIVE_MAKE_ARGS)
|
1330
|
547 #endif /* HAVE_X_WINDOWS */
|
|
548
|
428
|
549 #ifdef DYNODUMP
|
|
550 dynodump_deps = ../dynodump/dynodump.so
|
|
551 ../dynodump/dynodump.so:
|
2427
|
552 cd ../dynodump && $(MAKE) $(RECURSIVE_MAKE_ARGS)
|
428
|
553 #endif /* DYNODUMP */
|
|
554
|
1330
|
555 link_deps = $(start_files) $(objs) $(otherobjs) $(lwlib_deps) $(dynodump_deps)
|
1315
|
556
|
1346
|
557 $(LIB_SRC)/make-dump-id:
|
2427
|
558 cd $(LIB_SRC) && $(MAKE) $(RECURSIVE_MAKE_ARGS) make-dump-id
|
1346
|
559
|
|
560 dump-id.c: $(LIB_SRC)/make-dump-id $(link_deps)
|
|
561 $(LIB_SRC)/make-dump-id
|
|
562
|
|
563 ## (2) Link the XEmacs executable
|
|
564
|
2720
|
565 #if !defined(PDUMP) || !defined(DUMP_IN_EXEC) || defined(WIN32_NATIVE)
|
2015
|
566 $(RAW_EXE): $(link_deps) $(DUMP_ID)
|
|
567 $(LD) $(start_flags) $(ldflags) -o $@ $(start_files) $(objs) $(otherobjs) $(DUMP_ID) $(LIBES)
|
|
568 #else
|
|
569 $(RAW_EXE): $(link_deps) $(DUMP_ID)
|
|
570 if test -f dump-size ; then \
|
|
571 $(CC) -c $(cflags) -DMAX_SIZE=`cat dump-size` $(SRC)/dump-data.c ;\
|
|
572 else \
|
|
573 $(CC) -c $(cflags) -DMAX_SIZE=0 $(SRC)/dump-data.c ;\
|
|
574 fi
|
|
575 $(LD) $(start_flags) $(ldflags) -o $@ $(start_files) $(objs) $(otherobjs) $(DUMP_ID) dump-data.o $(LIBES)
|
|
576 #endif
|
1315
|
577
|
1346
|
578 ## (3) Update the .elc's needed for dumping
|
|
579
|
|
580 .PHONY: FRC.needtodump
|
|
581 FRC.needtodump:
|
|
582
|
|
583 ## This file is touched by update-elc.el when redumping is necessary.
|
|
584 ## We use $(BLDSRC) == `.' here to help keep sync with nt/xemacs.mak,
|
|
585 ## where $(BLDSRC) is not `.'.
|
1406
|
586 $(BLDSRC)/NEEDTODUMP: $(RAW_EXE) FRC.needtodump
|
1346
|
587 $(TEMACS_BATCH) -l $(LISP)/update-elc.el
|
|
588
|
|
589 ## (4) Build the DOC file
|
1315
|
590
|
|
591 obj_src = $(objs:.o=.c)
|
|
592
|
1346
|
593 $(LIB_SRC)/make-docfile:
|
2427
|
594 cd $(LIB_SRC) && $(MAKE) $(RECURSIVE_MAKE_ARGS) make-docfile
|
1346
|
595
|
1330
|
596 $(LIB_SRC)/DOC: $(LIB_SRC)/make-docfile $(BLDSRC)/NEEDTODUMP $(temacs_deps)
|
1303
|
597 #ifdef QUICK_BUILD
|
|
598 if test ! -f $@ ; then \
|
|
599 #else
|
|
600 if true ; then \
|
|
601 #endif
|
1315
|
602 $(TEMACS_BATCH) -l $(LISP)/make-docfile.el -- \
|
1330
|
603 -o $(LIB_SRC)/DOC -d $(SRC) -i $(LIB_SRC)/../site-packages \
|
|
604 $(obj_src) $(mallocdocsrc) $(rallocdocsrc) \
|
|
605 $(extra_doc_files) ; fi
|
428
|
606
|
1346
|
607 ## (5) Dump
|
|
608
|
|
609 $(DUMP_TARGET): $(RAW_EXE) $(BLDSRC)/NEEDTODUMP $(LIB_SRC)/DOC
|
|
610 #ifdef HEAP_IN_DATA
|
|
611 @$(RM) $@ && touch SATISFIED
|
|
612 $(dump_temacs)
|
|
613 @if test -f SATISFIED; then $(RM) SATISFIED; else $(RM) $@; \
|
2427
|
614 $(MAKE) $(RECURSIVE_MAKE_ARGS) $@; fi
|
1346
|
615 #else
|
|
616 @$(RM) $@
|
|
617 $(dump_temacs)
|
|
618 #endif
|
2720
|
619 #if defined(PDUMP) && defined(DUMP_IN_EXEC) && !defined(WIN32_NATIVE)
|
2015
|
620 if test -f dump-size; then \
|
|
621 $(LIB_SRC)/insert-data-in-exec $(RAW_EXE) $(DUMP_TARGET).dmp $(DUMP_TARGET) `$(DO_TEMACS) -si`; \
|
|
622 ret=$$? ; \
|
|
623 if test $${ret} -eq 2; then \
|
|
624 $(RM) dump-size ; \
|
|
625 else \
|
|
626 if test $${ret} -eq 1; then \
|
|
627 exit 1; \
|
|
628 else \
|
|
629 chmod +x $(DUMP_TARGET) ; \
|
|
630 fi ; \
|
|
631 fi ; \
|
|
632 fi
|
2644
|
633 if test ! -f dump-size; then \
|
2015
|
634 $(LIB_SRC)/insert-data-in-exec -s $(DUMP_TARGET).dmp > dump-size ; \
|
|
635 $(RM) dump-data.o $(DUMP_TARGET) $(DUMP_TARGET).dmp $(RAW_EXE);\
|
2427
|
636 $(MAKE) $(RECURSIVE_MAKE_ARGS) $@; \
|
2015
|
637 fi
|
|
638 #endif
|
1346
|
639
|
|
640 ## (6) Update the remaining .elc's, post-dumping
|
|
641
|
|
642 .PHONY: update-elc-2
|
|
643 update-elc-2: $(DUMP_TARGET)
|
|
644 $(XEMACS_BATCH) -no-autoloads -l update-elc-2.el -f batch-update-elc-2 $(LISP)
|
|
645
|
|
646 ## (7) Other random stuff
|
1315
|
647
|
1346
|
648 $(LISP)/finder-inf.el: update-elc-2
|
|
649 @echo "Building finder database ..."
|
2027
|
650 $(RM) $(LISP)/finder-inf.el
|
1346
|
651 $(XEMACS_BATCH) -eval "(setq finder-compile-keywords-quiet t)" \
|
3986
|
652 -eval "(setq lisp-directory \"$(LISP)\")" \
|
1346
|
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
|