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.
|
1315
|
6 ## Copyright (C) 2001, 2002, 2003 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
|
|
36 RECURSIVE_MAKE=$(MAKE)
|
|
37 #else
|
|
38 @SET_MAKE@
|
|
39 RECURSIVE_MAKE=@RECURSIVE_MAKE@
|
|
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
|
|
199 #ifdef HAVE_CANNA
|
|
200 mule_canna_objs=mule-canna.o
|
|
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
|
428
|
254 ## lastfile must follow all files whose initialized data areas should
|
|
255 ## be dumped as pure by dump-emacs.
|
|
256
|
|
257 ## NOTE: The last line cannot be all macros, because make will barf
|
|
258 ## if they all come out null.
|
|
259
|
|
260 objs=\
|
851
|
261 abbrev.o alloc.o alloca.o \
|
|
262 $(balloon_help_objs) blocktype.o buffer.o bytecode.o \
|
853
|
263 callint.o casefiddle.o casetab.o chartab.o \
|
851
|
264 $(clash_detection_objs) cmdloop.o cmds.o $(coding_system_objs) console.o \
|
|
265 console-stream.o\
|
771
|
266 data.o $(database_objs) $(debug_objs) device.o dired.o doc.o doprnt.o\
|
851
|
267 dynarr.o \
|
1750
|
268 editfns.o elhash.o emacs.o emodules.o eval.o events.o\
|
771
|
269 event-stream.o $(event_unixoid_objs) $(extra_objs) extents.o\
|
|
270 faces.o file-coding.o fileio.o $(LOCK_OBJ) filemode.o floatfns.o fns.o \
|
|
271 font-lock.o frame.o\
|
|
272 general.o $(gif_objs) glyphs.o glyphs-eimage.o glyphs-shared.o\
|
793
|
273 glyphs-widget.o $(gpm_objs) $(gtk_objs) $(gtk_gui_objs) $(gui_objs) \
|
|
274 gutter.o\
|
771
|
275 hash.o imgproc.o indent.o insdel.o intl.o\
|
|
276 keymap.o $(RTC_patch_objs) line-number.o $(ldap_objs) lread.o lstream.o\
|
|
277 macros.o marker.o md5.o minibuf.o $(mswindows_objs) $(mswindows_gui_objs)\
|
1983
|
278 $(mule_objs) $(mule_canna_objs) $(mule_wnn_objs) $(number_objs) objects.o\
|
|
279 opaque.o $(postgresql_objs) print.o process.o $(process_objs) $(profile_objs)\
|
771
|
280 rangetab.o realpath.o redisplay.o redisplay-output.o regex.o\
|
|
281 search.o select.o $(sheap_objs) $(shlib_objs) signal.o sound.o\
|
|
282 specifier.o strftime.o $(sunpro_objs) symbols.o syntax.o sysdep.o\
|
|
283 text.o $(tooltalk_objs) $(tty_objs) undo.o unicode.o $(x_objs) $(x_gui_objs)\
|
|
284 widget.o window.o $(win32_objs)
|
428
|
285
|
|
286 obj_rtl = $(objs:.o=.c.rtl)
|
|
287
|
|
288 #ifdef REL_ALLOC
|
|
289 rallocdocsrc = ralloc.c
|
|
290 rallocobjs = ralloc.o
|
|
291 #endif
|
|
292
|
|
293 malloclib = $(libmcheck)
|
|
294 #ifndef SYSTEM_MALLOC
|
|
295 # ifdef GNU_MALLOC /* GNU malloc */
|
|
296 # ifdef ERROR_CHECK_MALLOC
|
|
297 #ifdef DOUG_LEA_MALLOC
|
|
298 mallocobjs = free-hook.o vm-limit.o
|
|
299 #else
|
|
300 mallocobjs = gmalloc.o free-hook.o vm-limit.o
|
|
301 #endif
|
|
302 mallocdocsrc = free-hook.c
|
|
303 # else /* New GNU malloc, sans error checking */
|
|
304 #ifdef DOUG_LEA_MALLOC
|
|
305 mallocobjs = vm-limit.o
|
|
306 #else
|
|
307 mallocobjs = gmalloc.o vm-limit.o
|
|
308 #endif
|
|
309 mallocdocsrc =
|
|
310 # endif /* ERROR_CHECK_MALLOC */
|
|
311 # else /* Older GNU malloc */
|
|
312 mallocobjs = malloc.o
|
|
313 mallocdocsrc =
|
|
314 # endif /* Older GNU malloc */
|
|
315 #else /* SYSTEM_MALLOC */
|
|
316 mallocobjs =
|
|
317 mallocdocsrc =
|
|
318 #ifdef USE_DEBUG_MALLOC
|
|
319 malloclib = -ldmalloc
|
|
320 #endif /* USE_DEBUG_MALLOC */
|
|
321 #endif /* SYSTEM_MALLOC */
|
|
322
|
|
323 #ifdef HAVE_X_WINDOWS
|
|
324
|
1330
|
325 lwlib_lib = ../lwlib/liblw.a
|
|
326
|
428
|
327 # ifdef EXTERNAL_WIDGET
|
|
328 external_widget_objs = ExternalShell.o extw-Xt-nonshared.o extw-Xlib-nonshared.o
|
|
329
|
|
330 # ifdef LWLIB_USES_MOTIF
|
|
331 # ifdef EXTW_LINK
|
|
332 motif_other_files = libextcli_Xm.a libextcli_Xm.so.1
|
|
333 # else
|
|
334 motif_other_files = libextcli_Xm.a
|
|
335 # endif
|
|
336 #endif /* LWLIB_USES_MOTIF */
|
|
337
|
|
338 # ifdef EXTW_LINK
|
|
339 shared_other_files = libextcli_Xt.so.1 libextcli_Xlib.so.1
|
|
340 # endif
|
|
341 other_files=\
|
1330
|
342 $(motif_other_files)\
|
428
|
343 libextcli_Xt.a libextcli_Xlib.a\
|
1330
|
344 $(shared_other_files)
|
428
|
345
|
|
346 # endif /* EXTERNAL_WIDGET */
|
|
347
|
|
348 # if defined (HAVE_OFFIX_DND) || defined (HAVE_CDE)
|
|
349 dnd_objs = @dnd_objs@
|
|
350 # endif /* HAVE_OFFIX_DND || HAVE_CDE */
|
|
351
|
|
352 X11_objs = EmacsFrame.o EmacsShell.o TopLevelEmacsShell.o TransientEmacsShell.o EmacsManager.o $(external_widget_objs) $(dnd_objs)
|
|
353 #endif /* HAVE_X_WINDOWS */
|
|
354
|
|
355 ## define otherobjs as list of object files that make-docfile
|
|
356 ## should not be told about.
|
1632
|
357 otherobjs = lastfile.o $(mallocobjs) $(rallocobjs) $(X11_objs) $(export_lib)
|
428
|
358 otherrtls = $(otherobjs:.o=.c.rtl)
|
|
359 othersrcs = $(otherobjs:.o=.c)
|
|
360
|
1330
|
361 LIBES = $(lwlib_lib) $(malloclib) $(ld_libs_all) $(lib_gcc)
|
428
|
362
|
|
363 #ifdef I18N3
|
1330
|
364 mo_file = $(LIB_SRC)/emacs.mo
|
428
|
365 #endif
|
|
366
|
1315
|
367 #########################################################################
|
1330
|
368 ## Implicit rules ##
|
|
369 #########################################################################
|
1315
|
370
|
1330
|
371 ## For performance and consistency, no built-in rules.
|
|
372 .SUFFIXES:
|
|
373 .SUFFIXES: .c .h .o .i .s .dep
|
|
374
|
|
375 ## -Demacs is needed to make some files produce the correct version
|
|
376 ## for use in Emacs.
|
|
377
|
|
378 cppflags = $(CPPFLAGS) -Demacs -I. $(c_switch_all)
|
|
379 cflags = $(CFLAGS) $(cppflags)
|
|
380 #if defined (WIN32_NATIVE) || defined (CYGWIN)
|
|
381 ldflags = $(LDFLAGS) -mwindows -e _mainCRTStartup $(ld_switch_all) $(ld_dynamic_link_flags)
|
|
382 # if defined (CYGWIN)
|
|
383 ldflags += -Wl,--script=s/cygwin.sc
|
|
384 # endif
|
|
385 #else
|
|
386 ldflags = $(LDFLAGS) $(ld_switch_all) $(ld_dynamic_link_flags)
|
|
387 #endif
|
|
388
|
|
389 #ifdef SOLARIS2
|
|
390 %.o : %.c
|
|
391 #else
|
|
392 .c.o:
|
|
393 #endif
|
|
394 $(CC) -c $(cflags) $<
|
1315
|
395
|
1330
|
396 ## Create preprocessor output (debugging purposes only)
|
|
397 .c.i:
|
|
398 #ifdef __GNUC__
|
|
399 $(CC) -E $(cppflags) -o $@ $<
|
|
400 #else /* works on Solaris; what about other systems? */
|
|
401 $(CC) -P $(cppflags) $<
|
|
402 #endif /* compiler */
|
|
403
|
|
404 ## Create assembler output (debugging purposes only)
|
|
405 .c.s:
|
|
406 $(CC) -S -c $(cflags) $<
|
|
407
|
|
408 ## Create RTL files
|
|
409 %.c.rtl : %.c
|
|
410 $(CC) -dr -c $(cflags) $<
|
|
411
|
|
412 #########################################################################
|
|
413 ## Primary rebuilding process ##
|
|
414 #########################################################################
|
|
415
|
|
416 #ifdef PDUMP
|
|
417 DUMP_TARGET = $(PROGNAME).dmp
|
|
418 RAW_EXE = $(PROGNAME)
|
|
419 DUMP_ID = dump-id.o
|
|
420 #else
|
|
421 DUMP_TARGET = $(PROGNAME)
|
|
422 RAW_EXE = temacs
|
|
423 #endif
|
|
424
|
|
425 DO_TEMACS = $(DUMPENV) ./$(RAW_EXE)
|
|
426 DO_XEMACS = ./$(PROGNAME)
|
1315
|
427
|
|
428 BATCH = -no-packages -batch
|
|
429 BATCH_PACKAGES = -vanilla -batch
|
|
430 TEMACS_BATCH = $(DO_TEMACS) -nd $(BATCH)
|
|
431 XEMACS_BATCH = $(DO_XEMACS) $(BATCH)
|
|
432 XEMACS_BATCH_PACKAGES = $(DO_XEMACS) $(BATCH_PACKAGES)
|
|
433 temacs_loadup_args = -l $(LISP)/loadup.el
|
|
434 dump_temacs_args = $(temacs_loadup_args) dump
|
|
435 run_temacs_args = $(temacs_loadup_args) run-temacs
|
|
436 dump_temacs = $(TEMACS_BATCH) $(dump_temacs_args)
|
|
437
|
|
438 ## Compile, dump, and make sure all .elc files are up-to-date.
|
|
439
|
1330
|
440 ## NOTE NOTE NOTE: There appears to be a fundamental but non-obvious
|
|
441 ## difference between the way that standard `make', GNU Make, and `nmake'
|
|
442 ## handle dependencies, and this means we have to write the dependencies in
|
|
443 ## Makefile.in.in and xemacs.mak differently. To illustrate this, consider
|
|
444 ## the following first:
|
|
445
|
|
446 ##.PHONY: all (`make' only)
|
|
447 ## all: test.exe
|
|
448 ##
|
|
449 ##.PHONY: FRC.test.c (`make' only)
|
|
450 ##FRC.test.c:
|
|
451 ##
|
|
452 ##test.c: FRC.test.c
|
|
453 ## if test ! -f foo ; then touch test.c; fi (`make' only)
|
|
454 ## if not exist foo touch test.c (`nmake' only)
|
|
455 ##
|
|
456 ##test.obj: test.c
|
|
457 ## touch test.obj
|
|
458 ##
|
|
459 ##test.exe: test.obj
|
|
460 ## touch test.exe
|
|
461
|
|
462 ## (GNU Make doesn't need the .PHONY declarations, but evidently some versions
|
|
463 ## of `make' do. nmake doesn't need them and doesn't allow them, either.)
|
|
464
|
|
465 ## Running `make' rebuilds test.exe only if `foo' doesn't exist.
|
|
466 ## Running `nmake -f Makefile' rebuilds it regardless.
|
|
467
|
|
468 ## Both conclude that test.c needs to be rebuilt since its dependent is
|
|
469 ## non-existent. But `make' recalculates its dependencies after running
|
|
470 ## the commands for test.c, and notices that test.c hasn't changed, and
|
|
471 ## thus test.obj and test.exe are up-to-date. `nmake' doesn't.
|
|
472
|
|
473 ## On the other hand, consider the following:
|
428
|
474
|
1330
|
475 ##.PHONY: all (`make' only)
|
|
476 ##all: check-foo test.exe
|
|
477 ##
|
|
478 ##.PHONY: check-foo (`make' only)
|
|
479 ##check-foo:
|
|
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.c:
|
|
484 ## touch test.c
|
|
485 ##
|
|
486 ##test.obj: test.c
|
|
487 ## touch test.obj
|
|
488 ##
|
|
489 ##test.exe: test.c test.obj
|
|
490 ## touch test.exe
|
|
491 ##
|
1315
|
492
|
1330
|
493 ## Running `nmake -f Makefile' (and `GNU make') rebuilds test.exe only if
|
|
494 ## `foo' doesn't exist.
|
|
495 ## Running some versions of non-GNU `make' does nothing at all once test.c,
|
|
496 ## test.obj and test.exe all exist.
|
|
497
|
|
498 ## It appears that `nmake' doesn't check dependencies for test.exe until it
|
|
499 ## actually needs to be rebuilt, so this "sideways" dependency script
|
|
500 ## works. GNU make evidently recalculates *all* dependencies after each
|
|
501 ## command so has no problem, either. But some makes apparently calculate
|
|
502 ## all dependencies at startup and then, after executing a command to build
|
|
503 ## a dependency, only recheck relationships involving that particular
|
|
504 ## dependency.
|
|
505
|
|
506 ## In XEmacs-land, the above situation exists wrt the `NEEDTODUMP'
|
|
507 ## dependency, recalculated by `update-elc.el'. Thus, Makefile.in.in must
|
|
508 ## use the method #1 above, and nmake must use method #2.
|
|
509
|
|
510 ## -ben
|
|
511
|
|
512 .PHONY: build-the-mofo
|
1346
|
513 build-the-mofo: update-elc-2 $(mo_file) $(other_files) $(LISP)/finder-inf.el load-shadows
|
1315
|
514
|
1346
|
515 ## (1) Compile all dependencies of the XEmacs executable
|
428
|
516
|
1330
|
517 #ifdef HAVE_X_WINDOWS
|
|
518 lwlib_deps = $(lwlib_lib)
|
|
519 $(lwlib_lib):
|
|
520 cd ../lwlib && $(RECURSIVE_MAKE)
|
|
521 #endif /* HAVE_X_WINDOWS */
|
|
522
|
428
|
523 #ifdef DYNODUMP
|
|
524 dynodump_deps = ../dynodump/dynodump.so
|
|
525 ../dynodump/dynodump.so:
|
|
526 cd ../dynodump && $(RECURSIVE_MAKE)
|
|
527 #endif /* DYNODUMP */
|
|
528
|
1330
|
529 link_deps = $(start_files) $(objs) $(otherobjs) $(lwlib_deps) $(dynodump_deps)
|
1315
|
530
|
1346
|
531 $(LIB_SRC)/make-dump-id:
|
|
532 cd $(LIB_SRC) && $(RECURSIVE_MAKE) make-dump-id
|
|
533
|
|
534 dump-id.c: $(LIB_SRC)/make-dump-id $(link_deps)
|
|
535 $(LIB_SRC)/make-dump-id
|
|
536
|
|
537 ## (2) Link the XEmacs executable
|
|
538
|
1330
|
539 temacs_deps = $(link_deps) $(DUMP_ID)
|
1315
|
540
|
|
541 temacs_link_args = \
|
1330
|
542 $(start_flags) $(ldflags) \
|
|
543 -o $@ $(start_files) $(objs) $(otherobjs) $(DUMP_ID) $(LIBES)
|
1315
|
544
|
1330
|
545 $(RAW_EXE): $(temacs_deps)
|
1315
|
546 $(LD) $(temacs_link_args)
|
|
547
|
1346
|
548 ## (3) Update the .elc's needed for dumping
|
|
549
|
|
550 .PHONY: FRC.needtodump
|
|
551 FRC.needtodump:
|
|
552
|
|
553 ## This file is touched by update-elc.el when redumping is necessary.
|
|
554 ## We use $(BLDSRC) == `.' here to help keep sync with nt/xemacs.mak,
|
|
555 ## where $(BLDSRC) is not `.'.
|
1406
|
556 $(BLDSRC)/NEEDTODUMP: $(RAW_EXE) FRC.needtodump
|
1346
|
557 $(TEMACS_BATCH) -l $(LISP)/update-elc.el
|
|
558
|
|
559 ## (4) Build the DOC file
|
1315
|
560
|
|
561 obj_src = $(objs:.o=.c)
|
|
562
|
1346
|
563 $(LIB_SRC)/make-docfile:
|
|
564 cd $(LIB_SRC) && $(RECURSIVE_MAKE) make-docfile
|
|
565
|
1330
|
566 $(LIB_SRC)/DOC: $(LIB_SRC)/make-docfile $(BLDSRC)/NEEDTODUMP $(temacs_deps)
|
1303
|
567 #ifdef QUICK_BUILD
|
|
568 if test ! -f $@ ; then \
|
|
569 #else
|
|
570 if true ; then \
|
|
571 #endif
|
1315
|
572 $(TEMACS_BATCH) -l $(LISP)/make-docfile.el -- \
|
1330
|
573 -o $(LIB_SRC)/DOC -d $(SRC) -i $(LIB_SRC)/../site-packages \
|
|
574 $(obj_src) $(mallocdocsrc) $(rallocdocsrc) \
|
|
575 $(extra_doc_files) ; fi
|
428
|
576
|
1346
|
577 ## (5) Dump
|
|
578
|
|
579 $(DUMP_TARGET): $(RAW_EXE) $(BLDSRC)/NEEDTODUMP $(LIB_SRC)/DOC
|
|
580 #ifdef HEAP_IN_DATA
|
|
581 @$(RM) $@ && touch SATISFIED
|
|
582 $(dump_temacs)
|
|
583 @if test -f SATISFIED; then $(RM) SATISFIED; else $(RM) $@; \
|
|
584 $(RECURSIVE_MAKE) $@; fi
|
|
585 #else
|
|
586 @$(RM) $@
|
|
587 $(dump_temacs)
|
|
588 #endif
|
|
589
|
|
590 ## (6) Update the remaining .elc's, post-dumping
|
|
591
|
|
592 .PHONY: update-elc-2
|
|
593 update-elc-2: $(DUMP_TARGET)
|
|
594 $(XEMACS_BATCH) -no-autoloads -l update-elc-2.el -f batch-update-elc-2 $(LISP)
|
|
595
|
|
596 ## (7) Other random stuff
|
1315
|
597
|
1346
|
598 $(LISP)/finder-inf.el: update-elc-2
|
|
599 @echo "Building finder database ..."
|
|
600 $(XEMACS_BATCH) -eval "(setq finder-compile-keywords-quiet t)" \
|
|
601 -l finder -f finder-compile-keywords
|
|
602 @echo "Building finder database ...(done)"
|
|
603
|
|
604 .PHONY: load-shadows
|
|
605 load-shadows: update-elc-2
|
|
606 #ifndef QUICK_BUILD
|
|
607 @echo "Testing for Lisp shadows ..."
|
|
608 @$(XEMACS_BATCH) -f list-load-path-shadows
|
|
609 #endif
|
|
610
|
|
611 ###################### Misc targets
|
|
612
|
|
613 release: all
|
|
614 -if [ -w $(LISP) ]; then \
|
|
615 w=`pwd`; cd $(SRC) && $$w/$(RAW_EXE) -nd $(BATCH) -l $(LISP)/inc-vers; \
|
|
616 else true; fi
|
|
617 -$(dump_temacs)
|
|
618 touch release
|
428
|
619
|
1315
|
620 .PHONY: fastdump
|
1330
|
621 fastdump: $(RAW_EXE)
|
|
622 @$(RM) $(DUMP_TARGET) && touch SATISFIED
|
|
623 -$(dump_temacs)
|
1315
|
624 @$(XEMACS_BATCH) -f list-load-path-shadows
|
428
|
625
|
1315
|
626 .PHONY: all-elc
|
|
627 all-elc:
|
|
628 cd .. && $(RECURSIVE_MAKE)
|
|
629
|
|
630 #########################################################################
|
1330
|
631 ## Subsidiary dependency rules ##
|
|
632 #########################################################################
|
428
|
633
|
|
634 #ifdef I18N3
|
|
635
|
|
636 # if defined(SPARC) && !defined(USG)
|
|
637 xgettext= /usr/openwin/bin/xgettext
|
|
638 xgettext_args= -o emacs -m_X messages
|
|
639 msgfmt= /usr/openwin/bin/msgfmt
|
|
640 # else
|
|
641 xgettext= xgettext
|
|
642 xgettext_args= -s -d emacs -M_X messages
|
|
643 msgfmt= msgfmt
|
|
644 #endif
|
|
645
|
1330
|
646 $(LIB_SRC)/emacs.po: $(LIB_SRC)/make-msgfile $(LIB_SRC)/make-po $(objs)
|
|
647 $(LIB_SRC)/make-msgfile -o $(LIB_SRC)/messages $(objs)
|
|
648 cd $(LIB_SRC) && $(xgettext) $(xgettext_args)
|
|
649 $(RM) $(LIB_SRC)/emacs.po
|
|
650 cd $(LIB_SRC) && $(LIB_SRC)/make-po -a $(LIB_SRC)/emacs.po DOC
|
428
|
651
|
1330
|
652 $(LIB_SRC)/emacs.mo: $(LIB_SRC)/emacs.po
|
|
653 cd $(LIB_SRC)/ && $(msgfmt) -o emacs.mo emacs.po
|
428
|
654
|
1330
|
655 $(LIB_SRC)/make-msgfile:
|
|
656 cd $(LIB_SRC) && $(RECURSIVE_MAKE) make-msgfile
|
428
|
657
|
1330
|
658 $(LIB_SRC)/make-po:
|
|
659 cd $(LIB_SRC) && $(RECURSIVE_MAKE) make-po
|
428
|
660
|
|
661 #endif /* I18N3 */
|
|
662
|
1330
|
663 TopLevelEmacsShell.o : $(SRC)/EmacsShell-sub.c config.h xintrinsicp.h EmacsShellP.h
|
|
664 $(CC) -c $(cflags) -DDEFINE_TOP_LEVEL_EMACS_SHELL $(SRC)/EmacsShell-sub.c
|
428
|
665 mv EmacsShell-sub.o TopLevelEmacsShell.o
|
|
666
|
1330
|
667 TopLevelEmacsShell.c.rtl : $(SRC)/EmacsShell-sub.c config.h xintrinsicp.h EmacsShellP.h
|
|
668 $(CC) -dr -c $(cflags) -DDEFINE_TOP_LEVEL_EMACS_SHELL $(SRC)/EmacsShell-sub.c
|
428
|
669 mv EmacsShell-sub.c.rtl TopLevelEmacsShell.c.rtl
|
|
670
|
1330
|
671 TransientEmacsShell.o : $(SRC)/EmacsShell-sub.c TopLevelEmacsShell.o config.h xintrinsicp.h EmacsShellP.h
|
|
672 $(CC) -c $(cflags) -DDEFINE_TRANSIENT_EMACS_SHELL $(SRC)/EmacsShell-sub.c
|
428
|
673 mv EmacsShell-sub.o TransientEmacsShell.o
|
|
674
|
1330
|
675 TransientEmacsShell.c.rtl : $(SRC)/EmacsShell-sub.c TopLevelEmacsShell.o config.h xintrinsicp.h EmacsShellP.h
|
|
676 $(CC) -dr -c $(cflags) -DDEFINE_TRANSIENT_EMACS_SHELL $(SRC)/EmacsShell-sub.c
|
428
|
677 mv EmacsShell-sub.c.rtl TransientEmacsShell.c.rtl
|
|
678
|
442
|
679 ## The above rules are subject to a race condition if using a parallel make.
|
|
680 TransientEmacsShell.o : TopLevelEmacsShell.o
|
|
681 TransientEmacsShell.c.rtl : TopLevelEmacsShell.c.rtl
|
|
682
|
428
|
683 ## Position-independent code for shared library creation
|
|
684 #if USE_GCC
|
|
685 pic_arg = -fpic
|
|
686 #elif defined (IRIX)
|
|
687 pic_arg = -KPIC
|
|
688 # else
|
|
689 pic_arg = -K pic
|
|
690 #endif
|
|
691
|
|
692 #ifdef EXTERNAL_WIDGET
|
|
693
|
|
694 external_client_motif_objs_shared = ExternalClient-Xm-shared.o extw-Xt-shared.o extw-Xlib-shared.o
|
|
695 external_client_xt_objs_shared = ExternalClient-Xt-shared.o extw-Xt-shared.o extw-Xlib-shared.o
|
|
696 external_client_xlib_objs_shared = ExternalClient-Xlib-shared.o extw-Xlib-shared.o
|
|
697 external_client_motif_objs_nonshared = ExternalClient-Xm-nonshared.o extw-Xt-nonshared.o extw-Xlib-nonshared.o
|
|
698 external_client_xt_objs_nonshared = ExternalClient-Xt-nonshared.o extw-Xt-nonshared.o extw-Xlib-nonshared.o
|
|
699 external_client_xlib_objs_nonshared = ExternalClient-Xlib-nonshared.o extw-Xlib-nonshared.o
|
|
700
|
|
701 ## Add dependencies so things work right with a parallel make
|
1330
|
702 ExternalClient-Xm-shared.o: $(SRC)/ExternalClient.c ExternalClient-Xt-shared.o ExternalClient-Xm-nonshared.o
|
|
703 $(CC) -c $(pic_arg) $(cflags) -DEXTW_USES_MOTIF $(SRC)/ExternalClient.c
|
428
|
704 mv ExternalClient.o ExternalClient-Xm-shared.o
|
|
705
|
1330
|
706 ExternalClient-Xt-shared.o: $(SRC)/ExternalClient.c ExternalClient-Xt-nonshared.o
|
|
707 $(CC) -c $(pic_arg) $(cflags) $(SRC)/ExternalClient.c
|
428
|
708 mv ExternalClient.o ExternalClient-Xt-shared.o
|
|
709
|
1330
|
710 ExternalClient-Xlib-shared.o: $(SRC)/ExternalClient-Xlib.c ExternalClient-Xlib-nonshared.o
|
|
711 $(CC) -c $(pic_arg) $(cflags) $(SRC)/ExternalClient-Xlib.c
|
428
|
712 mv ExternalClient-Xlib.o ExternalClient-Xlib-shared.o
|
|
713
|
1330
|
714 ExternalClient-Xm-nonshared.o: $(SRC)/ExternalClient.c ExternalClient-Xt-nonshared.o
|
|
715 $(CC) -c $(cflags) -DEXTW_USES_MOTIF $(SRC)/ExternalClient.c
|
428
|
716 mv ExternalClient.o ExternalClient-Xm-nonshared.o
|
|
717
|
1330
|
718 ExternalClient-Xt-nonshared.o: $(SRC)/ExternalClient.c
|
|
719 $(CC) -c $(cflags) $(SRC)/ExternalClient.c
|
428
|
720 mv ExternalClient.o ExternalClient-Xt-nonshared.o
|
|
721
|
1330
|
722 ExternalClient-Xlib-nonshared.o: $(SRC)/ExternalClient-Xlib.c
|
|
723 $(CC) -c $(cflags) $(SRC)/ExternalClient-Xlib.c
|
428
|
724 mv ExternalClient-Xlib.o ExternalClient-Xlib-nonshared.o
|
|
725
|
|
726 ## We compile the common files twice (once with PIC and once without)
|
|
727 ## because on some systems, compiling with PIC but not linking into
|
|
728 ## a shared library messes things up.
|
|
729
|
1330
|
730 extw-Xt-shared.o: $(SRC)/extw-Xt.c extw-Xt-nonshared.o
|
|
731 $(CC) -c $(pic_arg) $(cflags) $(SRC)/extw-Xt.c
|
428
|
732 mv extw-Xt.o extw-Xt-shared.o
|
|
733
|
1330
|
734 extw-Xlib-shared.o: $(SRC)/extw-Xlib.c extw-Xlib-nonshared.o
|
|
735 $(CC) -c $(pic_arg) $(cflags) $(SRC)/extw-Xlib.c
|
428
|
736 mv extw-Xlib.o extw-Xlib-shared.o
|
|
737
|
1330
|
738 extw-Xt-nonshared.o: $(SRC)/extw-Xt.c
|
|
739 $(CC) -c $(cflags) $(SRC)/extw-Xt.c
|
428
|
740 mv extw-Xt.o extw-Xt-nonshared.o
|
|
741
|
1330
|
742 extw-Xlib-nonshared.o: $(SRC)/extw-Xlib.c
|
|
743 $(CC) -c $(cflags) $(SRC)/extw-Xlib.c
|
428
|
744 mv extw-Xlib.o extw-Xlib-nonshared.o
|
|
745
|
1330
|
746 libextcli_Xm.a: $(external_client_motif_objs_nonshared)
|
|
747 ar r libextcli_Xm.a $(external_client_motif_objs_nonshared)
|
428
|
748
|
1330
|
749 libextcli_Xt.a: $(external_client_xt_objs_nonshared)
|
|
750 ar r libextcli_Xt.a $(external_client_xt_objs_nonshared)
|
428
|
751
|
1330
|
752 libextcli_Xlib.a: $(external_client_xlib_objs_nonshared)
|
|
753 ar r libextcli_Xlib.a $(external_client_xlib_objs_nonshared)
|
428
|
754
|
1315
|
755 ## Now we try to figure out how to link a shared library.
|
|
756 ## If we cannot figure it out, leave EXTW_LINK undefined and a shared
|
|
757 ## library will not be created.
|
|
758
|
|
759 # ifdef USE_GCC
|
|
760 # ifdef USG5
|
|
761 # define EXTW_LINK(objs, output) $(CC) -shared objs -Xlinker -z -Xlinker text -o output
|
|
762 extw_link_beg = $(CC) -shared
|
|
763 extw_link_mid = -Xlinker -z -Xlinker text -o
|
|
764 extw_link_end =
|
|
765 ## I cannot figure out how to do shared a.out libraries, so just punt.
|
|
766 # elif !defined (LINUX) || defined (__ELF__)
|
|
767 # define EXTW_LINK(objs, output) $(CC) -shared objs -o output
|
|
768 extw_link_beg = $(CC) -shared
|
|
769 extw_link_mid = -o
|
|
770 extw_link_end =
|
|
771 # endif
|
|
772 # elif defined (USG5)
|
|
773 # if defined (IRIX)
|
1330
|
774 # define EXTW_LINK(objs, output) $(LD) -shared -g -check_registry $(TOOLROOT)/usr/lib/so_locations objs -o output
|
|
775 extw_link_beg = $(LD) -shared -g -check_registry $(TOOLROOT)/usr/lib/so_locations
|
1315
|
776 extw_link_mid = -o
|
|
777 extw_link_end =
|
|
778 # else /* not IRIX */
|
|
779 # define EXTW_LINK(objs, output) $(CC) -G objs -z text -o output
|
|
780 extw_link_beg = $(CC) -G
|
|
781 extw_link_mid = -z text -o
|
|
782 extw_link_end =
|
|
783 # endif /* not IRIX */
|
|
784 # else /* not USG5 */
|
|
785 # if defined (DEC_ALPHA) && defined (OSF1)
|
|
786 # define EXTW_LINK(objs, output) $(LD) $(ldflags) $(ld_switch_shared) -d objs -o output $(LIBES)
|
|
787 extw_link_beg = $(LD) $(ldflags) $(ld_switch_shared) -d
|
|
788 extw_link_mid = -o
|
|
789 extw_link_end = $(LIBES)
|
|
790 # else /* !(DEC_ALPHA && OSF1) */
|
|
791 # define EXTW_LINK(objs, output) $(LD) -dc objs -assert pure-text -o output
|
|
792 extw_link_beg = $(LD) -dc
|
|
793 extw_link_mid = -assert pure-text -o
|
|
794 extw_link_end =
|
|
795 # endif /* !(DEC_ALPHA && OSF1) */
|
|
796 # endif /* not USG5 */
|
|
797
|
428
|
798 #ifdef EXTW_LINK
|
|
799
|
1330
|
800 libextcli_Xm.so.1: $(external_client_motif_objs_shared)
|
|
801 $(extw_link_beg) $(external_client_motif_objs_shared) $(extw_link_mid) libextcli_Xm.so.1 $(extw_link_end)
|
428
|
802
|
1330
|
803 libextcli_Xt.so.1: $(external_client_xt_objs_shared)
|
|
804 $(extw_link_beg) $(external_client_xt_objs_shared) $(extw_link_mid) libextcli_Xt.so.1 $(extw_link_end)
|
428
|
805
|
1330
|
806 libextcli_Xlib.so.1: $(external_client_xlib_objs_shared)
|
|
807 $(extw_link_beg) $(external_client_xlib_objs_shared) $(extw_link_mid) libextcli_Xlib.so.1 $(extw_link_end)
|
428
|
808
|
|
809 #endif /* EXTW_LINK */
|
|
810
|
|
811 #endif /* EXTERNAL_WIDGET */
|
|
812
|
1330
|
813 config.h: $(SRC)/config.h.in
|
|
814 Emacs.ad.h: $(ETC)/Emacs.ad
|
428
|
815
|
|
816 config.h sheap-adjust.h paths.h Emacs.ad.h :
|
|
817 @echo "The file $@ needs to be re-generated."
|
|
818 @echo "Please run a make in the top level directory."
|
|
819 @echo "Consult the file \`INSTALL' for instructions for building XEmacs."
|
|
820 @exit 1
|
|
821
|
|
822 ## Some machines have alloca built-in.
|
|
823 ## They should define HAVE_ALLOCA, or may just let alloca.s
|
|
824 ## be used but generate no code.
|
|
825 ## Some have it written in assembler in alloca.s.
|
|
826 ## Some use the C version in alloca.c (these define C_ALLOCA in config.h).
|
851
|
827 ## Nowadays we always compile in the C version and use it to avoid stack
|
|
828 ## overflow.
|
428
|
829
|
|
830 #ifdef C_ALLOCA
|
|
831 #else
|
|
832 #ifndef HAVE_ALLOCA
|
1330
|
833 allocax.o : $(SRC)/alloca.s config.h
|
428
|
834 ## $(CPP) is cc -E, which may get confused by filenames
|
|
835 ## that do not end in .c. So copy file to a safe name. */
|
1330
|
836 ## cp $(SRC)/alloca.s allocatem.c
|
428
|
837 ## Remove any ^L, blank lines, and preprocessor comments,
|
|
838 ## since some assemblers barf on them. Use a different basename for the
|
|
839 ## output file, since some stupid compilers (Green Hill) use that
|
|
840 ## name for the intermediate assembler file.
|
|
841 $(CPP) $(cppflags) allocatem.c | \
|
|
842 sed -e 's///' -e 's/^#.*//' | \
|
|
843 sed -n -e '/^..*$$/p' > allocax.s
|
|
844 @$(RM) alloca.o
|
|
845 ## Xenix, in particular, needs to run assembler via cc.
|
|
846 $(CC) -c allocax.s
|
|
847 $(RM) allocax.s allocatem.c
|
|
848 #endif /* HAVE_ALLOCA */
|
|
849 #endif /* ! defined (C_ALLOCA) */
|
|
850
|
|
851 #ifdef HAVE_NATIVE_SOUND
|
442
|
852 sound_cflags=@sound_cflags@
|
1330
|
853 sunplay.o: $(SRC)/sunplay.c
|
|
854 $(CC) -c $(sound_cflags) $(cflags) $(SRC)/sunplay.c
|
|
855 hpplay.o: $(SRC)/hpplay.c
|
|
856 $(CC) -c -Demacs $(sound_cflags) $(cflags) $(SRC)/hpplay.c
|
428
|
857 #endif /* HAVE_NATIVE_SOUND */
|
|
858
|
462
|
859 #if defined(HAVE_GLADE_GLADE_H) || defined(HAVE_GLADE_H)
|
|
860 glade_files=glade.c
|
|
861 #endif
|
|
862
|
|
863 #ifdef HAVE_GTK
|
|
864 extra_doc_files=emacs-widget-accessors.c ui-byhand.c $(glade_files)
|
|
865 #endif
|
|
866
|
1330
|
867 xemacs_res.o: $(SRC)/../nt/xemacs.rc
|
|
868 windres --include-dir $(SRC)/../nt -i $(SRC)/../nt/xemacs.rc -o $@
|
442
|
869
|
1315
|
870 #########################################################################
|
1330
|
871 ## Other random crap ##
|
|
872 #########################################################################
|
1315
|
873
|
|
874 dortl : $(obj_rtl) $(otherrtls)
|
|
875 echo "(defvar source-files '(" > $(LISP)/source-files.el
|
|
876 (for a in $(obj_src) $(othersrcs);do \
|
|
877 echo -n "\""$$a"\"" >> $(LISP)/source-files.el ;\
|
|
878 done)
|
|
879 echo "))" >> $(LISP)/source-files.el
|
|
880
|
1330
|
881 ###################### Lint
|
1315
|
882 LINT.c=$(LINT) $(LINTFLAGS) $(LINTINCLUDES)
|
|
883 LINTFILES= $(objs:.o=.ln)
|
|
884 LINTINCLUDES = $(cppflags)
|
|
885 ## LINTFLAGS= -fd -m -p -s -u -v -x
|
|
886 LINTFLAGS= -fd -m -s -u -v -x
|
|
887 .PHONY: lint
|
|
888 lint: $(LINTFILES)
|
|
889 $(LINT.c) $(LINTFILES)
|
|
890
|
1330
|
891 ###################### Automated tests
|
|
892 testdir = $(SRC)/../tests/automated
|
|
893 batch_test_emacs = $(BATCH_PACKAGES) -l $(testdir)/test-harness.el -f batch-test-emacs $(testdir)
|
1315
|
894
|
|
895 .PHONY: check check-temacs check-features
|
|
896 check:
|
|
897 $(DO_XEMACS) $(batch_test_emacs)
|
|
898 check-temacs:
|
|
899 $(TEMACS_BATCH) $(run_temacs_args) $(batch_test_emacs)
|
|
900 check-features: all
|
|
901 $(XEMACS_BATCH) -l check-features.el
|
|
902
|
1330
|
903 ###################### Debugging targets
|
|
904
|
1315
|
905 ## None of the debugging products work with a dumped xemacs binary,
|
|
906 ## because it does unexpected things like free memory that has been
|
|
907 ## malloc'ed in a *different* process!! So we need to run these on
|
|
908 ## temacs.
|
|
909
|
|
910 ## RTC is Sun WorkShop's Run Time Checking, integrated with dbx
|
|
911 rtc_patch.o:
|
|
912 rtc_patch_area -o $@
|
|
913
|
|
914 rtcmacs: $(temacs_deps) rtc_patch.o
|
1330
|
915 $(RM) $(RAW_EXE); $(RECURSIVE_MAKE) $(RAW_EXE) RTC_patch_objs=rtc_patch.o
|
|
916 mv $(RAW_EXE) rtcmacs
|
1315
|
917
|
|
918 .PHONY: run-rtcmacs
|
|
919 run-rtcmacs: rtcmacs
|
|
920 dbx -q -C -c \
|
|
921 'dbxenv rtc_error_log_file_name /dev/fd/1; \
|
|
922 dbxenv suppress_startup_message 5.0; \
|
|
923 ignore POLL; \
|
|
924 check -access; \
|
|
925 suppress rui; \
|
1330
|
926 runargs -nd $(BATCH) $(run_temacs_args) -vanilla; \
|
1315
|
927 run' rtcmacs
|
|
928
|
1330
|
929 debug-temacs: $(RAW_EXE)
|
|
930 -gdb $(RAW_EXE)
|
1315
|
931
|
|
932 ## Purify, Quantify, PureCoverage are software quality products from
|
|
933 ## Rational, formerly Pure Atria, formerly Pure Software.
|
|
934 ##
|
|
935 ## Purify
|
|
936 PURIFY_PROG = purify
|
|
937 PURIFY_LIBS =
|
|
938 PURIFY_FLAGS =\
|
|
939 #ifdef PDUMP
|
|
940 -search-mmaps=yes\
|
|
941 #endif
|
|
942 -chain-length=32 -ignore-signals=SIGPOLL\
|
1330
|
943 -cache-dir=$(blddir)/purecache -always-use-cache-dir=yes
|
1315
|
944
|
|
945 puremacs: $(temacs_deps)
|
|
946 $(PURIFY_PROG) $(PURIFY_FLAGS) $(LD) $(temacs_link_args) $(PURIFY_LIBS)
|
1330
|
947 cp $@ $(RAW_EXE)
|
1315
|
948
|
|
949 ## Quantify
|
|
950 #ifdef QUANTIFY
|
|
951 QUANTIFY_PROG = quantify
|
|
952 QUANTIFY_HOME = `$(QUANTIFY_PROG) -print-home-dir`
|
|
953 QUANTIFY_FLAGS = -cache-dir=./purecache -always-use-cache-dir=yes
|
|
954 cppflags += -I$(QUANTIFY_HOME)
|
|
955 temacs_link_args += $(QUANTIFY_HOME)/quantify_stubs.a
|
|
956
|
|
957 quantmacs: $(temacs_deps)
|
|
958 $(QUANTIFY_PROG) $(QUANTIFY_FLAGS) $(LD) $(temacs_link_args)
|
1330
|
959 cp $@ $(RAW_EXE)
|
1315
|
960 #endif /* QUANTIFY */
|
|
961
|
|
962 PURECOV_PROG=purecov
|
|
963 covmacs: $(temacs_deps)
|
|
964 $(PURECOV_PROG) $(LD) $(temacs_link_args)
|
428
|
965
|
1330
|
966 ###################### Clean
|
|
967
|
428
|
968 .PHONY: mostlyclean clean distclean realclean versionclean extraclean
|
|
969 mostlyclean:
|
1330
|
970 $(RM) *.o *.i *.rtl *.ln core \
|
|
971 temacs puremacs quantmacs covmacs rtcmacs temacs.exe \
|
|
972 sheap-adjust.h dump-id.c $(BLDSRC)/NEEDTODUMP SATISFIED \
|
|
973 $(LIB_SRC)/*.po $(LIB_SRC)/*.mo
|
|
974 versionclean:
|
|
975 $(RM) $(RAW_EXE) $(DUMP_TARGET) $(LIB_SRC)/DOC
|
|
976 ## Remove the generated load files here; they cause lots of problems
|
|
977 ## when they don't work right.
|
428
|
978 clean: mostlyclean versionclean
|
1330
|
979 $(RM) libextcli* $(LISP)/auto-autoloads.el* $(LISP)/custom-load.el* \
|
|
980 $(LISP)/mule/auto-autoloads.el* $(LISP)/mule/custom-load.el* \
|
|
981 $(SRCMODULES)/auto-autoloads.el* $(SRCMODULES)/custom-load.el*
|
428
|
982 ## This is used in making a distribution.
|
|
983 ## Do not use it on development directories!
|
|
984 distclean: clean
|
1330
|
985 $(RM) config.h paths.h Emacs.ad.h $(LISP)/finder-inf.el* \
|
1727
|
986 GNUmakefile Makefile Makefile.in TAGS $(DUMP_TARGET) $(RAW_EXE) \
|
|
987 xemacs.def xemacs.def.in
|
428
|
988 realclean: distclean
|
|
989 extraclean: realclean
|
|
990 $(RM) *~ \#* m/*~ m/\#* s/*~ s/\#*
|
|
991
|
1330
|
992 ###################### Lock, unlock
|
|
993
|
428
|
994 .PHONY : lock unlock
|
|
995 SOURCES = *.[chm] *.pswm [sm]/* COPYING paths.h.in Makefile.in.in \
|
|
996 config.h.in README COPYING ChangeLog
|
|
997 unlock:
|
|
998 chmod u+w $(SOURCES)
|
|
999
|
|
1000 relock:
|
|
1001 chmod -w $(SOURCES)
|
|
1002
|
1330
|
1003 ###################### Installation
|
|
1004
|
428
|
1005 ## Header files for ellcc
|
|
1006 #ifdef HAVE_SHLIB
|
|
1007 MAKEPATH=../lib-src/make-path
|
1330
|
1008 install: $(PROGNAME)
|
|
1009 $(MAKEPATH) $(archlibdir)/include $(archlibdir)/include/m $(archlibdir)/include/s
|
428
|
1010 -@echo "Copying include files for ellcc..."
|
|
1011 -@hdir=`pwd`; \
|
1330
|
1012 cd $(SRC); hdrdir2=`pwd`; cd $$hdir; \
|
428
|
1013 test "$$hdrdir2" != "$$hdir" && hdir="$$hdir $$hdrdir2"; \
|
|
1014 (for thisdir in $$hdir; do \
|
448
|
1015 cd $$thisdir && \
|
428
|
1016 (hdrtars=; \
|
|
1017 for hdrfile in *.h; do \
|
|
1018 hdrtars="$$hdrtars $$hdrfile"; \
|
|
1019 done; \
|
|
1020 test -d s && hdrtars="$$hdrtars s/*"; \
|
|
1021 test -d m && hdrtars="$$hdrtars m/*"; \
|
|
1022 test -n "$$hdrtars" && (tar cf - $$hdrtars) | \
|
1330
|
1023 (cd $(archlibdir)/include && umask 022 && tar xf -); \
|
|
1024 chmod 755 $(archlibdir)/include; \
|
|
1025 test -d $(archlibdir)/include/s && \
|
|
1026 chmod 755 $(archlibdir)/include/s; \
|
|
1027 test -d $(archlibdir)/include/m && \
|
|
1028 chmod 755 $(archlibdir)/include/s;) \
|
428
|
1029 done)
|
|
1030 #endif
|
|
1031
|
1330
|
1032 ###################### Dependencies
|
|
1033
|
428
|
1034 ## Dependency processing using home-grown script, not makedepend
|
|
1035 .PHONY: depend
|
|
1036 FRC.depend:
|
|
1037 depend: FRC.depend
|
1330
|
1038 cd $(SRC) && $(RM) depend.tmp && \
|
428
|
1039 perl ./make-src-depend > depend.tmp && \
|
|
1040 if cmp -s depend depend.tmp; \
|
|
1041 then $(RM) depend.tmp; \
|
|
1042 else $(RM) depend && mv depend.tmp depend; \
|
|
1043 fi
|
1330
|
1044
|
|
1045 ###################### Unicode encapsulation
|
|
1046
|
|
1047 .PHONY: unicode-encapsulate
|
|
1048 FRC.unicode-encapsulate:
|
|
1049 unicode-encapsulate: FRC.unicode-encapsulate
|
|
1050 cd $(SRC) && \
|
|
1051 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
|