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