]> git.ipfire.org Git - thirdparty/bash.git/blame - cpp-Makefile
Imported from ../bash-1.14.7.tar.gz.
[thirdparty/bash.git] / cpp-Makefile
CommitLineData
726f6388
JA
1/* This -*- C -*- file (cpp-Makefile) is run through the C preprocessor
2 to produce bash-Makefile which is machine specific.
3
4 If you have Gcc and/or Bison, you might wish to mention that right
5 below here.
6
7 Since this is to become a Makefile, blank lines which appear outside
8 of comments may not contain a TAB character.
9
10 Copyright (C) 1987,1991 Free Software Foundation, Inc.
11
12 This file is part of GNU Bash, the Bourne Again SHell.
13
14 Bash is free software; you can redistribute it and/or modify it under
15 the terms of the GNU General Public License as published by the Free
16 Software Foundation; either version 1, or (at your option) any later
17 version.
18
19 Bash is distributed in the hope that it will be useful, but WITHOUT ANY
20 WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License along
25 with Bash; see the file COPYING. If not, write to the Free Software
26 Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
27
28/**/# This Makefile is automagically made from cpp-Makefile. You should
29/**/# not be editing this file; edit cpp-Makefile, machines.h, or
30/**/# support/mksysdefs instead. Then, assuming the edits were required
31/**/# to compile Bash on your system, mail the changes you had to make to
32/**/# bash-maintainers@prep.ai.mit.edu. We will do our best to incorporate
33/**/# them into the next release.
34
35/**/# Make sure the first target in the makefile is the right one
36all: .made
37
38/* **************************************************************** */
39/* */
40/* Which compiler are you using? */
41/* */
42/* **************************************************************** */
43
44/* Define HAVE_GCC if you have the GNU C compiler. */
45/* #define HAVE_GCC */
46
47#if defined (__GNUC__) && !defined (HAVE_GCC) && !defined (GCC_STANDARD)
48# define HAVE_GCC
49#endif
50
51/* Undefine HAVE_FIXED_INCLUDES if you are not using GCC with the fixed
52 header files. */
53#if defined (HAVE_GCC) && !defined (HAVE_FIXED_INCLUDES)
54# define HAVE_FIXED_INCLUDES
55#endif /* HAVE_GCC && !HAVE_FIXED_INCLUDES */
56
57/* Define HAVE_BISON if you have the GNU replacement for Yacc. */
58/**/# We would like you to use Bison instead of Yacc since some
59/**/# versions of Yacc cannot handle reentrant parsing. Unfortunately,
60/**/# this includes the Yacc currently being shipped with SunOS4.x.
61/**/# If you do use Yacc, please make sure that any bugs in parsing
62/**/# are not really manifestations of Yacc bugs before you report
63/**/# them.
64/* #define HAVE_BISON */
65
66/* Include some boilerplate Gnu makefile definitions. */
67prefix = /usr/local
68
69exec_prefix = $(prefix)
70bindir = $(exec_prefix)/bin
71libdir = $(exec_prefix)/lib
72
73manroot = $(prefix)/man
74
75man1ext = 1
76man1dir = $(manroot)/man$(man1ext)
77man3ext = 3
78man3dir = $(manroot)/man$(man3ext)
79mandir = $(man1dir)
80manext = $(man1ext)
81
82infodir = $(prefix)/info
83
84srcdir = .
85
86VPATH = .:$(srcdir)
87
88/* If you have purify, and want to use it, uncomment this definition or
89 run the make as `make -f bash-Makefile bash PURIFY=purify'. */
90PURIFY = # purify
91
92/* This includes the appropriate description for the machine that you are
93 using (we hope). If the compilation doesn't work correctly, then you
94 will have to edit the file `machines.h' to include a description for the
95 machine that your Cpp uniquely identifies this as. For example, Sun 4's
96 are recognized by the Cpp identifier `sparc', Vax is recognized with `vax',
97 etc. The order of these files is very important. Config.h must come last,
98 since it is capable of undef'ing various things. */
99#define BUILDING_MAKEFILE /* Tell config.h to avoid #including anything. */
100#include "sysdefs.h"
101#include "machines.h"
102#include "config.h"
103
104/* Can't use the Gnu malloc library without saying we want the Gnu malloc. */
105#if !defined (USE_GNU_MALLOC)
106# undef USE_GNU_MALLOC_LIBRARY
107#endif /* !USE_GNU_MALLOC */
108
109.SUFFIXES: .aux
110/**/# Here is a rule for making .o files from .c files that does not
111/**/# force the type of the machine (like -M_MACHINE) into the flags.
112.c.o:
113 $(RM) $@
114 $(CC) $(CCFLAGS) $(CPPFLAGS) -c $<
115
116.c.aux:
117 $(RM) $@
118 $(CC) $(CCFLAGS) $(CPPFLAGS) -o $@ $<
119
120#if defined (HAVE_BISON)
121BISON = bison -y
122#else
123BISON = yacc
124#endif
125
126#if defined (HAVE_GCC)
127# if defined (GCC_FLAGS)
128GCC_EXTRAS = GCC_FLAGS
129# endif /* GCC_FLAGS */
130# if !defined (HAVE_FIXED_INCLUDES)
131/* This is guaranteed to work, even if you have the fixed includes!
132 (Unless, of course, you have the fixed include files installed in
133 /usr/include. Then it will break.) */
134CC = gcc -traditional -I/usr/include $(GCC_EXTRAS)
135# else /* HAVE_FIXED_INCLUDES */
136CC = gcc $(GCC_EXTRAS)
137# endif /* HAVE_FIXED_INCLUDES */
138#else /* !HAVE_GCC */
139CC = CPP_CC
140#endif /* !HAVE_GCC */
141
142/**/# If the user has specified a Make shell, then use that.
143#if defined (MAKE_SHELL)
144SHELL = MAKE_SHELL
145#else
146SHELL=/bin/sh
147#endif /* MAKE_SHELL */
148
149CP = cp
150RM = rm -f
151AR = ar
152
153INSTALL = $(SUPPORT_SRC)install.sh
154INSTALL_PROGRAM = $(INSTALL) -c
155INSTALL_DATA = $(INSTALL) -c -m 644
156
157COMPRESS = gzip
158COMPRESS_EXT = .gz
159
160Machine = M_MACHINE
161OS = M_OS
162
163/**/# PROFILE_FLAGS is either -pg, to generate profiling info for use
164/**/# with gprof, or nothing (the default).
165PROFILE_FLAGS=
166
167#if defined (SYSDEP_CFLAGS)
168/**/# This system has some peculiar flags that must be passed to the
169/**/# the C compiler (or to cpp).
170SYSDEP = SYSDEP_CFLAGS
171#endif /* SYSDEP_CFLAGS */
172
173#if defined (SYSDEP_LDFLAGS)
174/**/# This system has some peculiar flags that must be passed to the
175/**/# link editor (ld).
176SYSDEP_LD = SYSDEP_LDFLAGS
177#endif /* SYSDEP_LDFLAGS */
178
179#if defined (HAVE_SETLINEBUF)
180/**/# This system has the setlinebuf () call.
181LINEBUF = -DHAVE_SETLINEBUF
182#endif
183
184#if defined (HAVE_VFPRINTF)
185/**/# This system has the vprintf () and vfprintf () calls.
186VPRINTF = -DHAVE_VFPRINTF
187#endif /* HAVE_VFPRINTF */
188
189#if defined (USE_VFPRINTF_EMULATION)
190VPRINTF = -DHAVE_VFPRINTF
191VPRINT_OBJ = vprint.o
192#endif /* USE_VFPRINTF_EMULATION */
193
194#if defined (HAVE_SYS_STREAM_H)
195/**/# This system has <sys/stream.h>
196STREAM = -DHAVE_SYS_STREAM_H
197#endif /* HAVE_SYS_STREAM_H */
198
199#if defined (HAVE_SYS_PTEM_H)
200/**/# This system has <sys/ptem.h>
201PTEM = -DHAVE_SYS_PTEM_H
202#endif /* HAVE_SYS_PTEM_H */
203
204#if defined (HAVE_SYS_PTE_H)
205/**/# This system has <sys/pte.h>
206PTE = -DHAVE_SYS_PTE_H
207#endif /* HAVE_SYS_PTE_H */
208
209/**/# This system has <unistd.h>.
210#if defined (HAVE_UNISTD_H)
211UNISTD = -DHAVE_UNISTD_H
212#endif
213
214/**/# This system has <stdlib.h>
215#if defined (HAVE_STDLIB_H)
216STDLIB = -DHAVE_STDLIB_H
217#endif
218
219/**/# This system has <limits.h>
220#if defined (HAVE_LIMITS_H)
221LIMITSH = -DHAVE_LIMITS_H
222#endif
223
224#if defined (HAVE_GETGROUPS)
225/**/# This system has multiple groups.
226GROUPS = -DHAVE_GETGROUPS
227#endif
228
229#if defined (HAVE_RESOURCE)
230/**/# This system has <sys/resource.h>
231RESOURCE = -DHAVE_RESOURCE
232#endif
233
234#if defined (HAVE_SYS_PARAM)
235/**/# This system has <sys/param.h>
236PARAM = -DHAVE_SYS_PARAM
237#endif
238
239#if defined (VOID_SIGHANDLER)
240/**/# The signal () call provided by the system returns a pointer to
241/**/# a function returning void. The signal handlers themselves are
242/**/# thus void functions.
243SIGHANDLER = -DVOID_SIGHANDLER
244#endif
245
246#if defined (HAVE_STRERROR)
247/**/# This system has the strerror () function.
248STRERROR = -DHAVE_STRERROR
249#endif
250
251#if defined (HAVE_WAIT_H)
252/**/# This system has <sys/wait.h>
253WAITH = -DHAVE_WAIT_H
254#endif
255
256#if defined (HAVE_GETWD)
257/**/# This system has the getwd () call.
258GETWD = -DHAVE_GETWD
259#endif
260
261#if defined (HAVE_DUP2)
262/**/# This system has a working version of dup2 ().
263DUP2 = -DHAVE_DUP2
264#endif /* HAVE_DUP2 */
265
266#if defined (HAVE_DIRENT)
267/**/# This system uses struct dirent for reading directories with readdir.
268DIRENT = -DHAVE_DIRENT
269#endif /* HAVE_DIRENT */
270
271#if defined (HAVE_DIRENT_H)
272/**/# This system has /usr/include/dirent.h
273DIRENTH = -DHAVE_DIRENT_H
274#endif /* HAVE_DIRENT_H */
275
276#if defined (HAVE_STRING_H)
277/**/# This system has /usr/include/string.h
278STRINGH = -DHAVE_STRING_H
279#endif /* HAVE_STRING_H */
280
281#if defined (HAVE_VARARGS_H)
282/**/# This system has /usr/include/varargs.h
283VARARGSH = -DHAVE_VARARGS_H
284#endif /* HAVE_VARARGS_H */
285
286#if defined (HAVE_STRCHR)
287/**/# This system has strchr () and strrchr () string functions.
288STRCHR = -DHAVE_STRCHR
289#endif /* HAVE_STRCHR */
290
291#if defined (HAVE_STRCASECMP)
292STRCASE = -DHAVE_STRCASECMP
293#endif /* HAVE_STRCASECMP */
294
295#if defined (HAVE_DEV_FD)
296/**/# This system has the /dev/fd directory for naming open files.
297DEVFD = -DHAVE_DEV_FD
298#endif /* HAVE_DEV_FD */
299
300/**/# The GNU coding standards don't recognize the possibility that
301/**/# other information besides optimization and debugging might be
302/**/# passed to cc. A different name should have been used.
303CFLAGS = -O -g
304
305SYSTEM_FLAGS = $(LINEBUF) $(VPRINTF) $(UNISTD) $(STDLIB) $(LIMITSH) \
306 $(GROUPS) $(RESOURCE) $(PARAM) $(SIGHANDLER) $(SYSDEP) $(WAITH) \
307 $(GETWD) $(DUP2) $(STRERROR) $(DIRENT) $(DIRENTH) $(STRINGH) \
308 $(VARARGSH) $(STRCHR) $(STRCASE) $(DEVFD) \
309 -D$(Machine) -D$(OS)
310LDFLAGS = $(NOSHARE) $(SYSDEP_LD) $(EXTRA_LD_PATH) $(PROFILE_FLAGS) $(CFLAGS)
311CCFLAGS = $(PROFILE_FLAGS) $(SYSTEM_FLAGS) -DSHELL $(ALLOCA_CFLAGS) \
312 $(MALLOC_CFLAGS) $(CFLAGS)
313CPPFLAGS= -I. -I$(srcdir) -I$(LIBSRC)
314GCC_LINT_FLAGS = -ansi -Wall -Wshadow -Wpointer-arith -Wcast-qual \
315 -Wwrite-strings -Werror -Wstrict-prototypes \
316 -Wmissing-prototypes
317GCC_LINT_CFLAGS = $(PROFILE_FLAGS) $(CFLAGS) $(SYSTEM_FLAGS) -DSHELL $(ALLOCA_CFLAGS) \
318 $(MALLOC_CFLAGS) $(GCC_LINT_FLAGS)
319
320/* It is conceivable that you wish to edit some things beyond this point,
321 but I guess that it is highly unlikely, and may give you a headache. */
322
323/* **************************************************************** */
324/* */
325/* How to Build the support libraries. */
326/* */
327/* **************************************************************** */
328
329/**/# The location of sources for the support libraries.
330LIBPATH = ./lib/
331LIBSRC = $(srcdir)/$(LIBPATH)
332
333/**/# Preface building with the full path of the current library source.
334LIBINC_DECL = topdir=`sh $(srcdir)/support/srcdir $(srcdir)`; export topdir
335LIBINC_USAGE = "-I$${topdir} -I$${topdir}/$(LIBPATH) -I$(LIBSRC)"
336
337/* Defines used when building libraries. */
338#define LIB_CFLAGS_DECL CFLAGS='$(LIBRARY_CFLAGS) '$(LIBINC_USAGE)
339#define LIB_CPPFLAGS_DECL CPPFLAGS='$(CPPFLAGS)'
340#define LIB_LDFLAGS_DECL LDFLAGS='$(LDFLAGS)'
341#define LIBMAKE_FLAGS LIB_CFLAGS_DECL LIB_CPPFLAGS_DECL LIB_LDFLAGS_DECL \
342 RANLIB='$(RANLIB)' AR='$(AR)' CC='$(CC)' RM='$(RM)' \
343
344/* Macro used to build a library. */
345#define build_lib_in_dir(directory, target, srcdef, makefile) \
346 @echo "Building in " directory "..."; \
347 sh $(SUPPORT_SRC)mkdirs directory ; \
348 ($(LIBINC_DECL); cd directory; \
349 if [ ! -f Makefile ]; then cp makefile Makefile; fi; \
350 $(MAKE) target $(MFLAGS) LIBMAKE_FLAGS srcdef)
351
352/* The builtins are somewhat special in that more information is needed
353 to compile them correctly. */
354#define build_builtins(target) \
355 @sh $(SUPPORT_SRC)mkdirs $(DEFDIR) ; \
356 ($(LIBINC_DECL); cd $(DEFDIR); \
357 if [ ! -f Makefile ]; then \
358 cp $(BUILTIN_ABSSRC)/Makefile Makefile; \
359 fi; \
360 $(MAKE) $(MFLAGS) target \
361 srcdir=$(BUILTIN_ABSSRC) CPPFLAGS='$(CPPFLAGS)' \
362 CFLAGS='$(CCFLAGS) '$(LIBINC_USAGE)' -I. -I$(BUILTIN_ABSSRC)' \
363 LDFLAGS='$(LDFLAGS)' RANLIB='$(RANLIB)' AR='$(AR)' CC='$(CC)' \
364 RM='$(RM)' RL_LIBSRC='$(RL_ABSSRC)' \
365 DIRECTDEFINE='-D '$(srcdir)/$(DEFDIR))
366
367/**/# Flags used when building libraries.
368LIBRARY_CFLAGS = $(PROFILE_FLAGS) $(CFLAGS) $(SIGHANDLER) $(ALLOCA_CFLAGS) \
369 $(SYSDEP) $(DIRENT) $(DIRENTH) $(STRINGH) $(VARARGSH) \
370 $(PTEM) $(PTE) $(STREAM) $(STRERROR) $(RESOURCE) \
371 $(STRCHR) -D$(Machine) -D$(OS) $(UNISTD) $(LIMITSH) \
372 $(STRCASE) $(STDLIB) -DSHELL
373
374/**/# These are required for sending bug reports.
375SYSTEM_NAME = $(Machine)
376OS_NAME = $(OS)
377
378/**/# The name of this program.
379Program = bash
380
381/**/# The type of machine and OS Bash is being compiled on.
382HOSTTYPE_DECL = -DHOSTTYPE='$(SYSTEM_NAME)' -DOSTYPE='$(OS_NAME)'
383
384/**/# The group of configuration flags. These are for shell.c
385CFG_FLAGS = -DOS_NAME='$(OS_NAME)' -DSYSTEM_NAME='$(SYSTEM_NAME)' \
386 $(SIGLIST_FLAG)
387
388/* **************************************************************** */
389/* */
390/* Support for desired libraries. */
391/* This includes Termcap, Glob, Tilde, History, and Readline. */
392/* */
393/* **************************************************************** */
394
395/* Does this machine's linker need a space after -L? */
396#if defined (HAVE_GCC)
397# undef SEARCH_LIB_NEEDS_SPACE
398#endif /* HAVE_GCC */
399
400#if defined (SEARCH_LIB_NEEDS_SPACE)
401/**/# The native compiler for this machines requires a space after '-L'.
402SEARCH_LIB = -L $(UNSET_VARIABLE_CREATES_SPACE)
403#else
404/**/# The compiler being used to build Bash can handle -L/library/path.
405SEARCH_LIB = -L
406#endif /* !SEARCH_LIB_NEEDS_SPACE */
407
408#if defined (EXTRA_LIB_SEARCH_PATH)
409/**/# Additional instructions to the linker telling it how to find libraries.
410LOCAL_LD_PATH = EXTRA_LIB_SEARCH_PATH
411EXTRA_LD_PATH = $(SEARCH_LIB)$(LOCAL_LD_PATH)
412#endif /* EXTRA_LIB_SEARCH_PATH */
413
414/* Right now we assume that you have the full source code to Bash. If
415 you simply have the library and header files installed, then
416 undefine HAVE_READLINE_SOURCE. */
417#define HAVE_READLINE_SOURCE
418
419#if defined (HAVE_READLINE_SOURCE)
420
421RL_LIBSRC = $(LIBSRC)readline/
422RL_LIBDOC = $(RL_LIBSRC)doc/
423RL_LIBDIR = $(LIBPATH)readline/
424RL_ABSSRC = $${topdir}/$(RL_LIBDIR)
425
426READLINE_LIBRARY = $(RL_LIBDIR)libreadline.a
427
428/**/# The source, object and documentation of the GNU Readline library.
429READLINE_SOURCE = $(RL_LIBSRC)rldefs.h $(RL_LIBSRC)rlconf.h \
430 $(RL_LIBSRC)readline.h \
431 $(RL_LIBSRC)chardefs.h $(RL_LIBSRC)keymaps.h \
432 $(RL_LIBSRC)funmap.c $(RL_LIBSRC)emacs_keymap.c \
433 $(RL_LIBSRC)search.c $(RL_LIBSRC)vi_keymap.c \
434 $(RL_LIBSRC)keymaps.c $(RL_LIBSRC)parens.c \
435 $(RL_LIBSRC)vi_mode.c $(RL_LIBSRC)history.c \
436 $(RL_LIBSRC)readline.c $(RL_LIBSRC)tilde.c \
437 $(RL_LIBSRC)rltty.c $(RL_LIBSRC)complete.c \
438 $(RL_LIBSRC)bind.c $(RL_LIBSRC)isearch.c \
439 $(RL_LIBSRC)display.c $(RL_LIBSRC)signals.c \
440 $(RL_LIBSRC)posixstat.h $(RL_LIBSRC)tilde.h \
441 $(RL_LIBSRC)xmalloc.c
442
443READLINE_OBJ = $(RL_LIBDIR)readline.o $(RL_LIBDIR)funmap.o \
444 $(RL_LIBDIR)parens.o $(RL_LIBDIR)search.o \
445 $(RL_LIBDIR)keymaps.o $(RL_LIBDIR)history.o \
446 $(RL_LIBDIR)rltty.o $(RL_LIBDIR)complete.o \
447 $(RL_LIBDIR)bind.o $(RL_LIBDIR)isearch.o \
448 $(RL_LIBDIR)display.o $(RL_LIBDIR)signals.o \
449 $(RL_LIBDIR)tilde.o $(RL_LIBDIR)xmalloc.o
450
451READLINE_DOC = $(RL_LIBDOC)rlman.texinfo $(RL_LIBDOC)rluser.texinfo \
452 $(RL_LIBDOC)rltech.texinfo
453
454READLINE_DOC_SUPPORT = $(RL_LIBDOC)Makefile $(RL_LIBDOC)readline.dvi \
455 $(RL_LIBDOC)readline.info
456
457/**/# This has to be written funny to avoid looking like a C comment starter.
458READLINE_EXAMPLES = $(RL_LIBSRC)examples/[a-zA-Z]*.[ch] \
459 $(RL_LIBSRC)examples/Makefile $(RL_LIBSRC)examples/Inputrc
460
461/**/# Support files for GNU Readline.
462READLINE_SUPPORT = $(RL_LIBSRC)Makefile $(RL_LIBSRC)ChangeLog \
463 $(RL_LIBSRC)COPYING $(READLINE_EXAMPLES) \
464 $(READLINE_DOC_SUPPORT)
465
466#else /* !HAVE_READLINE_SOURCE */
467
468# if defined (READLINE)
469READLINE_LIBRARY = -lreadline
470# endif /* READLINE */
471RL_LIBDIR = $(srcdir)/$(LIBSRC)readline/
472
473#endif /* !HAVE_READLINE_SOURCE */
474
475/* Right now we assume that you have the full source code to Bash,
476 including the source code to the history library. If you only have
477 the library and header files installed, then you can undefine
478 HAVE_HISTORY_SOURCE. */
479#define HAVE_HISTORY_SOURCE
480
481#if defined (READLINE) && !defined (HISTORY)
482# define HISTORY
483#endif /* READLINE && !HISTORY */
484
485# if defined (HISTORY) && !defined (READLINE)
486/**/# You are compiling with history features but without line editing.
487HISTORY_LIB = -lhistory
488# endif /* HISTORY && !READLINE */
489
490#if defined (HISTORY)
491HIST_SUPPORT_SRC = bashhist.c
492HIST_SUPPORT_OBJ = bashhist.o
493#endif /* HISTORY */
494
495#if defined (HAVE_HISTORY_SOURCE)
496
497HIST_LIBSRC = $(LIBSRC)readline/
498HIST_LIBDOC = $(HIST_LIBSRC)doc/
499HIST_LIBDIR = $(LIBPATH)readline/
500HIST_ABSSRC = $${topdir}/$(HIST_LIBDIR)/
501
502/* If you are building with readline, then you do not explicitly need the
503 history library. */
504# if defined (READLINE)
505HISTORY_LIBRARY =
506# else
507HISTORY_LIBRARY = $(HIST_LIBDIR)libhistory.a
508# endif /* !READLINE */
509
510/**/# The source, object and documentation of the history library.
511HISTORY_SOURCE = $(HIST_LIBSRC)history.c $(HIST_LIBSRC)history.h
512HISTORY_OBJ = $(HIST_LIBDIR)history.o
513HISTORY_DOC = $(HIST_LIBDOC)hist.texinfo $(HIST_LIBDOC)hsuser.texinfo \
514 $(HIST_LIBDOC)hstech.texinfo
515
516/**/# Directory list for -L so that the link editor (ld) can find -lhistory.
517# if defined (HISTORY) && !defined (READLINE)
518# if !defined (LD_HAS_NO_DASH_L)
519HISTORY_LDFLAGS = $(SEARCH_LIB)$(HIST_LIBDIR)
520# endif /* LD_HAS_NO_DASH_L */
521# endif /* HISTORY && !READLINE */
522#else /* !HAVE_HISTORY_SOURCE */
523# if defined (HISTORY) && !defined (READLINE)
524HISTORY_LIBRARY = -lhistory
525HISTORY_LDFLAGS = $(SEARCH_LIB)$(libdir) $(SEARCH_LIB)/usr/local/lib
526# endif /* HISTORY && !READLINE */
527#endif /* !HAVE_HISTORY_SOURCE */
528
529#if defined (USE_GNU_TERMCAP)
530# define HAVE_TERMCAP_SOURCE
531TERM_LIBSRC = $(LIBSRC)termcap/
532TERM_LIBDIR = $(LIBPATH)termcap/
533TERM_ABSSRC = $${topdir}/$(TERM_LIBDIR)
534
535/**/# The source, object and documentation for the GNU Termcap library.
536TERMCAP_LIBRARY = $(TERM_LIBDIR)libtermcap.a
537
538TERMCAP_SOURCE = $(TERM_LIBSRC)termcap.c $(TERM_LIBSRC)tparam.c
539TERMCAP_OBJ = $(TERM_LIBDIR)termcap.o $(TERM_LIBDIR)tparam.o
540TERMCAP_DOC = $(TERM_LIBSRC)termcap.texinfo
541TERMCAP_SUPPORT = $(TERM_LIBSRC)Makefile $(TERM_LIBSRC)ChangeLog
542
543# if !defined (LD_HAS_NO_DASH_L)
544TERMCAP_LDFLAGS = $(SEARCH_LIB)$(TERM_LIBDIR)
545# endif /* !LD_HAS_NO_DASH_L */
546#else /* !USE_GNU_TERMCAP */
547
548/* Guessed at symbol for LIBRARIES, below. */
549# if defined (USE_TERMCAP_EMULATION)
550TERMCAP_LIBRARY = -lcurses
551# else /* !USE_TERMCAP_EMULATION */
552TERMCAP_LIBRARY = -ltermcap
553# endif /* !USE_TERMCAP_EMULATION */
554#endif /* !USE_GNU_TERMCAP */
555
556/* The glob library is always used. */
557#define USE_GLOB_LIBRARY
558
559#if defined (USE_GLOB_LIBRARY)
560GLOB_LIBSRC = $(LIBSRC)glob/
561GLOB_LIBDIR = $(LIBPATH)glob/
562GLOB_ABSSRC = $${topdir}/$(GLOB_LIBDIR)
563
564GLOB_LIBRARY = $(GLOB_LIBDIR)libglob.a
565
566GLOB_SOURCE = $(GLOB_LIBSRC)glob.c $(GLOB_LIBSRC)fnmatch.c \
567 $(GLOB_LIBSRC)fnmatch.h
568GLOB_OBJ = $(GLOB_LIBDIR)glob.o $(GLOB_LIBDIR)fnmatch.o
569GLOB_DOC = $(GLOB_LIBSRC)doc/glob.texi $(GLOB_LIBSRC)doc/Makefile
570GLOB_SUPPORT= $(GLOB_LIBSRC)Makefile $(GLOB_LIBSRC)ChangeLog
571
572# if !defined (LD_HAS_NO_DASH_L)
573GLOB_LDFLAGS = $(SEARCH_LIB)$(GLOB_LIBDIR)
574# endif /* !LD_HAS_NO_DASH_L */
575GLOB_LIB = -lglob
576#endif /* USE_GLOB_LIBRARY */
577
578/* The source code for the tilde expansion library. */
579#if defined (HAVE_READLINE_SOURCE)
580# define HAVE_TILDE_SOURCE
581#endif /* HAVE_READLINE_SOURCE */
582
583#if defined (HAVE_TILDE_SOURCE)
584/**/# The source, object and documentation for the GNU Tilde library.
585TILDE_LIBSRC = $(LIBSRC)tilde/
586TILDE_LIBDIR = $(LIBPATH)tilde/
587TILDE_ABSSRC = $${topdir}/$(TILDE_LIBDIR)
588
589TILDE_LIBRARY = $(TILDE_LIBDIR)libtilde.a
590
591TILDE_SOURCE = $(TILDE_LIBSRC)tilde.c $(TILDE_LIBSRC)tilde.h
592TILDE_OBJ = $(TILDE_LIBDIR)tilde.o
593TILDE_DOC = $(TILDE_LIBSRC)doc/tilde.texi $(TILDE_LIBSRC)doc/Makefile
594TILDE_SUPPORT = $(TILDE_LIBSRC)Makefile $(TILDE_LIBSRC)ChangeLog
595
596TILDE_LIB = -ltilde
597
598# if !defined (LD_HAS_NO_DASH_L)
599TILDE_LDFLAGS = $(SEARCH_LIB)$(TILDE_LIBDIR)
600# endif /* !LD_HAS_NO_DASH_L */
601
602#else /* !HAVE_TILDE_SOURCE */
603/**/# Guessed at location of the tilde
604TILDE_LIBRARY = $(libdir)/libtilde.a
605#endif /* !HAVE_TILDE_SOURCE */
606
607#if defined (USE_GNU_MALLOC_LIBRARY)
608/**/# Our malloc library.
609MALLOC_LIBSRC = $(LIBSRC)malloclib/
610MALLOC_LIBDIR = $(LIBPATH)malloclib/
611MALLOC_ABSSRC = $${topdir}/$(MALLOC_LIBDIR)
612
613MALLOC_LIBRARY = $(MALLOC_LIBDIR)libmalloc.a
614
615MALLOC_SOURCE = $(MALLOC_LIBSRC)calloc.c $(MALLOC_LIBSRC)cfree.c \
616 $(MALLOC_LIBSRC)free.c $(MALLOC_LIBSRC)malloc.c \
617 $(MALLOC_LIBSRC)mcheck.c $(MALLOC_LIBSRC)memalign.c \
618 $(MALLOC_LIBSRC)morecore.c $(MALLOC_LIBSRC)mstats.c \
619 $(MALLOC_LIBSRC)mtrace.c $(MALLOC_LIBSRC)realloc.c \
620 $(MALLOC_LIBSRC)valloc.c
621MALLOC_OBJ = $(MALLOC_LIBDIR)calloc.c $(MALLOC_LIBDIR)cfree.c \
622 $(MALLOC_LIBDIR)free.c $(MALLOC_LIBDIR)malloc.c \
623 $(MALLOC_LIBDIR)mcheck.c $(MALLOC_LIBDIR)memalign.c \
624 $(MALLOC_LIBDIR)morecore.c $(MALLOC_LIBDIR)mstats.c \
625 $(MALLOC_LIBDIR)mtrace.c $(MALLOC_LIBDIR)realloc.c \
626 $(MALLOC_LIBDIR)valloc.c
627
628MALLOC_SUPPORT= $(MALLOC_LIBSRC)Makefile
629MALLOC_CFLAGS = -DUSE_GNU_MALLOC_LIBRARY
630
631# if !defined (LD_HAS_NO_DASH_L)
632MALLOC_LDFLAGS = $(SEARCH_LIB)$(MALLOC_LIBDIR)
633# endif /* !LD_HAS_NO_DASH_L */
634MALLOC_LIB = -lmalloc
635
636MALLOC_DEP = $(MALLOC_LIBRARY)
637#else
638MALLOC_LIBRARY =
639#endif /* USE_GNU_MALLOC_LIBRARY */
640
641BASHPOSIX_LIB = $(LIBSRC)posixheaders/
642BASHPOSIX_SUPPORT = $(BASHPOSIX_LIB)posixstat.h $(BASHPOSIX_LIB)ansi_stdlib.h \
643 $(BASHPOSIX_LIB)memalloc.h $(BASHPOSIX_LIB)stdc.h
644
645/**/# Declare all of the sources for the libraries that we have.
646LIBRARY_SOURCE = $(READLINE_SOURCE) $(HISTORY_SOURCE) $(TERMCAP_SOURCE) \
647 $(GLOB_SOURCE) $(TILDE_SOURCE) $(MALLOC_SOURCE)
648LIBRARY_DOC = $(READLINE_DOC) $(HISTORY_DOC) $(TERMCAP_DOC) $(GLOB_DOC) \
649 $(TILDE_DOC) $(MALLOC_DOC)
650LIBRARY_SUPPORT = $(READLINE_SUPPORT) $(HISTORY_SUPPORT) $(TERMCAP_SUPPORT) \
651 $(GLOB_SUPPORT) $(TILDE_SUPPORT) $(MALLOC_SUPPORT)
652LIBRARY_TAR = $(LIBRARY_SOURCE) $(LIBRARY_DOC) $(LIBRARY_SUPPORT)
653
654#if defined (READLINE)
655/**/# You wish to compile with the line editing features installed.
656READLINE_LIB = -lreadline
657
658/**/# You only need termcap (or curses) if you are linking with GNU Readline.
659# if defined (USE_TERMCAP_EMULATION)
660TERMCAP_LIB = -lcurses
661# else /* !USE_TERMCAP_EMULATION */
662TERMCAP_LIB = -ltermcap
663# endif /* !USE_TERMCAP_EMULATION */
664
665/**/# Directory list for -L so that the link editor (ld) can find -lreadline.
666# if !defined (LD_HAS_NO_DASH_L)
667# if defined (HAVE_READLINE_SOURCE)
668READLINE_LDFLAGS = $(SEARCH_LIB)$(RL_LIBDIR) $(TERMCAP_LDFLAGS)
669# else
670READLINE_LDFLAGS = $(TERMCAP_LDFLAGS) $(SEARCH_LIB)$(libdir) \
671 $(SEARCH_LIB)/usr/local/lib
672# endif /* HAVE_READLINE_SOURCE */
673# endif /* LD_HAS_NO_DASH_L */
674
675/**/# The source and object of the bash<->readline interface code.
676RL_SUPPORT_SRC = bashline.c bracecomp.c
677RL_SUPPORT_OBJ = bashline.o $(BRACECOMP_OBJECT)
678#endif /* READLINE */
679
680/**/# The order is important. Most dependent first.
681#if defined (LD_HAS_NO_DASH_L)
682/**/# This linker does not know how to grok the -l flag, or perhaps how
683/**/# to grok the -L flag, or both.
684LIBRARIES = $(READLINE_LIBRARY) $(HISTORY_LIBRARY) $(TERMCAP_LIBRARY) \
685 $(GLOB_LIBRARY) $(TILDE_LIBRARY) $(MALLOC_LIBRARY) $(LOCAL_LIBS)
686#else /* !LD_HAS_NO_DASH_L */
687LIBRARIES = $(READLINE_LIB) $(HISTORY_LIB) $(TERMCAP_LIB) $(GLOB_LIB) \
688 $(TILDE_LIB) $(MALLOC_LIB) $(LOCAL_LIBS)
689#endif /* !LD_HAS_NO_DASH_L */
690
691#if defined (READLINE)
692# if defined (HAVE_TERMCAP_SOURCE)
693TERMCAP_DEP = $(TERMCAP_LIBRARY)
694# endif /* HAVE_TERMCAP_SOURCE */
695# if defined (HAVE_READLINE_SOURCE)
696READLINE_DEP = $(READLINE_LIBRARY)
697# endif /* HAVE_READLINE_SOURCE */
698#endif /* READLINE */
699
700#if defined (HISTORY) && defined (HAVE_HISTORY_SOURCE) && !defined (READLINE)
701HISTORY_DEP = $(HISTORY_LIBRARY)
702#endif
703
704#if defined (USE_GLOB_LIBRARY)
705GLOB_DEP = $(GLOB_LIBRARY)
706#else
707GLOBC = glob.c fnmatch.c
708GLOBO = glob.o fnmatch.o
709#endif /* USE_GLOB_LIBRARY */
710
711#if defined (HAVE_TILDE_SOURCE)
712TILDE_DEP = $(TILDE_LIBRARY)
713#endif
714
715/**/# Source files for libraries that Bash depends on.
716LIBDEP = $(READLINE_DEP) $(TERMCAP_DEP) $(GLOB_DEP) $(HISTORY_DEP) $(TILDE_DEP) $(MALLOC_DEP)
717
718/**/# Rules for cleaning the readline and termcap sources.
719#if defined (HAVE_READLINE_SOURCE)
720CLEAN_READLINE = (cd $(RL_LIBDIR); $(MAKE) $(MFLAGS) $@)
721#else
722CLEAN_READLINE = :
723#endif /* !HAVE_READLINE_SOURCE */
724
725#if defined (HAVE_HISTORY_SOURCE)
726# if !defined (READLINE)
727CLEAN_HISTORY = (cd $(HIST_LIBDIR); $(MAKE) $(MFLAGS) $@)
728# else
729CLEAN_HISTORY = :
730# endif /* READLINE */
731#endif /* !HAVE_HISTORY_SOURCE */
732
733#if defined (HAVE_TERMCAP_SOURCE)
734CLEAN_TERMCAP = (cd $(TERM_LIBDIR); $(MAKE) $(MFLAGS) $@)
735#else
736CLEAN_TERMCAP = :
737#endif /* !HAVE_TERMCAP_SOURCE */
738
739#if defined (USE_GLOB_LIBRARY)
740CLEAN_GLOB = (cd $(GLOB_LIBDIR); $(MAKE) $(MFLAGS) $@)
741#else
742CLEAN_GLOB = :
743#endif /* !USE_GLOB_LIBRARY */
744
745#if defined (HAVE_TILDE_SOURCE)
746CLEAN_TILDE = (cd $(TILDE_LIBDIR); $(MAKE) $(MFLAGS) $@)
747#else
748CLEAN_TILDE = :
749#endif /* !HAVE_TILDE_SOURCE */
750
751#if defined (USE_GNU_MALLOC_LIBRARY)
752CLEAN_MALLOC = (cd $(MALLOC_LIBDIR); $(MAKE) $(MFLAGS) $@)
753#else
754CLEAN_MALLOC = :
755#endif /* !USE_GNU_MALLOC_LIBRARY */
756
757LIBRARY_LDFLAGS = $(READLINE_LDFLAGS) $(HISTORY_LDFLAGS) $(TILDE_LDFLAGS) \
758 $(GLOB_LDFLAGS) $(MALLOC_LDFLAGS)
759
760/**/# The directory which contains the source for malloc. The name must
761/**/# end in a slash, as in "./lib/malloc/".
762ALLOC_LIBSRC = $(LIBSRC)malloc/
763ALLOC_LIBDIR = $(LIBPATH)malloc/
764ALLOC_ABSSRC = $${topdir}/$(ALLOC_LIBDIR)
765
766/**/# Our malloc.
767#if defined (USE_GNU_MALLOC) && !defined (USE_GNU_MALLOC_LIBRARY)
768
769MALLOC_OBJ = $(ALLOC_LIBDIR)malloc.o
770MALLOC_SRC = $(ALLOC_LIBSRC)malloc.c
771MALLOC_DEP = $(MALLOC_SRC) $(ALLOC_LIBSRC)getpagesize.h
772MALLOC_FLAGS = -Drcheck -Dbotch=programming_error
773
774MALLOC_LIBRARY =
775
776#endif /* USE_GNU_MALLOC && !USE_GNU_MALLOC_LIBRARY */
777
778/* If this user doesn't have alloca (), then we must try to supply them
779 with a working one. */
780#if !defined (HAVE_ALLOCA)
781ALLOCA = $(ALLOC_LIBDIR)alloca.o
782# if defined (ALLOCA_ASM)
783ALLOCA_SOURCE = ALLOCA_ASM
784ALLOCA_OBJECT = ALLOCA_OBJ
785# else
786ALLOCA_SOURCE = alloca.c
787ALLOCA_OBJECT = alloca.o
788# endif /* ALLOCA_ASM */
789ALLOCA_DEP = $(ALLOC_LIBSRC)$(ALLOCA_SOURCE)
790#endif /* !HAVE_ALLOCA */
791
792/* Compilation flags to use in the shell directory and to pass to builds
793 in subdirectories (readline, termcap) to ensure that alloca is treated
794 in a consistent fashion. */
795#if defined (HAVE_ALLOCA_H)
796ALLOCA_H_DEFINE = -DHAVE_ALLOCA_H
797#else
798ALLOCA_H_DEFINE =
799#endif /* HAVE_ALLOCA_H */
800
801#if defined (HAVE_ALLOCA)
802ALLOCA_DEFINE = -DHAVE_ALLOCA
803#else
804ALLOCA_DEFINE =
805#endif /* HAVE_ALLOCA */
806
807ALLOCA_CFLAGS = $(ALLOCA_DEFINE) $(ALLOCA_H_DEFINE)
808
809/* Protect the `i386' used in the definition of ALLOC_FILES. */
810#if defined (i386)
811# undef i386
812# define i386_defined
813#endif /* i386 */
814
815ALLOC_HEADERS = $(ALLOC_LIBSRC)getpagesize.h
816ALLOC_FILES = $(ALLOC_LIBSRC)malloc.c $(ALLOC_LIBSRC)alloca.c \
817 $(ALLOC_LIBSRC)i386-alloca.s $(ALLOC_LIBSRC)x386-alloca.s \
818 $(ALLOC_LIBSRC)xmalloc.c
819
820/* Perhaps restore the `i386' define. */
821#if defined (i386_defined)
822# define i386
823# undef i386_defined
824#endif /* i386_defined */
825
826#if defined (USE_GNU_MALLOC) && !defined (USE_GNU_MALLOC_LIBRARY)
827$(MALLOC_OBJ): $(MALLOC_DEP)
828 @sh $(SUPPORT_SRC)mkdirs $(ALLOC_LIBDIR)
829 @$(RM) $@
830 @($(LIBINC_DECL); cd $(ALLOC_LIBDIR) ; \
831 if [ ! -f Makefile ]; then cp $(ALLOC_ABSSRC)Makefile Makefile ; fi; \
832 $(MAKE) $(MFLAGS) \
833 CFLAGS='$(LIBRARY_CFLAGS) $(MALLOC_FLAGS)' \
834 CPPFLAGS='$(CPPFLAGS)' MALLOC_SOURCE=$(MALLOC_SRC) \
835 srcdir=$(ALLOC_ABSSRC) malloc.o )
836#endif /* USE_GNU_MALLOC && !USE_GNU_MALLOC_LIBRARY */
837
838#if !defined (HAVE_ALLOCA)
839$(ALLOCA): $(ALLOCA_DEP)
840 @sh $(SUPPORT_SRC)mkdirs $(ALLOC_LIBDIR)
841 @$(RM) $@
842 @($(LIBINC_DECL); cd $(ALLOC_LIBDIR) ; \
843 if [ ! -f Makefile ]; then cp $(ALLOC_ABSSRC)Makefile Makefile ; fi; \
844 $(MAKE) $(MFLAGS) CC='$(CC)' \
845 CFLAGS='$(LIBRARY_CFLAGS) $(MALLOC_FLAGS)' \
846 CPPFLAGS='$(CPPFLAGS)' ALLOCA_SOURCE=$(ALLOCA_SOURCE) \
847 ALLOCA_OBJECT=$(ALLOCA_OBJECT) \
848 srcdir=$(ALLOC_ABSSRC) alloca.o )
849#endif /* !HAVE_ALLOCA */
850
851/**/# The location of ranlib on your system.
852#if defined (RANLIB_LOCATION)
853RANLIB = RANLIB_LOCATION
854#else
855RANLIB = ranlib
856#endif /* RANLIB_LOCATION */
857
858/* **************************************************************** */
859/* */
860/* Support for optional object files */
861/* */
862/* **************************************************************** */
863#if !defined (HAVE_SYS_SIGLIST)
864/**/# Since this system does not have sys_siglist, we define SIGLIST
865/**/# as siglist.o.
866SIGLIST = siglist.o
867SIGLIST_FLAG=-DINITIALIZE_SIGLIST
868#endif /* HAVE_SYS_SIGLIST */
869
870#if !defined (HAVE_GETCWD)
871/**/# Since this system does not have a correctly working getcwd (),
872/**/# we define GETCWD as getcwd.o.
873GETCWD = getcwd.o
874#endif /* !HAVE_GETCWD */
875
876/**/# The source and object of the curly brace expansion and completion code.
877BRACES_SOURCE = braces.c
878BRACECOMP_SOURCE = bracecomp.c
879#if defined (BRACE_EXPANSION)
880BRACES_OBJECT = braces.o
881# if defined (READLINE)
882BRACECOMP_OBJECT = bracecomp.o
883# endif /* READLINE */
884#endif /* BRACE_EXPANSION */
885
886#if defined (REQUIRED_LIBRARIES)
887/**/# Locally required libraries.
888LOCAL_LIBS = REQUIRED_LIBRARIES
889#endif /* REQUIRED_LIBRARIES */
890
891BUILTINS_LIB = builtins/libbuiltins.a
892
893/**/# The main source code for the Bourne Again SHell.
894CSOURCES = shell.c parse.y general.c make_cmd.c print_cmd.c y.tab.c \
895 dispose_cmd.c execute_cmd.c variables.c $(GLOBC) version.c \
896 expr.c copy_cmd.c flags.c subst.c hash.c mailcheck.c \
897 test.c trap.c jobs.c nojobs.c $(ALLOC_FILES) $(BRACES_SOURCE) \
898 vprint.c input.c bashhist.c \
899 unwind_prot.c siglist.c getcwd.c $(RL_SUPPORT_SRC) error.c
900
901HSOURCES = shell.h flags.h trap.h hash.h jobs.h builtins.h alias.c y.tab.h \
902 general.h variables.h config.h $(ALLOC_HEADERS) alias.h maxpath.h \
903 quit.h machines.h posixstat.h filecntl.h unwind_prot.h parser.h \
904 command.h input.h error.h bashansi.h dispose_cmd.h make_cmd.h \
905 subst.h externs.h siglist.h bashhist.h bashtypes.h
906
907SOURCES = $(CSOURCES) $(HSOURCES) $(BUILTIN_DEFS)
908
909/**/# Matching object files.
910OBJECTS = shell.o y.tab.o general.o make_cmd.o print_cmd.o $(GLOBO) \
911 dispose_cmd.o execute_cmd.o variables.o copy_cmd.o error.o \
912 expr.o flags.o jobs.o subst.o hash.o mailcheck.o test.o \
913 trap.o alias.o $(MALLOC_OBJ) $(ALLOCA) $(BRACES_OBJECT) \
914 unwind_prot.o $(VPRINT_OBJ) input.o $(HIST_SUPPORT_OBJ) \
915 $(SIGLIST) $(GETCWD) version.o $(RL_SUPPORT_OBJ) $(BUILTINS_LIB)
916
917/**/# Where the source code of the shell builtins resides.
918BUILTIN_SRCDIR=$(srcdir)/builtins/
919/**/# The trailing slash was left off this definition on purpose
920BUILTIN_ABSSRC=$${topdir}/builtins
921DEFDIR = builtins/
922BUILTIN_DEFS = $(DEFDIR)alias.def $(DEFDIR)bind.def $(DEFDIR)break.def \
923 $(DEFDIR)builtin.def $(DEFDIR)cd.def $(DEFDIR)colon.def \
924 $(DEFDIR)command.def $(DEFDIR)declare.def $(LOAD_DEF) \
925 $(DEFDIR)echo.def $(DEFDIR)enable.def $(DEFDIR)eval.def \
926 $(DEFDIR)exec.def $(DEFDIR)exit.def $(DEFDIR)fc.def \
927 $(DEFDIR)fg_bg.def $(DEFDIR)hash.def $(DEFDIR)help.def \
928 $(DEFDIR)history.def $(DEFDIR)jobs.def $(DEFDIR)kill.def \
929 $(DEFDIR)let.def $(DEFDIR)read.def $(DEFDIR)return.def \
930 $(DEFDIR)set.def $(DEFDIR)setattr.def $(DEFDIR)shift.def \
931 $(DEFDIR)source.def $(DEFDIR)suspend.def $(DEFDIR)test.def \
932 $(DEFDIR)times.def $(DEFDIR)trap.def $(DEFDIR)type.def \
933 $(DEFDIR)ulimit.def $(DEFDIR)umask.def $(DEFDIR)wait.def \
934 $(DEFDIR)getopts.def $(DEFDIR)reserved.def
935BUILTIN_C_SRC = $(DEFDIR)mkbuiltins.c $(DEFDIR)common.c \
936 $(DEFDIR)hashcom.h $(DEFDIR)/bashgetopt.c $(GETOPT_SOURCE)
937BUILTIN_C_OBJ = $(GETOPTS_OBJ) $(DEFDIR)common.o $(DEFDIR)bashgetopt.o
938BUILTIN_OBJS = $(DEFDIR)alias.o $(DEFDIR)bind.o $(DEFDIR)break.o \
939 $(DEFDIR)builtin.o $(DEFDIR)cd.o $(DEFDIR)colon.o \
940 $(DEFDIR)command.o $(DEFDIR)declare.o $(LOAD_OBJ) \
941 $(DEFDIR)echo.o $(DEFDIR)enable.o $(DEFDIR)eval.o \
942 $(DEFDIR)exec.o $(DEFDIR)exit.o $(DEFDIR)fc.o \
943 $(DEFDIR)fg_bg.o $(DEFDIR)hash.o $(DEFDIR)help.o \
944 $(DEFDIR)history.o $(DEFDIR)jobs.o $(DEFDIR)kill.o \
945 $(DEFDIR)let.o $(DEFDIR)read.o $(DEFDIR)return.o \
946 $(DEFDIR)set.o $(DEFDIR)setattr.o $(DEFDIR)shift.o \
947 $(DEFDIR)source.o $(DEFDIR)suspend.o $(DEFDIR)test.o \
948 $(DEFDIR)times.o $(DEFDIR)trap.o $(DEFDIR)type.o \
949 $(DEFDIR)ulimit.o $(DEFDIR)umask.o $(DEFDIR)wait.o \
950 $(BUILTIN_C_OBJ)
951#if defined (GETOPTS_BUILTIN)
952GETOPTS_OBJ = $(DEFDIR)getopts.o
953#endif
954GETOPT_SOURCE = $(DEFDIR)getopt.c $(DEFDIR)getopt.h
955PSIZE_SOURCE = $(DEFDIR)psize.sh $(DEFDIR)psize.c
956BUILTIN_SUPPORT = $(DEFDIR)Makefile $(DEFDIR)ChangeLog $(PSIZE_SOURCE) \
957 $(BUILTIN_C_SRC)
958
959/**/# Documentation for the shell.
960DOCDIR = $(srcdir)/documentation/
961BASH_TEXINFO = $(DOCDIR)*.texi $(DOCDIR)*.tex \
962 $(DOCDIR)*.dvi $(DOCDIR)Makefile
963BASH_MAN = $(DOCDIR)bash.1
964BASHDOCS = $(BASH_TEXINFO) $(BASH_MAN) INSTALL README RELEASE
965DOCUMENTATION = $(BASHDOCS) $(LIBRARY_DOC)
966
967/**/# Some example files demonstrating use of the shell.
968/* This has to be written funny to avoid looking like a comment starter. */
969EXAMPLES = examples/[a-zA-Z]*
970
971ENDIAN_SUPPORT = endian.c
972#if !defined (HAVE_WAIT_H)
973ENDIAN_HEADER = bash_endian.h
974#else
975ENDIAN_HEADER =
976#endif
977ENDIAN_OUTPUT = endian.aux $(ENDIAN_HEADER)
978
979SIGNAMES_SUPPORT = signames.c
980SIGNAMES_OUTPUT = signames.aux signames.h
981
982SUPPORT_SRC = $(srcdir)/support/
983SDIR = ./support/
984MKTARFILE = $(SDIR)mktarfile
985SCRIPTS_SUPPORT = $(SUPPORT_SRC)mksysdefs $(SUPPORT_SRC)cppmagic \
986 $(SUPPORT_SRC)cat-s $(MKTARFILE) $(SUPPORT_SRC)mail-shell \
987 $(SUPPORT_SRC)inform $(SUPPORT_SRC)/fixdist \
988 $(SUPPORT_SRC)mklinks $(SUPPORT_SRC)PORTING \
989 $(SUPPORT_SRC)/clone.bash
990FAQ = $(SUPPORT_SRC)FAQ
991
992TEST_SUITE = ./test-suite/
993TEST_SUITE_SUPPORT = $(TEST_SUITE)[a-zA-Z0-9]* $(SUPPORT_SRC)recho.c
994
995CREATED_SUPPORT = $(ENDIAN_OUTPUT) $(SIGNAMES_OUTPUT) sysdefs.h \
996 $(SDIR)getcppsyms recho tests/recho tests/printenv
997
998SUPPORT = configure $(ENDIAN_SUPPORT) $(SIGNAMES_SUPPORT) $(SCRIPTS_SUPPORT) \
999 $(BUILTIN_SUPPORT) COPYING Makefile cpp-Makefile ChangeLog \
1000 .distribution newversion.c $(EXAMPLES) $(SUPPORT_SRC)bash.xbm \
1001 $(FAQ) $(SUPPORT_SRC)getcppsyms.c $(TEST_SUITE_SUPPORT)
1002
1003/**/# BAGGAGE consists of things that you want to keep with the shell for some
1004/**/# reason, but do not actually use; old source code, etc.
1005BAGGAGE =
1006
1007/**/# Things that the world at large needs.
1008THINGS_TO_TAR = $(SOURCES) $(LIBRARY_TAR) $(BASHDOCS) $(SUPPORT) $(BAGGAGE)
1009
1010/**/# Keep GNU Make from exporting the entire environment for small machines.
1011.NOEXPORT:
1012
1013.made: $(Program) bashbug
1014 cp .machine .made
1015
1016$(Program): .build $(OBJECTS) $(LIBDEP) $(srcdir)/.distribution
1017 $(RM) $@
1018 $(PURIFY) $(CC) $(LDFLAGS) $(LIBRARY_LDFLAGS) -o $(Program) $(OBJECTS) $(LIBRARIES)
1019 ls -l $(Program)
1020 size $(Program)
1021
1022.build: $(SOURCES) cpp-Makefile newversion.aux
1023 if ./newversion.aux -dir $(srcdir) -build; then mv -f newversion.h version.h; fi
1024 @echo
1025 @echo " ***************************************************"
1026 @echo " * *"
1027 @echo " * Making Bash-`cat $(srcdir)/.distribution`.`cat $(srcdir)/.patchlevel` for a $(Machine) running $(OS)"
1028 @echo " * *"
1029 @echo " ***************************************************"
1030 @echo
1031 @echo "$(Program) last made for a $(Machine) running $(OS)" >.machine
1032
1033bashbug: $(SUPPORT_SRC)bashbug.sh cpp-Makefile newversion.aux
1034 @sed -e "s:@MACHINE@:$(Machine):" -e "s:@OS@:$(OS):" \
1035 -e "s:@CFLAGS@:$(CCFLAGS):" -e "s:@CC@:$(CC):" \
1036 -e "s:@RELEASE@:`cat $(srcdir)/.distribution`:" \
1037 -e "s:@PATCHLEVEL@:`cat $(srcdir)/.patchlevel`:" \
1038 $(SUPPORT_SRC)bashbug.sh > $@
1039 @chmod a+rx bashbug
1040
1041version.h: newversion.aux
1042 if ./newversion.aux -dir $(srcdir) -build; then mv -f newversion.h version.h; fi
1043
1044y.tab.c: parser-built
1045y.tab.h: parser-built
1046parser-built: parse.y parser.h command.h stdc.h input.h
1047 $(RM) $@
1048 -if test -f y.tab.h; then mv -f y.tab.h old-y.tab.h; fi
1049 @echo expect 66 shift/reduce conflicts
1050 $(BISON) -d $(srcdir)/parse.y
1051 -if cmp -s old-y.tab.h y.tab.h; then mv old-y.tab.h y.tab.h; fi
1052 touch $@
1053
1054#if defined (READLINE) && defined (HAVE_READLINE_SOURCE)
1055$(READLINE_LIBRARY): $(READLINE_SOURCE)
1056 build_lib_in_dir ($(RL_LIBDIR), libreadline.a, srcdir=$(RL_ABSSRC), $(RL_ABSSRC)Makefile)
1057#endif /* READLINE && HAVE_READLINE_SOURCE */
1058
1059#if defined (HISTORY) && defined (HAVE_HISTORY_SOURCE) && !defined (READLINE)
1060$(HISTORY_LIBRARY): $(HISTORY_SOURCE)
1061 build_lib_in_dir ($(HIST_LIBDIR), libhistory.a, srcdir=$(HIST_ABSSRC), $(HIST_ABSSRC)Makefile)
1062#endif /* HISTORY && HAVE_HISTORY_SOURCE && !READLINE */
1063
1064#if defined (HAVE_TERMCAP_SOURCE)
1065$(TERMCAP_LIBRARY): $(TERMCAP_SOURCE)
1066 build_lib_in_dir ($(TERM_LIBDIR), libtermcap.a, srcdir=$(TERM_ABSSRC), $(TERM_ABSSRC)Makefile)
1067#endif /* HAVE_TERMCAP_SOURCE */
1068
1069#if defined (USE_GLOB_LIBRARY)
1070$(GLOB_LIBRARY): $(GLOB_SOURCE)
1071 build_lib_in_dir ($(GLOB_LIBDIR), libglob.a, srcdir=$(GLOB_ABSSRC), $(GLOB_ABSSRC)Makefile)
1072#endif /* USE_GLOB_LIBRARY */
1073
1074#if defined (HAVE_TILDE_SOURCE)
1075$(TILDE_LIBRARY): $(TILDE_SOURCE)
1076 build_lib_in_dir ($(TILDE_LIBDIR), libtilde.a, srcdir=$(TILDE_ABSSRC), $(TILDE_ABSSRC)Makefile)
1077#endif /* HAVE_TILDE_SOURCE */
1078
1079#if defined (USE_GNU_MALLOC) && defined (USE_GNU_MALLOC_LIBRARY)
1080$(MALLOC_LIBRARY): $(MALLOC_SOURCE)
1081 build_lib_in_dir ($(MALLOC_LIBDIR), libmalloc.a, srcdir=$(MALLOC_ABSSRC), $(MALLOC_ABSSRC)Makefile)
1082#endif /* USE_GNU_MALLOC && USE_GNU_MALLOC_LIBRARY */
1083
1084version.o: version.c version.h
1085
1086shell.o: shell.c shell.h flags.h shell.c posixstat.h filecntl.h stdc.h $(ENDIAN_HEADER) parser.h
1087 $(RM) $@
1088 $(CC) $(CFG_FLAGS) $(CCFLAGS) $(CPPFLAGS) -c $(srcdir)/shell.c
1089
1090#if !defined (HAVE_WAIT_H)
1091$(ENDIAN_HEADER): endian.aux
1092 $(RM) $@
1093 ./endian.aux $@
1094#endif
1095
1096signames.h: signames.aux
1097 $(RM) $@
1098 ./signames.aux $@
1099
1100variables.o: variables.c shell.h hash.h flags.h variables.h
1101 $(RM) $@
1102 $(CC) -c $(CCFLAGS) $(HOSTTYPE_DECL) $(CPPFLAGS) $(srcdir)/variables.c
1103
1104builtins/libbuiltins.a: $(BUILTIN_OBJS) config.h memalloc.h
1105 build_builtins (libbuiltins.a)
1106
1107#if 0
1108/* This is a nice idea, but it does not work right, and the syntax is
1109 not universally available. */
1110$(BUILTIN_OBJS): $(BUILTIN_DEFS)
1111 build_builtins ($(@F))
1112#endif
1113
1114builtins/common.o: $(BUILTIN_SRCDIR)common.c
1115 build_builtins (common.o)
1116builtins/bashgetopt.o: $(BUILTIN_SRCDIR)bashgetopt.c
1117 build_builtins (bashgetopt.o)
1118
1119builtins/builtext.h: builtins/libbuiltins.a
1120
1121/* Dependencies for the main bash source. */
1122copy_cmd.o: shell.h command.h stdc.h hash.h
1123copy_cmd.o: general.h variables.h config.h memalloc.h quit.h
1124copy_cmd.o: dispose_cmd.h make_cmd.h subst.h externs.h
1125dispose_cmd.o: shell.h command.h stdc.h
1126dispose_cmd.o: general.h variables.h config.h memalloc.h quit.h
1127dispose_cmd.o: dispose_cmd.h make_cmd.h subst.h externs.h
1128error.o: error.h
1129execute_cmd.o: shell.h command.h stdc.h y.tab.h posixstat.h flags.h jobs.h
1130execute_cmd.o: general.h variables.h config.h memalloc.h quit.h hash.h
1131execute_cmd.o: unwind_prot.h siglist.h builtins/builtext.h
1132execute_cmd.o: dispose_cmd.h make_cmd.h subst.h externs.h bashtypes.h
1133expr.o: shell.h command.h stdc.h hash.h
1134expr.o: general.h variables.h config.h memalloc.h quit.h
1135expr.o: dispose_cmd.h make_cmd.h subst.h externs.h
1136flags.o: flags.h stdc.h config.h memalloc.h general.h quit.h
1137general.o: shell.h command.h stdc.h maxpath.h
1138general.o: general.h variables.h config.h memalloc.h quit.h machines.h
1139general.o: dispose_cmd.h make_cmd.h subst.h externs.h stdc.h
1140hash.o: shell.h command.h stdc.h hash.h
1141hash.o: general.h variables.h config.h memalloc.h quit.h
1142hash.o: dispose_cmd.h make_cmd.h subst.h externs.h stdc.h
1143jobs.o: shell.h command.h stdc.h hash.h trap.h jobs.h siglist.h
1144jobs.o: general.h variables.h config.h memalloc.h quit.h
1145jobs.o: dispose_cmd.h make_cmd.h subst.h externs.h builtins/builtext.h
1146mailcheck.o: posixstat.h maxpath.h variables.h
1147mailcheck.o: hash.h quit.h
1148make_cmd.o: shell.h command.h stdc.h flags.h input.h bashtypes.h
1149make_cmd.o: general.h variables.h config.h memalloc.h quit.h
1150make_cmd.o: dispose_cmd.h make_cmd.h subst.h externs.h
1151y.tab.o: shell.h command.h stdc.h flags.h maxpath.h alias.h
1152y.tab.o: general.h variables.h config.h memalloc.h quit.h
1153y.tab.o: dispose_cmd.h make_cmd.h subst.h externs.h bashtypes.h
1154print_cmd.o: shell.h command.h stdc.h y.tab.h
1155print_cmd.o: general.h variables.h config.h memalloc.h quit.h
1156print_cmd.o: dispose_cmd.h make_cmd.h subst.h externs.h
1157shell.o: shell.h command.h stdc.h flags.h machines.h
1158shell.o: general.h variables.h config.h memalloc.h quit.h
1159shell.o: dispose_cmd.h make_cmd.h subst.h externs.h
1160shell.o: posixstat.h filecntl.h jobs.h input.h
1161subst.o: shell.h command.h stdc.h flags.h jobs.h siglist.h bashtypes.h
1162subst.o: general.h variables.h config.h memalloc.h quit.h
1163subst.o: dispose_cmd.h make_cmd.h subst.h externs.h execute_cmd.h
1164test.o: posixstat.h
1165trap.o: trap.h shell.h command.h stdc.h hash.h unwind_prot.h signames.h
1166trap.o: general.h variables.h config.h memalloc.h quit.h
1167trap.o: dispose_cmd.h make_cmd.h subst.h externs.h
1168unwind_prot.o: config.h memalloc.h general.h unwind_prot.h
1169variables.o: shell.h command.h stdc.h hash.h flags.h
1170variables.o: config.h memalloc.h general.h variables.h quit.h
1171variables.o: execute_cmd.h dispose_cmd.h make_cmd.h subst.h externs.h
1172version.o: version.h .build
1173
1174alias.o: ansi_stdlib.h
1175bashline.o: ansi_stdlib.h
1176variables.o: ansi_stdlib.h
1177shell.o: ansi_stdlib.h
1178error.o: ansi_stdlib.h
1179hash.o: ansi_stdlib.h
1180signames.o: ansi_stdlib.h
1181expr.o: ansi_stdlib.h
1182general.o: ansi_stdlib.h
1183input.o: ansi_stdlib.h
1184
1185#if !defined (JOB_CONTROL)
1186jobs.o: nojobs.c
1187#endif /* !JOB_CONTROL */
1188
1189#if defined (BRACE_EXPANSION)
1190braces.o: general.h shell.h variables.h quit.h config.h memalloc.h
1191braces.o: dispose_cmd.h make_cmd.h subst.h externs.h
1192braces.o: maxpath.h unwind_prot.h command.h stdc.h
1193# if defined (READLINE)
1194bracecomp.o: bracecomp.c
1195bracecomp.o: shell.h command.h hash.h builtins.h general.h variables.h
1196bracecomp.o: quit.h alias.h
1197bracecomp.o: dispose_cmd.h make_cmd.h subst.h externs.h stdc.h
1198# if defined (HAVE_READLINE_SOURCE)
1199bracecomp.o: $(RL_LIBSRC)readline.h
1200# endif /* HAVE_READLINE_SOURCE */
1201# endif /* READLINE */
1202#endif /* BRACE_EXPANSION */
1203
1204#if defined (READLINE)
1205bashline.o: shell.h command.h stdc.h hash.h builtins.h execute_cmd.h
1206bashline.o: general.h variables.h config.h memalloc.h quit.h alias.h
1207bashline.o: dispose_cmd.h make_cmd.h subst.h externs.h
1208#endif /* READLINE */
1209
1210/* Dependencies which rely on the user using the source to READLINE. */
1211#if defined (READLINE) && defined (HAVE_READLINE_SOURCE)
1212bashline.o: $(RL_LIBSRC)chardefs.h $(RL_LIBSRC)readline.h $(RL_LIBSRC)keymaps.h
1213y.tab.o: $(RL_LIBSRC)keymaps.h $(RL_LIBSRC)chardefs.h $(RL_LIBSRC)readline.h
1214#endif /* READLINE && HAVE_READLINE_SOURCE */
1215
1216#if defined (HISTORY) && defined (HAVE_HISTORY_SOURCE)
1217subst.o: $(HIST_LIBSRC)history.h
1218bashline.o: $(HIST_LIBSRC)history.h
1219y.tab.o: $(HIST_LIBSRC)history.h
1220#endif /* HISTORY && HAVE_HISTORY_SOURCE */
1221
1222#if defined (USE_GLOB_LIBRARY)
1223subst.o: $(GLOB_LIBSRC)fnmatch.h
1224execute_cmd.o: $(GLOB_LIBSRC)fnmatch.h
1225#endif /* USE_GLOB_LIBRARY */
1226
1227#if defined (HAVE_TILDE_SOURCE)
1228execute_cmd.o: $(TILDE_LIBSRC)tilde.h
1229general.o: $(TILDE_LIBSRC)tilde.h
1230mailcheck.o: $(TILDE_LIBSRC)tilde.h
1231shell.o: $(TILDE_LIBSRC)tilde.h
1232subst.o: $(TILDE_LIBSRC)tilde.h
1233variables.o: $(TILDE_LIBSRC)tilde.h
1234#endif /* HAVE_TILDE_SOURCE */
1235
1236/* Dependencies for the shell builtins. */
1237builtins/common.o: shell.h command.h config.h memalloc.h general.h error.h
1238builtins/common.o: variables.h input.h $(DEFDIR)hashcom.h siglist.h
1239builtins/common.o: quit.h unwind_prot.h maxpath.h jobs.h builtins.h
1240builtins/common.o: dispose_cmd.h make_cmd.h subst.h externs.h bashhist.h
1241builtins/common.o: execute_cmd.h stdc.h
1242builtins/alias.o: command.h config.h memalloc.h error.h general.h maxpath.h
1243builtins/alias.o: quit.h builtins/common.h
1244builtins/alias.o: shell.h command.h stdc.h unwind_prot.h variables.h
1245builtins/alias.o: dispose_cmd.h make_cmd.h subst.h externs.h
1246builtins/bind.o: command.h config.h memalloc.h error.h general.h maxpath.h
1247builtins/bind.o: dispose_cmd.h make_cmd.h subst.h externs.h stdc.h
1248builtins/bind.o: shell.h unwind_prot.h variables.h quit.h
1249builtins/bind.o: $(DEFDIR)bashgetopt.h
1250builtins/break.o: command.h config.h memalloc.h error.h general.h maxpath.h
1251builtins/break.o: shell.h unwind_prot.h variables.h quit.h
1252builtins/break.o: dispose_cmd.h make_cmd.h subst.h externs.h stdc.h
1253builtins/builtin.o: command.h config.h memalloc.h error.h general.h maxpath.h
1254builtins/builtin.o: quit.h $(DEFDIR)common.h
1255builtins/builtin.o: shell.h unwind_prot.h variables.h
1256builtins/builtin.o: dispose_cmd.h make_cmd.h subst.h externs.h stdc.h
1257builtins/cd.o: command.h config.h memalloc.h error.h general.h maxpath.h quit.h
1258builtins/cd.o: shell.h unwind_prot.h variables.h $(DEFDIR)common.h
1259builtins/cd.o: dispose_cmd.h make_cmd.h subst.h externs.h stdc.h
1260builtins/command.o: command.h config.h memalloc.h error.h general.h maxpath.h
1261builtins/command.o: quit.h $(DEFDIR)bashgetopt.h
1262builtins/command.o: shell.h unwind_prot.h variables.h
1263builtins/command.o: dispose_cmd.h make_cmd.h subst.h externs.h stdc.h
1264builtins/declare.o: command.h config.h memalloc.h error.h general.h maxpath.h
1265builtins/declare.o: shell.h unwind_prot.h variables.h quit.h
1266builtins/declare.o: dispose_cmd.h make_cmd.h subst.h externs.h stdc.h
1267builtins/echo.o: command.h config.h memalloc.h error.h general.h maxpath.h
1268builtins/echo.o: shell.h unwind_prot.h variables.h quit.h
1269builtins/echo.o: dispose_cmd.h make_cmd.h subst.h externs.h stdc.h
1270builtins/enable.o: command.h config.h memalloc.h error.h general.h maxpath.h
1271builtins/enable.o: shell.h unwind_prot.h variables.h quit.h
1272builtins/enable.o: dispose_cmd.h make_cmd.h subst.h externs.h stdc.h
1273builtins/eval.o: command.h config.h memalloc.h error.h general.h maxpath.h quit.h
1274builtins/eval.o: shell.h unwind_prot.h variables.h
1275builtins/eval.o: dispose_cmd.h make_cmd.h subst.h externs.h stdc.h
1276builtins/exec.o: command.h config.h memalloc.h error.h general.h maxpath.h quit.h
1277builtins/exec.o: shell.h unwind_prot.h variables.h $(DEFDIR)common.h stdc.h
1278builtins/exec.o: dispose_cmd.h make_cmd.h subst.h externs.h execute_cmd.h
1279builtins/exec.o: flags.h
1280builtins/exit.o: command.h config.h memalloc.h error.h general.h maxpath.h
1281builtins/exit.o: shell.h unwind_prot.h variables.h quit.h
1282builtins/exit.o: dispose_cmd.h make_cmd.h subst.h externs.h stdc.h
1283builtins/fc.o: builtins.h command.h stdc.h
1284builtins/fc.o: command.h config.h memalloc.h error.h general.h maxpath.h quit.h
1285builtins/fc.o: flags.h unwind_prot.h variables.h shell.h
1286builtins/fc.o: dispose_cmd.h make_cmd.h subst.h externs.h stdc.h
1287builtins/fc.o: $(DEFDIR)bashgetopt.h bashhist.h
1288builtins/fg_bg.o: command.h config.h memalloc.h error.h general.h maxpath.h
1289builtins/fg_bg.o: shell.h unwind_prot.h variables.h quit.h
1290builtins/fg_bg.o: dispose_cmd.h make_cmd.h subst.h externs.h stdc.h
1291builtins/getopts.o: command.h config.h memalloc.h error.h general.h maxpath.h
1292builtins/getopts.o: shell.h unwind_prot.h variables.h quit.h
1293builtins/getopts.o: dispose_cmd.h make_cmd.h subst.h externs.h stdc.h
1294builtins/hash.o: builtins.h command.h execute_cmd.h stdc.h
1295builtins/hash.o: command.h config.h memalloc.h error.h general.h maxpath.h
1296builtins/hash.o: shell.h unwind_prot.h variables.h $(DEFDIR)common.h quit.h
1297builtins/help.o: command.h config.h memalloc.h error.h general.h maxpath.h
1298builtins/help.o: dispose_cmd.h make_cmd.h subst.h externs.h stdc.h
1299builtins/help.o: shell.h unwind_prot.h variables.h quit.h
1300builtins/history.o: command.h config.h memalloc.h error.h general.h maxpath.h
1301builtins/history.o: quit.h dispose_cmd.h make_cmd.h subst.h externs.h stdc.h
1302builtins/history.o: filecntl.h shell.h unwind_prot.h variables.h
1303builtins/history.o: bashhist.h
1304builtins/inlib.o: command.h config.h memalloc.h error.h general.h maxpath.h
1305builtins/inlib.o: shell.h unwind_prot.h variables.h quit.h
1306builtins/inlib.o: dispose_cmd.h make_cmd.h subst.h externs.h stdc.h
1307builtins/jobs.o: command.h config.h memalloc.h error.h general.h maxpath.h
1308builtins/jobs.o: quit.h $(DEFDIR)bashgetopt.h
1309builtins/jobs.o: shell.h unwind_prot.h variables.h
1310builtins/jobs.o: dispose_cmd.h make_cmd.h subst.h externs.h stdc.h
1311builtins/kill.o: command.h config.h memalloc.h error.h general.h maxpath.h
1312builtins/kill.o: quit.h dispose_cmd.h make_cmd.h subst.h externs.h stdc.h
1313builtins/kill.o: shell.h trap.h unwind_prot.h variables.h
1314builtins/let.o: command.h config.h memalloc.h error.h general.h maxpath.h
1315builtins/let.o: quit.h dispose_cmd.h make_cmd.h subst.h externs.h stdc.h
1316builtins/let.o: shell.h unwind_prot.h variables.h
1317builtins/read.o: command.h config.h memalloc.h error.h general.h maxpath.h
1318builtins/read.o: quit.h dispose_cmd.h make_cmd.h subst.h externs.h stdc.h
1319builtins/read.o: shell.h unwind_prot.h variables.h
1320builtins/return.o: command.h config.h memalloc.h error.h general.h maxpath.h
1321builtins/return.o: quit.h dispose_cmd.h make_cmd.h subst.h externs.h stdc.h
1322builtins/return.o: shell.h unwind_prot.h variables.h
1323builtins/set.o: command.h config.h memalloc.h error.h general.h maxpath.h
1324builtins/set.o: quit.h dispose_cmd.h make_cmd.h subst.h externs.h
1325builtins/set.o: shell.h unwind_prot.h variables.h flags.h stdc.h
1326builtins/setattr.o: command.h config.h memalloc.h error.h general.h maxpath.h
1327builtins/setattr.o: quit.h $(DEFDIR)common.h $(DEFDIR)bashgetopt.h
1328builtins/setattr.o: shell.h unwind_prot.h variables.h
1329builtins/setattr.o: dispose_cmd.h make_cmd.h subst.h externs.h stdc.h
1330builtins/shift.o: command.h config.h memalloc.h error.h general.h maxpath.h
1331builtins/shift.o: quit.h dispose_cmd.h make_cmd.h subst.h externs.h stdc.h
1332builtins/shift.o: shell.h unwind_prot.h variables.h
1333builtins/shift.o: dispose_cmd.h make_cmd.h subst.h externs.h stdc.h
1334builtins/source.o: command.h config.h memalloc.h error.h general.h maxpath.h
1335builtins/source.o: quit.h dispose_cmd.h make_cmd.h subst.h externs.h stdc.h
1336builtins/source.o: shell.h unwind_prot.h variables.h
1337builtins/suspend.o: command.h config.h memalloc.h error.h general.h maxpath.h
1338builtins/suspend.o: quit.h dispose_cmd.h make_cmd.h subst.h externs.h stdc.h
1339builtins/suspend.o: shell.h unwind_prot.h variables.h
1340builtins/test.o: command.h config.h memalloc.h error.h general.h maxpath.h
1341builtins/test.o: quit.h dispose_cmd.h make_cmd.h subst.h externs.h stdc.h
1342builtins/test.o: shell.h unwind_prot.h variables.h
1343builtins/times.o: command.h config.h memalloc.h error.h general.h maxpath.h
1344builtins/times.o: quit.h dispose_cmd.h make_cmd.h subst.h externs.h stdc.h
1345builtins/times.o: shell.h unwind_prot.h variables.h
1346builtins/trap.o: command.h config.h memalloc.h error.h general.h maxpath.h
1347builtins/trap.o: quit.h $(DEFDIR)common.h
1348builtins/trap.o: shell.h unwind_prot.h variables.h
1349builtins/trap.o: dispose_cmd.h make_cmd.h subst.h externs.h stdc.h
1350builtins/type.o: command.h config.h memalloc.h error.h general.h maxpath.h
1351builtins/type.o: quit.h $(DEFDIR)common.h
1352builtins/type.o: shell.h unwind_prot.h variables.h execute_cmd.h
1353builtins/type.o: dispose_cmd.h make_cmd.h subst.h externs.h stdc.h
1354builtins/ulimit.o: command.h config.h memalloc.h error.h general.h maxpath.h
1355builtins/ulimit.o: quit.h dispose_cmd.h make_cmd.h subst.h externs.h stdc.h
1356builtins/ulimit.o: shell.h unwind_prot.h variables.h
1357builtins/umask.o: command.h config.h memalloc.h error.h general.h maxpath.h
1358builtins/umask.o: quit.h dispose_cmd.h make_cmd.h subst.h externs.h stdc.h
1359builtins/umask.o: shell.h unwind_prot.h variables.h
1360builtins/wait.o: command.h config.h memalloc.h error.h general.h maxpath.h
1361builtins/wait.o: quit.h dispose_cmd.h make_cmd.h subst.h externs.h stdc.h
1362builtins/wait.o: shell.h unwind_prot.h variables.h
1363
1364builtins/bashgetopt.o: bashansi.h ansi_stdlib.h
1365builtins/mkbuiltins.o: bashansi.h ansi_stdlib.h
1366builtins/fc.o: bashansi.h ansi_stdlib.h
1367
1368#if defined (READLINE) && defined (HAVE_READLINE_SOURCE)
1369builtins/bind.o: $(RL_LIBSRC)chardefs.h $(RL_LIBSRC)readline.h $(RL_LIBSRC)keymaps.h
1370#endif /* READLINE && HAVE_READLINE_SOURCE */
1371
1372#if defined (HISTORY) && defined (HAVE_HISTORY_SOURCE)
1373builtins/bind.o: $(HIST_LIBSRC)history.h
1374builtins/fc.o: $(HIST_LIBSRC)history.h
1375builtins/history.o: $(HIST_LIBSRC)history.h
1376#endif /* HISTORY && HAVE_HISTORY_SOURCE */
1377
1378#if defined (HAVE_TILDE_SOURCE)
1379builtins/common.o: $(TILDE_LIBSRC)tilde.h
1380builtins/cd.o: $(TILDE_LIBSRC)tilde.h
1381#endif /* HAVE_TILDE_SOURCE */
1382
1383builtins/alias.o: builtins/alias.def
1384builtins/bind.o: builtins/bind.def
1385builtins/break.o: builtins/break.def
1386builtins/builtin.o: builtins/builtin.def
1387builtins/cd.o: builtins/cd.def
1388builtins/colon.o: builtins/colon.def
1389builtins/command.o: builtins/command.def
1390builtins/declare.o: builtins/declare.def
1391builtins/echo.o: builtins/echo.def
1392builtins/enable.o: builtins/enable.def
1393builtins/eval.o: builtins/eval.def
1394builtins/exec.o: builtins/exec.def
1395builtins/exit.o: builtins/exit.def
1396builtins/fc.o: builtins/fc.def
1397builtins/fg_bg.o: builtins/fg_bg.def
1398builtins/getopts.o: builtins/getopts.def
1399builtins/hash.o: builtins/hash.def
1400builtins/help.o: builtins/help.def
1401builtins/histctl.o: builtins/histctl.def
1402builtins/history.o: builtins/history.def
1403builtins/inlib.o: builtins/inlib.def
1404builtins/jobs.o: builtins/jobs.def
1405builtins/kill.o: builtins/kill.def
1406builtins/let.o: builtins/let.def
1407builtins/read.o: builtins/read.def
1408builtins/reserved.o: builtins/reserved.def
1409builtins/return.o: builtins/return.def
1410builtins/set.o: builtins/set.def
1411builtins/setattr.o: builtins/setattr.def
1412builtins/shift.o: builtins/shift.def
1413builtins/source.o: builtins/source.def
1414builtins/suspend.o: builtins/suspend.def
1415builtins/test.o: builtins/test.def
1416builtins/times.o: builtins/times.def
1417builtins/trap.o: builtins/trap.def
1418builtins/type.o: builtins/type.def
1419builtins/ulimit.o: builtins/ulimit.def
1420builtins/umask.o: builtins/umask.def
1421builtins/wait.o: builtins/wait.def
1422
1423$(Program).tar: $(THINGS_TO_TAR) .distribution
1424 @$(MKTARFILE) $(Program) `cat .distribution` $(THINGS_TO_TAR)
1425
1426$(Program).tar$(COMPRESS_EXT): $(Program).tar
1427 $(COMPRESS) < $(Program).tar > $@
1428
1429clone: $(THINGS_TO_TAR)
1430 @$(MKTARFILE) +notar $(Machine) $(OS) $(THINGS_TO_TAR)
1431
1432installdirs:
1433 @${SHELL} $(SUPPORT_SRC)mkdirs $(bindir)
1434 @${SHELL} $(SUPPORT_SRC)mkdirs $(mandir) $(man3dir)
1435 @${SHELL} $(SUPPORT_SRC)mkdirs $(infodir)
1436
1437install: .made installdirs documentation
1438 -if [ -f $(bindir)/$(Program) ]; then \
1439 rm -f $(bindir)/$(Program).old ;\
1440 ln $(bindir)/$(Program) $(bindir)/$(Program).old; \
1441 fi
1442 $(INSTALL_PROGRAM) $(Program) $(bindir)/$(Program)
1443 -if [ -f $(bindir)/bashbug ]; \
1444 then mv $(bindir)/bashbug $(bindir)/bashbug.old; \
1445 fi
1446 $(INSTALL_PROGRAM) bashbug $(bindir)/bashbug
1447 ( cd $(DOCDIR) ; $(MAKE) $(MFLAGS) mandir=$(mandir) \
1448 man3dir=$(man3dir) infodir=$(infodir) $@ )
1449
1450uninstall: .made
1451 $(RM) $(bindir)/$(Program) installed-$(Program) $(bindir)/bashbug
1452 ( cd $(DOCDIR) ; $(MAKE) $(MFLAGS) mandir=$(mandir) man3dir=$(man3dir) infodir=$(infodir) $@ )
1453
1454.distribution:
1455 ./newversion.aux -dir $(srcdir) -dist `$(Program) -c 'echo $$BASH_VERSION'`
1456
1457distribution: $(Program) $(Program).tar$(COMPRESS_EXT) .distribution
1458 @echo cp $(Program).tar$(COMPRESS_EXT) \
1459 $(Program)-`cat .distribution`.tar$(COMPRESS_EXT)
1460 @cp $(Program).tar$(COMPRESS_EXT) \
1461 $(Program)-`cat .distribution`.tar$(COMPRESS_EXT)
1462
1463mailable: distribution
1464 /bin/rm -rf uuencoded
1465 mkdir uuencoded
1466 $(SHELL) -c 'f=$(Program)-`cat .distribution`.tar.Z;uuencode $$f $$f | split -800 - uuencoded/$$f.uu.'
1467
1468newversion.aux: newversion.c
1469 $(CC) $(CCFLAGS) -o $@ $(srcdir)/newversion.c
1470
1471newversion: newversion.aux
1472 $(RM) .build
1473 ./newversion.aux -dir $(srcdir) -dist
1474 mv -f newversion.h version.h
1475 $(MAKE) -f $(srcdir)/Makefile $(MFLAGS) srcdir=$(srcdir)
1476
1477documentation: force
1478 (cd $(DOCDIR); $(MAKE) $(MFLAGS))
1479
1480force:
1481
1482tags: $(SOURCES) $(BUILTIN_C_SRC) $(LIBRARY_SOURCE)
1483 etags $(SOURCES) $(BUILTIN_C_SRC) $(LIBRARY_SOURCE)
1484
1485TAGS: $(SOURCES) $(BUILTIN_C_SRC) $(LIBRARY_SOURCE)
1486 ctags -x $(SOURCES) $(BUILTIN_C_SRC) $(LIBRARY_SOURCE) > $@
1487
1488basic-clean:
1489 $(RM) $(OBJECTS) $(Program) bashbug ansi-Makefile *.aux
1490 $(RM) .build .made .machine version.h
1491 $(RM) $(CREATED_SUPPORT)
1492 $(RM) tags TAGS
1493
1494mostlyclean:
1495 $(RM) $(OBJECTS) $(Program) bashbug
1496 $(RM) .build .made .machine version.h
1497 $(RM) tags TAGS
1498 (cd $(DOCDIR) && $(MAKE) $(MFLAGS) $@ )
1499 (cd builtins && $(MAKE) $(MFLAGS) $@ )
1500 $(CLEAN_READLINE) ;
1501 $(CLEAN_HISTORY) ;
1502 $(CLEAN_TERMCAP) ;
1503 $(CLEAN_GLOB) ;
1504 $(CLEAN_TILDE) ;
1505 $(CLEAN_MALLOC) ;
1506
1507distclean clean: basic-clean
1508 (cd $(DOCDIR) && $(MAKE) $(MFLAGS) $@ )
1509 (cd builtins && $(MAKE) $(MFLAGS) $@ )
1510 $(CLEAN_READLINE) ;
1511 $(CLEAN_HISTORY) ;
1512 $(CLEAN_TERMCAP) ;
1513 $(CLEAN_GLOB) ;
1514 $(CLEAN_TILDE) ;
1515 $(CLEAN_MALLOC) ;
1516 $(RM) bash-Makefile
1517
1518realclean maintainer-clean: basic-clean
1519 $(RM) y.tab.c y.tab.h parser-built
1520 (cd $(DOCDIR) && $(MAKE) $(MFLAGS) $@ )
1521 (cd builtins && $(MAKE) $(MFLAGS) $@ )
1522 $(CLEAN_READLINE) ;
1523 $(CLEAN_HISTORY) ;
1524 $(CLEAN_TERMCAP) ;
1525 $(CLEAN_GLOB) ;
1526 $(CLEAN_TILDE) ;
1527 $(CLEAN_MALLOC) ;
1528 $(RM) bash-Makefile
1529
1530recho: $(SUPPORT_SRC)recho.c
1531 @$(CC) -o $@ $(SUPPORT_SRC)recho.c
1532
1533tests check: force $(Program) recho
1534 @cp recho $(SUPPORT_SRC)printenv tests
1535 ( cd tests ; sh run-all )
1536
1537/**/# Here is a convenient rule when you arrive at a new site and wish to
1538/**/# install bash on several different architectures. It creates a new
1539/**/# directory to hold the results of compilation. The directory is
1540/**/# named Machine-OS.
1541architecture: $(Machine)-$(OS)/$(Program)
1542
1543$(Machine)-$(OS):
1544 -mkdir $(Machine)-$(OS)
1545
1546$(Machine)-$(OS)/$(Program): $(Machine)-$(OS) $(Program)
1547 mv $(Program) $(Machine)-$(OS)
1548 mv sysdefs.h $(Machine)-$(OS)
1549 mv $(SDIR)getcppsyms $(Machine)-$(OS)
1550 $(MAKE) $(MFLAGS) clean
1551
1552DEFINES: config.h memalloc.h cpp-Makefile sysdefs.h
1553 echo $(CCFLAGS) $(CPPFLAGS) >DEFINES