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