1 # Makefile for lib-src subdirectory in GNU Emacs.
2 # Copyright (C) 1985, 1987, 1988, 1993, 1994, 2004 Free Software Foundation, Inc.
4 # This file is part of GNU Emacs.
6 # GNU Emacs is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2, or (at your option)
11 # GNU Emacs is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with GNU Emacs; see the file COPYING. If not, write to
18 # the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
20 # Avoid trouble on systems where the `SHELL' variable might be
21 # inherited from the environment.
24 # ==================== Things `configure' will edit ====================
33 version_us=@version_us@
34 configuration=@configuration@
35 sys_includes=@sys_includes@
37 # On Xenix and the IBM RS6000, double-dot gets screwed up.
39 # With DEC C 5 and up, dot-star gets screwed up.
43 # ==================== Where To Install Things ====================
45 # The default location for installation. Everything is placed in
46 # subdirectories of this directory. The default values for many of
47 # the variables below are expressed in terms of this one, so you may
48 # not need to change them. This is set with the --prefix option to
52 # Like `prefix', but used for architecture-specific files. This is
53 # set with the --exec-prefix option to `../configure'.
54 exec_prefix=@exec_prefix@
56 # Where to install Emacs and other binaries that people will want to
57 # run directly (like etags). This is set with the --bindir option
61 # Where to install and expect executable files to be run by Emacs
62 # rather than directly by users, and other architecture-dependent
63 # data. ${archlibdir} is usually below this. This is set with the
64 # --libdir option to `../configure'.
67 # Where to find the source code. This is set by the configure
68 # script's `--srcdir' option. However, the value of ${srcdir} in
69 # this makefile is not identical to what was specified with --srcdir,
70 # since the variable here has `/lib-src' added at the end.
74 # Components of the top of the source tree.
75 tsdev=@top_srcdir_dev@
76 tsdir=@top_srcdir_dir@
78 # Where to find some useful VMS scripts.
79 vmssrcdir=$(tsdev)[$(tsdir).VMS]
81 # Source directory from top-level.
82 srcsrcdir=$(tsdev)[$(tsdir).SRC]
84 # ==================== Emacs-specific directories ====================
86 # These variables hold the values Emacs will actually use. They are
87 # based on the values of the standard Make variables above.
89 # Where to put executables to be run by Emacs rather than the user.
90 # This path usually includes the Emacs version and configuration name,
91 # so that multiple configurations for multiple versions of Emacs may
92 # be installed at once. This can be set with the --archlibdir option
94 archlibdir=@archlibdir@
96 # ==================== Utility Programs for the Build ================
98 # ../configure figures out the correct values for these.
100 INSTALL_PROGRAM = @INSTALL_PROGRAM@
101 INSTALL_DATA = @INSTALL_DATA@
103 # ========================== Lists of Files ==========================
105 # Things that a user might actually run,
106 # which should be installed in bindir.
107 # removed: ctags.exe,emacsclient.exe
108 INSTALLABLES = etags.exe,b2m.exe,ebrowse.exe
109 INSTALLABLE_SCRIPTS = rcs-checkin.,grep-changelog.
111 # Things that Emacs runs internally, or during the build process,
112 # which should not be installed in bindir.
113 # removed: movemail.exe,emacsserver.exe,fakemail.exe
114 # removed: vmssendmail.exe,vmsgetmail.exe
115 UTILITIES= profile.exe,digest-doc.exe,\
116 sorted-doc.exe,cvtmail.exe,yow.exe,hexl.exe
118 DONT_INSTALL= test-distrib.exe,make-docfile.exe
120 # Like UTILITIES, but they're not system-dependent, and should not be
121 # deleted by the distclean target.
124 EXECUTABLES= $(UTILITIES), $(INSTALLABLES), $(SCRIPTS), $(INSTALLABLE_SCRIPTS)
126 SOURCES = COPYING ChangeLog Makefile.in README aixcc.lex emacs.csh \
127 makedoc.com *.c *.h *.y rcs2log vcdiff
130 sys$disk:[],sys$disk:[-.src],$(srcdir),$(srcsrcdir),$(vmssrcdir)
131 slash_include = /include=($(local_includes))
133 # ========================== start of cpp stuff =======================
134 /* From here on, comments must be done in C syntax. */
137 #undef vms /* let's depend on VMS, right? */
148 #define NO_SHORTNAMES
149 #define THIS_IS_YMAKEFILE
153 /* We won't really call alloca;
154 don't let the file name alloca.c get messed up. */
159 /* Some s/*.h files define this to request special libraries. */
164 /* Some m/*.h files define this to request special libraries. */
169 #ifndef C_SWITCH_SYSTEM
170 #define C_SWITCH_SYSTEM
173 #ifndef C_SWITCH_MACHINE
174 #define C_SWITCH_MACHINE
177 #undef MOVEMAIL_NEEDS_BLESSING
178 #ifndef MAIL_USE_FLOCK
179 #ifndef MAIL_USE_LOCKF
180 #define MOVEMAIL_NEEDS_BLESSING
184 #ifdef MOVEMAIL_NEEDS_BLESSING
185 #define BLESSMAIL blessmail
190 LOADLIBES=LIBS_SYSTEM LIBS_MACHINE
192 /* Some files - those shared with other GNU utilities - need
193 HAVE_CONFIG_H #defined before they know they can take advantage of
194 the information in [-.src]config.h. */
195 ALL_CFLAGS = /define=(HAVE_CONFIG_H,VERSION="""$(version)""") \
197 C_SWITCH_SYSTEM $(CPPFLAGS) $(CFLAGS)
198 LINK_CFLAGS = /define=(HAVE_CONFIG_H,VERSION="""$(version)""") \
200 C_SWITCH_SYSTEM $(CFLAGS)
201 CPP_CFLAGS = /define=(HAVE_CONFIG_H,VERSION="""$(version)""") \
203 C_SWITCH_SYSTEM $(CPPFLAGS) $(CFLAGS)
204 ALLOCA_CFLAGS = /define=(HAVE_CONFIG_H,VERSION="""$(version)""") \
206 C_SWITCH_SYSTEM $(CPPFLAGS) $(CFLAGS)
209 /* This is the default compilation command.
210 But we should never rely on it, because some make version
211 failed to find it for getopt.obj.
212 Using an explicit command made it work. */
214 $(CC) $(CPP_CFLAGS) $(MMS$SOURCE) /obj=$(MMS$TARGET)
217 $(LD) $(LDFLAGS) /exec=$*.exe $*.obj,[-.vms]vmslink.opt/opt
220 $(CC) $(ALL_CFLAGS) $< /obj = $*.obj
221 $(LD) $(LDFLAGS) /exec=$*.exe $*.obj,[-.vms]vmslink.opt/opt
223 # removed: $(SCRIPTS) and $(INSTALLABLE_SCRIPTS)
224 all : $(DONT_INSTALL) $(UTILITIES) $(INSTALLABLES)
227 /* Install the internal utilities. Until they are installed, we can
228 just run them directly from lib-src. */
230 @ write sys$output ""
231 @ write sys$output "Installing utilities run internally by Emacs."
232 create/dir $(archlibdir)
233 a = f$environment("DEFAULT")
234 set default [-.lib-src]
235 @$(vmssrcdir)compare_dirs $(archlibdir) 'f$environment("DEFAULT")' result
236 if .not. result then $(INSTALL_PROGRAM) $(UTILITIES) $(archlibdir) /log
237 - purge $(archlibdir)$(UTILITIES) /log
239 @$(vmssrcdir)compare_dirs $(archlibdir) $(srcdir) result
240 if .not. result then $(INSTALL_PROGRAM) $(srcdir)$(SCRIPTS) $(archlibdir) /log
241 - purge $(archlibdir)$(SCRIPTS) /log
243 /* We don't need to install `wakeup' explicitly, because it will be
244 copied when this whole directory is copied. */
245 install : $(archlibdir)
246 @ write sys$output ""
247 @ write sys$output "Installing utilities for users to run."
248 a = f$environment("DEFAULT")
249 set default [-.lib-src]
250 $(INSTALL_PROGRAM) $(INSTALLABLES) $(bindir) /log
251 - purge $(bindir)$(INSTALLABLES) /log
254 $(INSTALL_PROGRAM) $(srcdir)$(INSTALLABLE_SCRIPTS) $(bindir) /log
255 - purge $(bindir)$(INSTALLABLE_SCRIPTS) /log
259 a = f$environment("DEFAULT")
261 - @$(vmssrcdir)delete $(INSTALLABLES),$(INSTALLABLE_SCRIPTS)
262 set def $(archlibdir)
263 - @$(vmssrcdir)delete $(UTILITIES),$(INSTALLABLES),$(SCRIPTS),$(INSTALLABLE_SCRIPTS)
267 - @$(vmssrcdir)delete *.obj
269 # - @$(vmssrcdir)delete $(UTILITIES)
270 # - @$(vmssrcdir)delete $(DONT_INSTALL)
273 - @$(vmssrcdir)delete $(INSTALLABLES),$(UTILITIES),$(DONT_INSTALL)
274 - @$(vmssrcdir)delete *.el
277 - @$(vmssrcdir)delete [-.etc]DOC*$(dotstar),[]*_tab.c,*_tab.h,TAGS$(dotstar)
278 - @$(vmssrcdir)delete descrip.mms,descrip.mms_in,blessmail.exe
280 realclean : distclean
283 extraclean : realclean
284 - @$(vmssrcdir)delete _$*$(dotstar)$
288 set file/prot=(o:rwd) $(SOURCES)
291 set file/prot=(o:r) $(SOURCES)
293 /* Test the contents of the directory. */
295 @ write sys$output "We don't have any tests for GNU Emacs yet."
298 mcr sys$disk:[]etags *.c *.h
300 /* This verifies that the non-ASCII characters in the file `testfile'
301 have not been clobbered by whatever means were used to copy and
302 distribute Emacs. If they were clobbered, all the .elc files were
304 test-distrib.exe : $(srcdir)test-distrib.c [-.vms]vmslink.opt
305 $(CC) $(ALL_CFLAGS) /obj=test-distrib.obj $(srcdir)test-distrib.c
306 $(LD) $(LDFLAGS) /exe=test-distrib.exe test-distrib.obj,[-.vms]vmslink.opt/opt
308 test-distrib : test-distrib.exe
309 mcr sys$disk:[]test-distrib $(srcdir)testfile
311 GETOPTOBJS = getopt.obj, getopt1.obj $(ALLOCA)
312 GETOPTDEPS = $(GETOPTOBJS) $(srcdir)getopt.h
313 getopt.obj : $(srcdir)getopt.c $(srcdir)getopt.h
314 getopt1.obj : $(srcdir)getopt1.c $(srcdir)getopt.h
316 REGEXPOBJ = regex.obj
317 REGEXPDEPS = $(REGEXPOBJ) $(srcsrcdir)regex.h
318 regex.obj : $(srcsrcdir)regex.c
320 alloca.obj : $(srcdir)alloca.c
321 $(CC) $(ALLOCA_CFLAGS) $(srcdir)alloca.c /obj=alloca.obj
323 etags.exe : $(srcdir)etags.c $(GETOPTDEPS) $(REGEXPDEPS) \
324 [-.src]config.h [-.vms]vmslink.opt
325 $(CC) $(ALL_CFLAGS) $(srcdir)etags.c /obj=etags.obj
326 link /exe=etags.exe etags.obj,$(GETOPTOBJS),$(REGEXPOBJ),-
327 [-.vms]vmslink.opt/opt
329 ebrowse.exe : $(srcdir)ebrowse.c $(GETOPTDEPS)
330 $(CC) $(ALL_CFLAGS) $(srcdir)ebrowse.c /obj=ebrowse.obj
331 $(LD) $(LDFLAGS) /exe=$@ ebrowse.obj,$(GETOPTOBJS),-
332 [-.vms]vmslink.opt/opt
334 profile.obj : $(srcdir)profile.c [-.vms]vmslink.opt
335 profile.exe : profile.obj
336 link /exec=profile.exe profile.obj,[-.vms]vmslink.opt/opt
338 make-docfile.exe : $(srcdir)make-docfile.c [-.vms]vmslink.opt
340 digest-doc.exe : $(srcdir)digest-doc.c [-.vms]vmslink.opt
342 SORTED_DOC_OBJS=sorted-doc.obj $(ALLOCA)
343 sorted-doc.obj : $(srcdir)sorted-doc.c
344 sorted-doc.exe : $(SORTED_DOC_OBJS) [-.vms]vmslink.opt
345 $(LD)/exe=sorted-doc.exe sorted-doc.obj$(ALLOCA),[-.vms]vmslink.opt/opt
347 b2m.exe : $(srcdir)b2m.c [-.src]config.h [-.vms]vmslink.opt
348 $(CC) $(ALL_CFLAGS) $(srcdir)b2m.c /obj=b2m.obj
349 $(LD)/exe=b2m.exe b2m.obj,$(GETOPTOBJS),[-.vms]vmslink.opt/opt
351 movemail.exe : $(srcdir)movemail.c [-.src]config.h [-.vms]vmslink.opt
352 $(CC) $(ALL_CFLAGS) $(srcdir)movemail.c /obj=movemail.obj
353 $(LD)/exe=movemail.exe movemail.obj,[-.vms]vmslink.opt/opt
355 cvtmail.exe : $(srcdir)cvtmail.c [-.vms]vmslink.opt
357 #if 0 /* We will get to this later. --ttn */
358 vmssendmail.exe : $(srcdir)vmssendmail.c [-.vms]vmslink.opt
360 vmsgetmail.obj : $(srcdir)vmsgetmail.c $(srcdir)mailmsgdef.h \
361 $(srcdir)maildef.h $(srcdir)mail.h $(srcdir)getopt.h
362 vmsgetmail.exe : vmsgetmail.obj $(GETOPTOBJS) [-.vms]vmslink.opt
363 $(LD) $(LDFLAGS) /exe=vmsgetmail.exe vmsgetmail.obj,$(GETOPTOBJS),\
364 [-.vms]vmslink.opt/opt
367 yow.exe : $(srcdir)yow.c [-.src]paths.h [-.vms]vmslink.opt
369 hexl.exe : $(srcdir)hexl.c [-.vms]vmslink.opt
371 TIMEROBJS=getdate.obj, timer.obj $(ALLOCA)
372 getdate.obj : $(srcdir)getdate.y [-.src]config.h
373 $(YACC) $(YFLAGS) $(srcdir)getdate.y
374 $(CC) $(CPP_CFLAGS) y_tab.c
375 rename y_tab.obj getdate.obj
376 timer.obj : $(srcdir)timer.c [-.src]config.h
377 $(CC) $(CPP_CFLAGS) $(srcdir)timer.c
378 timer.exe : $(TIMEROBJS) [-.vms]vmslink.opt
379 $(LD)/exe=timer.exe $(TIMEROBJS),[-.vms]vmslink.opt/opt