mirror of
https://github.com/mirror/make.git
synced 2026-09-04 21:52:55 +08:00
Compare commits
31 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c5af4810ff | ||
|
|
551c4322cb | ||
|
|
e33c50b1e2 | ||
|
|
bc1e6b66f1 | ||
|
|
bbd5e695f5 | ||
|
|
f3cfccf0b8 | ||
|
|
016e1beef5 | ||
|
|
21a8ec0d72 | ||
|
|
fecd9e661a | ||
|
|
2914c705e5 | ||
|
|
3f506aaf90 | ||
|
|
75ea6c3ce2 | ||
|
|
3fb9ebf83f | ||
|
|
b4890bdb1c | ||
|
|
2cbfa1024a | ||
|
|
258dad0f9a | ||
|
|
37358a9a82 | ||
|
|
e167e0a3c2 | ||
|
|
7879457545 | ||
|
|
d525f4dd72 | ||
|
|
bd19554ea7 | ||
|
|
fffc384bfc | ||
|
|
afd1d69e7d | ||
|
|
c1305a1a18 | ||
|
|
43d5fbfc88 | ||
|
|
a4642a6a57 | ||
|
|
11ca7f1ead | ||
|
|
4aa992616f | ||
|
|
ab0fb2fa6f | ||
|
|
e1dd3bfa4a | ||
|
|
86238ec9d3 |
@@ -12,3 +12,6 @@
|
|||||||
|
|
||||||
/* Define this if you have the `union wait' type in <sys/wait.h>. */
|
/* Define this if you have the `union wait' type in <sys/wait.h>. */
|
||||||
#undef HAVE_UNION_WAIT
|
#undef HAVE_UNION_WAIT
|
||||||
|
|
||||||
|
/* Define this if the POSIX.1 call `sysconf (_SC_OPEN_MAX)' works properly. */
|
||||||
|
#undef HAVE_SYSCONF_OPEN_MAX
|
||||||
|
|||||||
4
arscan.c
4
arscan.c
@@ -429,11 +429,11 @@ ar_name_equal (name, mem, truncated)
|
|||||||
struct ar_hdr hdr;
|
struct ar_hdr hdr;
|
||||||
return !strncmp (name, mem,
|
return !strncmp (name, mem,
|
||||||
sizeof (hdr.ar_name) -
|
sizeof (hdr.ar_name) -
|
||||||
#ifndef __hpux
|
#if !defined (__hpux) && !defined (cray)
|
||||||
1
|
1
|
||||||
#else
|
#else
|
||||||
2
|
2
|
||||||
#endif /* __hpux */
|
#endif /* !__hpux && !cray */
|
||||||
);
|
);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
# NOTE: If you have no `make' program at all to process this makefile, run
|
# NOTE: If you have no `make' program at all to process this makefile, run
|
||||||
# `build.sh' instead.
|
# `build.sh' instead.
|
||||||
#
|
#
|
||||||
# Copyright (C) 1988, 89, 91, 92, 93, 94 Free Software Foundation, Inc.
|
# Copyright (C) 1988, 89, 91, 92, 93, 94, 1995 Free Software Foundation, Inc.
|
||||||
# This file is part of GNU Make.
|
# This file is part of GNU Make.
|
||||||
#
|
#
|
||||||
# GNU Make is free software; you can redistribute it and/or modify
|
# GNU Make is free software; you can redistribute it and/or modify
|
||||||
@@ -117,8 +117,8 @@ MAKEINFO = makeinfo
|
|||||||
TEXI2DVI = texi2dvi
|
TEXI2DVI = texi2dvi
|
||||||
|
|
||||||
# Programs to make tags files.
|
# Programs to make tags files.
|
||||||
ETAGS = etags -tw
|
ETAGS = etags -w
|
||||||
CTAGS = ctags -tw
|
CTAGS = ctags -w
|
||||||
|
|
||||||
objs = commands.o job.o dir.o file.o misc.o main.o read.o remake.o \
|
objs = commands.o job.o dir.o file.o misc.o main.o read.o remake.o \
|
||||||
rule.o implicit.o default.o variable.o expand.o function.o \
|
rule.o implicit.o default.o variable.o expand.o function.o \
|
||||||
@@ -142,10 +142,9 @@ srcs = $(srcdir)/commands.c $(srcdir)/job.c $(srcdir)/dir.c \
|
|||||||
.SUFFIXES: .o .c .h .ps .dvi .info .texinfo
|
.SUFFIXES: .o .c .h .ps .dvi .info .texinfo
|
||||||
|
|
||||||
all: make
|
all: make
|
||||||
check: # No tests.
|
|
||||||
info: make.info
|
info: make.info
|
||||||
dvi: make.dvi
|
dvi: make.dvi
|
||||||
# Some makes apparently use .PHONY as the default goal is it is before `all'.
|
# Some makes apparently use .PHONY as the default goal if it is before `all'.
|
||||||
.PHONY: all check info dvi
|
.PHONY: all check info dvi
|
||||||
|
|
||||||
make.info: make.texinfo
|
make.info: make.texinfo
|
||||||
@@ -196,7 +195,7 @@ $(bindir)/$(binprefix)make: make
|
|||||||
else \
|
else \
|
||||||
echo "$@ needs to be owned by group $(group) and setgid;"; \
|
echo "$@ needs to be owned by group $(group) and setgid;"; \
|
||||||
echo "otherwise the \`-l' option will probably not work."; \
|
echo "otherwise the \`-l' option will probably not work."; \
|
||||||
echo "You may need special priveleges to install $@."; \
|
echo "You may need special privileges to install $@."; \
|
||||||
fi; \
|
fi; \
|
||||||
else true; fi
|
else true; fi
|
||||||
# Some systems can't deal with renaming onto a running binary.
|
# Some systems can't deal with renaming onto a running binary.
|
||||||
@@ -242,7 +241,7 @@ check: check-loadavg
|
|||||||
|
|
||||||
.PHONY: clean realclean distclean mostlyclean
|
.PHONY: clean realclean distclean mostlyclean
|
||||||
clean: glob-clean
|
clean: glob-clean
|
||||||
-rm -f make loadavg *.o core make.info* make.dvi
|
-rm -f make loadavg *.o core make.dvi
|
||||||
distclean: clean glob-realclean
|
distclean: clean glob-realclean
|
||||||
-rm -f Makefile config.h config.status build.sh stamp-config
|
-rm -f Makefile config.h config.status build.sh stamp-config
|
||||||
-rm -f config.log config.cache
|
-rm -f config.log config.cache
|
||||||
@@ -250,6 +249,7 @@ distclean: clean glob-realclean
|
|||||||
-rm -f make.?? make.??s make.log make.toc make.*aux
|
-rm -f make.?? make.??s make.log make.toc make.*aux
|
||||||
-rm -f loadavg.c
|
-rm -f loadavg.c
|
||||||
realclean: distclean
|
realclean: distclean
|
||||||
|
-rm -f make.info*
|
||||||
mostlyclean: clean
|
mostlyclean: clean
|
||||||
|
|
||||||
.PHONY: glob-clean glob-realclean
|
.PHONY: glob-clean glob-realclean
|
||||||
|
|||||||
17
configure.in
17
configure.in
@@ -43,7 +43,7 @@ changequote([,])dnl
|
|||||||
fi
|
fi
|
||||||
AC_MSG_RESULT($ac_cv_check_symbol_$1)])dnl
|
AC_MSG_RESULT($ac_cv_check_symbol_$1)])dnl
|
||||||
|
|
||||||
AC_CHECK_FUNCS(getdtablesize psignal \
|
AC_CHECK_FUNCS(getdtablesize psignal mktemp \
|
||||||
dup2 getcwd sigsetmask getgroups setlinebuf \
|
dup2 getcwd sigsetmask getgroups setlinebuf \
|
||||||
seteuid setegid setreuid setregid strerror)
|
seteuid setegid setreuid setregid strerror)
|
||||||
AC_CHECK_SYMBOL(sys_siglist)
|
AC_CHECK_SYMBOL(sys_siglist)
|
||||||
@@ -54,6 +54,17 @@ AC_FUNC_SETVBUF_REVERSED
|
|||||||
AC_FUNC_GETLOADAVG
|
AC_FUNC_GETLOADAVG
|
||||||
AC_FUNC_STRCOLL
|
AC_FUNC_STRCOLL
|
||||||
|
|
||||||
|
if test $ac_cv_func_getdtablesize = no; then
|
||||||
|
AC_MSG_CHECKING(for sysconf (_SC_OPEN_MAX))
|
||||||
|
AC_CACHE_VAL(make_cv_sysconf_open_max, [dnl
|
||||||
|
AC_TRY_LINK([#include <unistd.h>], [int max = sysconf (_SC_OPEN_MAX);],
|
||||||
|
[make_cv_sysconf_open_max=yes], [make_cv_sysconf_open_max=no])])
|
||||||
|
if test $make_cv_sysconf_open_max = yes; then
|
||||||
|
AC_DEFINE(HAVE_SYSCONF_OPEN_MAX)
|
||||||
|
fi
|
||||||
|
AC_MSG_RESULT($make_cv_sysconf_open_max)
|
||||||
|
fi
|
||||||
|
|
||||||
# Check out the wait reality.
|
# Check out the wait reality.
|
||||||
AC_CHECK_HEADERS(sys/wait.h) AC_CHECK_FUNCS(waitpid wait3)
|
AC_CHECK_HEADERS(sys/wait.h) AC_CHECK_FUNCS(waitpid wait3)
|
||||||
AC_MSG_CHECKING(for union wait)
|
AC_MSG_CHECKING(for union wait)
|
||||||
@@ -66,6 +77,10 @@ AC_TRY_LINK([#include <sys/types.h>
|
|||||||
union wait type, and they do not work together. If union wait
|
union wait type, and they do not work together. If union wait
|
||||||
conflicts with WEXITSTATUS et al, we don't want to use it at all. */
|
conflicts with WEXITSTATUS et al, we don't want to use it at all. */
|
||||||
if (WEXITSTATUS (status) != 0) pid = -1;
|
if (WEXITSTATUS (status) != 0) pid = -1;
|
||||||
|
#ifdef WTERMSIG
|
||||||
|
/* If we have WEXITSTATUS and WTERMSIG, just use them on ints. */
|
||||||
|
-- blow chunks here --
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_WAITPID
|
#ifdef HAVE_WAITPID
|
||||||
/* Make sure union wait works with waitpid. */
|
/* Make sure union wait works with waitpid. */
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/* Data base of default implicit rules for GNU Make.
|
/* Data base of default implicit rules for GNU Make.
|
||||||
Copyright (C) 1988, 89, 90, 91, 92, 93, 94 Free Software Foundation, Inc.
|
Copyright (C) 1988, 89, 90, 91, 92, 93, 94, 1995 Free Software Foundation, Inc.
|
||||||
This file is part of GNU Make.
|
This file is part of GNU Make.
|
||||||
|
|
||||||
GNU Make is free software; you can redistribute it and/or modify
|
GNU Make is free software; you can redistribute it and/or modify
|
||||||
@@ -209,13 +209,7 @@ static char *default_suffix_rules[] =
|
|||||||
static char *default_variables[] =
|
static char *default_variables[] =
|
||||||
{
|
{
|
||||||
"AR", "ar",
|
"AR", "ar",
|
||||||
#ifndef __hpux
|
|
||||||
"ARFLAGS", "rv",
|
"ARFLAGS", "rv",
|
||||||
#else
|
|
||||||
/* HPUX ar's f flag says to truncate the file names to archive member
|
|
||||||
name length in comparisons, so replacement notices the equality. */
|
|
||||||
"ARFLAGS", "rfv",
|
|
||||||
#endif
|
|
||||||
"AS", "as",
|
"AS", "as",
|
||||||
#ifdef GCC_IS_NATIVE
|
#ifdef GCC_IS_NATIVE
|
||||||
"CC", "gcc",
|
"CC", "gcc",
|
||||||
|
|||||||
248
expand.c
248
expand.c
@@ -1,5 +1,5 @@
|
|||||||
/* Variable expansion functions for GNU Make.
|
/* Variable expansion functions for GNU Make.
|
||||||
Copyright (C) 1988, 1989, 1991, 1992, 1993 Free Software Foundation, Inc.
|
Copyright (C) 1988, 89, 91, 92, 93, 95 Free Software Foundation, Inc.
|
||||||
This file is part of GNU Make.
|
This file is part of GNU Make.
|
||||||
|
|
||||||
GNU Make is free software; you can redistribute it and/or modify
|
GNU Make is free software; you can redistribute it and/or modify
|
||||||
@@ -197,9 +197,9 @@ variable_expand (line)
|
|||||||
char openparen = *p;
|
char openparen = *p;
|
||||||
char closeparen = (openparen == '(') ? ')' : '}';
|
char closeparen = (openparen == '(') ? ')' : '}';
|
||||||
register char *beg = p + 1;
|
register char *beg = p + 1;
|
||||||
|
int free_beg = 0;
|
||||||
char *op, *begp;
|
char *op, *begp;
|
||||||
char *end;
|
char *end, *colon;
|
||||||
char *colon = 0;
|
|
||||||
|
|
||||||
op = o;
|
op = o;
|
||||||
begp = p;
|
begp = p;
|
||||||
@@ -213,132 +213,6 @@ variable_expand (line)
|
|||||||
/* Is there a variable reference inside the parens or braces?
|
/* Is there a variable reference inside the parens or braces?
|
||||||
If so, expand it before expanding the entire reference. */
|
If so, expand it before expanding the entire reference. */
|
||||||
|
|
||||||
p1 = index (beg, closeparen);
|
|
||||||
if (p1 != 0)
|
|
||||||
p1 = lindex (beg, p1, '$');
|
|
||||||
if (p1 != 0 && lindex (beg, p1, ':') == 0)
|
|
||||||
{
|
|
||||||
/* BEG now points past the opening paren or brace.
|
|
||||||
Count parens or braces until it is matched. */
|
|
||||||
int count = 0;
|
|
||||||
for (p = beg; *p != '\0'; ++p)
|
|
||||||
{
|
|
||||||
if (*p == openparen)
|
|
||||||
++count;
|
|
||||||
else if (*p == closeparen && --count < 0)
|
|
||||||
break;
|
|
||||||
else if (colon == 0 && count == 0 && *p == ':')
|
|
||||||
/* Record where we found a colon, which
|
|
||||||
indicates a substitution reference.
|
|
||||||
We want to expand the text before the
|
|
||||||
reference only. */
|
|
||||||
colon = p;
|
|
||||||
}
|
|
||||||
/* If COUNT is >= 0, there were unmatched opening parens
|
|
||||||
or braces, so we go to the simple case of a variable name
|
|
||||||
such as `$($(a)'. */
|
|
||||||
if (count < 0)
|
|
||||||
{
|
|
||||||
char *name = expand_argument (beg, colon == 0 ? p : colon);
|
|
||||||
unsigned int namelen = strlen (name);
|
|
||||||
if (colon == 0)
|
|
||||||
{
|
|
||||||
/* This is a simple reference to the expanded name. */
|
|
||||||
o = reference_variable (o, name, namelen);
|
|
||||||
free (name);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
/* This is a substitution reference to the expanded
|
|
||||||
name. We replace the pending text with a copy
|
|
||||||
containing the expanded name in place of the
|
|
||||||
original name, and then fall through to
|
|
||||||
the normal substitution reference code below. */
|
|
||||||
unsigned int restlen = strlen (colon) + 1;
|
|
||||||
beg = (char *) alloca (namelen + restlen);
|
|
||||||
bcopy (name, beg, namelen);
|
|
||||||
bcopy (colon, &beg[namelen], restlen);
|
|
||||||
/* Point COLON into the new copy. */
|
|
||||||
colon = &beg[namelen];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* This is not a reference to a built-in function and
|
|
||||||
it does not contain any variable references inside.
|
|
||||||
There are several things it could be. */
|
|
||||||
|
|
||||||
if (colon == 0)
|
|
||||||
colon = index (beg, ':');
|
|
||||||
if (colon != 0 && lindex (beg, colon, closeparen) == 0)
|
|
||||||
{
|
|
||||||
/* This is a substitution reference: $(FOO:A=B). */
|
|
||||||
int count;
|
|
||||||
char *subst_beg, *subst_end, *replace_beg, *replace_end;
|
|
||||||
|
|
||||||
v = lookup_variable (beg, colon - beg);
|
|
||||||
if (v == 0)
|
|
||||||
warn_undefined (beg, colon - beg);
|
|
||||||
|
|
||||||
subst_beg = colon + 1;
|
|
||||||
count = 0;
|
|
||||||
for (p = subst_beg; *p != '\0'; ++p)
|
|
||||||
{
|
|
||||||
if (*p == openparen)
|
|
||||||
++count;
|
|
||||||
else if (*p == closeparen)
|
|
||||||
--count;
|
|
||||||
else if (*p == '=' && count <= 0)
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (count > 0)
|
|
||||||
/* There were unmatched opening parens. */
|
|
||||||
return initialize_variable_output ();
|
|
||||||
subst_end = p;
|
|
||||||
|
|
||||||
replace_beg = p + 1;
|
|
||||||
count = 0;
|
|
||||||
for (p = replace_beg; *p != '\0'; ++p)
|
|
||||||
{
|
|
||||||
if (*p == openparen)
|
|
||||||
++count;
|
|
||||||
else if (*p == closeparen && --count < 0)
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (count > 0)
|
|
||||||
/* There were unmatched opening parens. */
|
|
||||||
return initialize_variable_output ();
|
|
||||||
end = p;
|
|
||||||
replace_end = p;
|
|
||||||
|
|
||||||
p = expand_argument (subst_beg, subst_end);
|
|
||||||
p1 = expand_argument (replace_beg, replace_end);
|
|
||||||
|
|
||||||
if (v != 0 && *v->value != '\0')
|
|
||||||
{
|
|
||||||
char *value = (v->recursive ? recursively_expand (v)
|
|
||||||
: v->value);
|
|
||||||
char *percent = find_percent (p);
|
|
||||||
if (percent != 0)
|
|
||||||
o = patsubst_expand (o, value, p, p1,
|
|
||||||
percent, (char *) 0);
|
|
||||||
else
|
|
||||||
o = subst_expand (o, value,
|
|
||||||
p, p1, strlen (p), strlen (p1),
|
|
||||||
0, 1);
|
|
||||||
if (v->recursive)
|
|
||||||
free (value);
|
|
||||||
}
|
|
||||||
|
|
||||||
free (p);
|
|
||||||
free (p1);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* No, this must be an ordinary variable reference. */
|
|
||||||
else
|
|
||||||
{
|
|
||||||
/* Look up the value of the variable. */
|
|
||||||
end = index (beg, closeparen);
|
end = index (beg, closeparen);
|
||||||
if (end == 0)
|
if (end == 0)
|
||||||
{
|
{
|
||||||
@@ -349,11 +223,121 @@ variable_expand (line)
|
|||||||
else
|
else
|
||||||
fatal ("unterminated variable reference");
|
fatal ("unterminated variable reference");
|
||||||
}
|
}
|
||||||
o = reference_variable (o, beg, end - beg);
|
p1 = lindex (beg, end, '$');
|
||||||
|
if (p1 != 0)
|
||||||
|
{
|
||||||
|
/* BEG now points past the opening paren or brace.
|
||||||
|
Count parens or braces until it is matched. */
|
||||||
|
int count = 0;
|
||||||
|
for (p = beg; *p != '\0'; ++p)
|
||||||
|
{
|
||||||
|
if (*p == openparen)
|
||||||
|
++count;
|
||||||
|
else if (*p == closeparen && --count < 0)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
/* If COUNT is >= 0, there were unmatched opening parens
|
||||||
|
or braces, so we go to the simple case of a variable name
|
||||||
|
such as `$($(a)'. */
|
||||||
|
if (count < 0)
|
||||||
|
{
|
||||||
|
beg = expand_argument (beg, p); /* Expand the name. */
|
||||||
|
free_beg = 1; /* Remember to free BEG when finished. */
|
||||||
|
end = index (beg, '\0');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
/* Advance P to the end of this reference. After we are
|
||||||
|
finished expanding this one, P will be incremented to
|
||||||
|
continue the scan. */
|
||||||
|
p = end;
|
||||||
|
|
||||||
|
/* This is not a reference to a built-in function and
|
||||||
|
any variable references inside are now expanded.
|
||||||
|
Is the resultant text a substitution reference? */
|
||||||
|
|
||||||
|
colon = lindex (beg, end, ':');
|
||||||
|
if (colon != 0)
|
||||||
|
{
|
||||||
|
/* This looks like a substitution reference: $(FOO:A=B). */
|
||||||
|
char *subst_beg, *subst_end, *replace_beg, *replace_end;
|
||||||
|
|
||||||
|
subst_beg = colon + 1;
|
||||||
|
subst_end = index (subst_beg, '=');
|
||||||
|
if (subst_end == 0)
|
||||||
|
/* There is no = in sight. Punt on the substitution
|
||||||
|
reference and treat this as a variable name containing
|
||||||
|
a colon, in the code below. */
|
||||||
|
colon = 0;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
replace_beg = subst_end + 1;
|
||||||
|
replace_end = end;
|
||||||
|
|
||||||
|
/* Extract the variable name before the colon
|
||||||
|
and look up that variable. */
|
||||||
|
v = lookup_variable (beg, colon - beg);
|
||||||
|
if (v == 0)
|
||||||
|
warn_undefined (beg, colon - beg);
|
||||||
|
|
||||||
|
if (v != 0 && *v->value != '\0')
|
||||||
|
{
|
||||||
|
char *value = (v->recursive ? recursively_expand (v)
|
||||||
|
: v->value);
|
||||||
|
char *pattern, *percent;
|
||||||
|
if (free_beg)
|
||||||
|
{
|
||||||
|
*subst_end = '\0';
|
||||||
|
pattern = subst_beg;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
pattern = (char *) alloca (subst_end - subst_beg
|
||||||
|
+ 1);
|
||||||
|
bcopy (subst_beg, pattern, subst_end - subst_beg);
|
||||||
|
pattern[subst_end - subst_beg] = '\0';
|
||||||
|
}
|
||||||
|
percent = find_percent (pattern);
|
||||||
|
if (percent != 0)
|
||||||
|
{
|
||||||
|
char *replace;
|
||||||
|
if (free_beg)
|
||||||
|
{
|
||||||
|
*replace_end = '\0';
|
||||||
|
replace = replace_beg;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
replace = (char *) alloca (replace_end
|
||||||
|
- replace_beg
|
||||||
|
+ 1);
|
||||||
|
bcopy (replace_beg, replace,
|
||||||
|
replace_end - replace_beg);
|
||||||
|
replace[replace_end - replace_beg] = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Advance p past the variable reference to resume scan. */
|
o = patsubst_expand (o, value, pattern, replace,
|
||||||
p = end;
|
percent, (char *) 0);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
o = subst_expand (o, value,
|
||||||
|
pattern, replace_beg,
|
||||||
|
strlen (pattern),
|
||||||
|
end - replace_beg,
|
||||||
|
0, 1);
|
||||||
|
if (v->recursive)
|
||||||
|
free (value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (colon == 0)
|
||||||
|
/* This is an ordinary variable reference.
|
||||||
|
Look up the value of the variable. */
|
||||||
|
o = reference_variable (o, beg, end - beg);
|
||||||
|
|
||||||
|
if (free_beg)
|
||||||
|
free (beg);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|||||||
11
getloadavg.c
11
getloadavg.c
@@ -1,5 +1,5 @@
|
|||||||
/* Get the system load averages.
|
/* Get the system load averages.
|
||||||
Copyright (C) 1985, 86, 87, 88, 89, 91, 92, 93, 1994
|
Copyright (C) 1985, 86, 87, 88, 89, 91, 92, 93, 1994, 1995
|
||||||
Free Software Foundation, Inc.
|
Free Software Foundation, Inc.
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
||||||
@@ -59,6 +59,11 @@
|
|||||||
We also #define LDAV_PRIVILEGED if a program will require
|
We also #define LDAV_PRIVILEGED if a program will require
|
||||||
special installation to be able to call getloadavg. */
|
special installation to be able to call getloadavg. */
|
||||||
|
|
||||||
|
/* This should always be first. */
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
#include <config.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
/* Both the Emacs and non-Emacs sections want this. Some
|
/* Both the Emacs and non-Emacs sections want this. Some
|
||||||
@@ -69,10 +74,6 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
#include <config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Exclude all the code except the test program at the end
|
/* Exclude all the code except the test program at the end
|
||||||
if the system has its own `getloadavg' function.
|
if the system has its own `getloadavg' function.
|
||||||
|
|
||||||
|
|||||||
126
job.c
126
job.c
@@ -1,5 +1,5 @@
|
|||||||
/* Job execution and handling for GNU Make.
|
/* Job execution and handling for GNU Make.
|
||||||
Copyright (C) 1988, 89, 90, 91, 92, 93, 94 Free Software Foundation, Inc.
|
Copyright (C) 1988, 89, 90, 91, 92, 93, 94, 1995 Free Software Foundation, Inc.
|
||||||
This file is part of GNU Make.
|
This file is part of GNU Make.
|
||||||
|
|
||||||
GNU Make is free software; you can redistribute it and/or modify
|
GNU Make is free software; you can redistribute it and/or modify
|
||||||
@@ -23,9 +23,6 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
|||||||
#include "variable.h"
|
#include "variable.h"
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
/* Default path to search for executables. */
|
|
||||||
static char default_path[] = ":/bin:/usr/bin";
|
|
||||||
|
|
||||||
/* Default shell to use. */
|
/* Default shell to use. */
|
||||||
char default_shell[] = "/bin/sh";
|
char default_shell[] = "/bin/sh";
|
||||||
|
|
||||||
@@ -125,6 +122,9 @@ extern int setgid (), getgid ();
|
|||||||
#ifdef HAVE_GETDTABLESIZE
|
#ifdef HAVE_GETDTABLESIZE
|
||||||
extern int getdtablesize ();
|
extern int getdtablesize ();
|
||||||
#else
|
#else
|
||||||
|
#ifdef HAVE_SYSCONF_OPEN_MAX
|
||||||
|
#define getdtablesize() ((int) sysconf (_SC_OPEN_MAX))
|
||||||
|
#else
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#define getdtablesize() NOFILE
|
#define getdtablesize() NOFILE
|
||||||
#if !defined (NOFILE) && defined (NOFILES_MAX)
|
#if !defined (NOFILE) && defined (NOFILES_MAX)
|
||||||
@@ -133,6 +133,7 @@ extern int getdtablesize ();
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
extern int getloadavg ();
|
extern int getloadavg ();
|
||||||
extern int start_remote_job_p ();
|
extern int start_remote_job_p ();
|
||||||
@@ -591,6 +592,7 @@ start_job_command (child)
|
|||||||
|
|
||||||
if (argv == 0)
|
if (argv == 0)
|
||||||
{
|
{
|
||||||
|
next_command:
|
||||||
/* This line has no commands. Go to the next. */
|
/* This line has no commands. Go to the next. */
|
||||||
if (job_next_command (child))
|
if (job_next_command (child))
|
||||||
start_job_command (child);
|
start_job_command (child);
|
||||||
@@ -623,10 +625,7 @@ start_job_command (child)
|
|||||||
{
|
{
|
||||||
free (argv[0]);
|
free (argv[0]);
|
||||||
free ((char *) argv);
|
free ((char *) argv);
|
||||||
if (job_next_command (child))
|
goto next_command;
|
||||||
start_job_command (child);
|
|
||||||
child->file->update_status = 0;
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Flush the output streams so they won't have things written twice. */
|
/* Flush the output streams so they won't have things written twice. */
|
||||||
@@ -689,6 +688,8 @@ start_job_command (child)
|
|||||||
{
|
{
|
||||||
/* Fork the child process. */
|
/* Fork the child process. */
|
||||||
|
|
||||||
|
char **parent_environ;
|
||||||
|
|
||||||
#ifdef POSIX
|
#ifdef POSIX
|
||||||
(void) sigprocmask (SIG_BLOCK, &fatal_signal_set, (sigset_t *) 0);
|
(void) sigprocmask (SIG_BLOCK, &fatal_signal_set, (sigset_t *) 0);
|
||||||
#else
|
#else
|
||||||
@@ -698,7 +699,9 @@ start_job_command (child)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
child->remote = 0;
|
child->remote = 0;
|
||||||
|
parent_environ = environ;
|
||||||
child->pid = vfork ();
|
child->pid = vfork ();
|
||||||
|
environ = parent_environ; /* Restore value child may have clobbered. */
|
||||||
if (child->pid == 0)
|
if (child->pid == 0)
|
||||||
{
|
{
|
||||||
/* We are the child side. */
|
/* We are the child side. */
|
||||||
@@ -1073,6 +1076,11 @@ child_execute_job (stdin_fd, stdout_fd, argv, envp)
|
|||||||
exec_command (argv, envp);
|
exec_command (argv, envp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
|
||||||
|
/* Default path to search for executables. */
|
||||||
|
static char default_path[] = ":/bin:/usr/bin";
|
||||||
|
|
||||||
/* Search PATH for FILE.
|
/* Search PATH for FILE.
|
||||||
If successful, store the full pathname in PROGRAM and return 1.
|
If successful, store the full pathname in PROGRAM and return 1.
|
||||||
If not sucessful, return zero. */
|
If not sucessful, return zero. */
|
||||||
@@ -1171,6 +1179,7 @@ search_path (file, path, program)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
#endif /* search_path commented out */
|
||||||
|
|
||||||
/* Replace the current process with one running the command in ARGV,
|
/* Replace the current process with one running the command in ARGV,
|
||||||
with environment ENVP. This function does not return. */
|
with environment ENVP. This function does not return. */
|
||||||
@@ -1179,59 +1188,36 @@ void
|
|||||||
exec_command (argv, envp)
|
exec_command (argv, envp)
|
||||||
char **argv, **envp;
|
char **argv, **envp;
|
||||||
{
|
{
|
||||||
char *shell, *path;
|
|
||||||
PATH_VAR (program);
|
|
||||||
register char **ep;
|
|
||||||
|
|
||||||
shell = path = 0;
|
|
||||||
for (ep = envp; *ep != 0; ++ep)
|
|
||||||
{
|
|
||||||
if (shell == 0 && !strncmp(*ep, "SHELL=", 6))
|
|
||||||
shell = &(*ep)[6];
|
|
||||||
else if (path == 0 && !strncmp(*ep, "PATH=", 5))
|
|
||||||
path = &(*ep)[5];
|
|
||||||
else if (path != 0 && shell != 0)
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Be the user, permanently. */
|
/* Be the user, permanently. */
|
||||||
child_access ();
|
child_access ();
|
||||||
|
|
||||||
if (!search_path (argv[0], path, program))
|
|
||||||
error ("%s: Command not found", argv[0]);
|
|
||||||
else
|
|
||||||
{
|
|
||||||
/* Run the program. */
|
/* Run the program. */
|
||||||
execve (program, argv, envp);
|
environ = envp;
|
||||||
|
execvp (argv[0], argv);
|
||||||
|
|
||||||
if (errno == ENOEXEC)
|
switch (errno)
|
||||||
{
|
{
|
||||||
PATH_VAR (shell_program);
|
case ENOENT:
|
||||||
char *shell_path;
|
error ("%s: Command not found", argv[0]);
|
||||||
if (shell == 0)
|
break;
|
||||||
shell_path = default_shell;
|
case ENOEXEC:
|
||||||
else
|
|
||||||
{
|
|
||||||
if (search_path (shell, path, shell_program))
|
|
||||||
shell_path = shell_program;
|
|
||||||
else
|
|
||||||
{
|
|
||||||
shell_path = 0;
|
|
||||||
error ("%s: Shell program not found", shell);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (shell_path != 0)
|
|
||||||
{
|
{
|
||||||
|
/* The file is not executable. Try it as a shell script. */
|
||||||
|
extern char *getenv ();
|
||||||
|
char *shell;
|
||||||
char **new_argv;
|
char **new_argv;
|
||||||
int argc;
|
int argc;
|
||||||
|
|
||||||
|
shell = getenv ("SHELL");
|
||||||
|
if (shell == 0)
|
||||||
|
shell = default_shell;
|
||||||
|
|
||||||
argc = 1;
|
argc = 1;
|
||||||
while (argv[argc] != 0)
|
while (argv[argc] != 0)
|
||||||
++argc;
|
++argc;
|
||||||
|
|
||||||
new_argv = (char **) alloca ((1 + argc + 1) * sizeof (char *));
|
new_argv = (char **) alloca ((1 + argc + 1) * sizeof (char *));
|
||||||
new_argv[0] = shell_path;
|
new_argv[0] = shell;
|
||||||
new_argv[1] = program;
|
new_argv[1] = program;
|
||||||
while (argc > 0)
|
while (argc > 0)
|
||||||
{
|
{
|
||||||
@@ -1239,22 +1225,28 @@ exec_command (argv, envp)
|
|||||||
--argc;
|
--argc;
|
||||||
}
|
}
|
||||||
|
|
||||||
execve (shell_path, new_argv, envp);
|
execvp (shell, new_argv);
|
||||||
perror_with_name ("execve: ", shell_path);
|
if (errno == ENOENT)
|
||||||
}
|
error ("%s: Shell program not found", shell);
|
||||||
}
|
|
||||||
else
|
else
|
||||||
perror_with_name ("execve: ", program);
|
perror_with_name ("execvp: ", shell);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
default:
|
||||||
|
perror_with_name ("execvp: ", argv[0]);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
_exit (127);
|
_exit (127);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Figure out the argument list necessary to run LINE as a command.
|
/* Figure out the argument list necessary to run LINE as a command. Try to
|
||||||
Try to avoid using a shell. This routine handles only ' quoting.
|
avoid using a shell. This routine handles only ' quoting, and " quoting
|
||||||
Starting quotes may be escaped with a backslash. If any of the
|
when no backslash, $ or ` characters are seen in the quotes. Starting
|
||||||
characters in sh_chars[] is seen, or any of the builtin commands
|
quotes may be escaped with a backslash. If any of the characters in
|
||||||
listed in sh_cmds[] is the first word of a line, the shell is used.
|
sh_chars[] is seen, or any of the builtin commands listed in sh_cmds[]
|
||||||
|
is the first word of a line, the shell is used.
|
||||||
|
|
||||||
If RESTP is not NULL, *RESTP is set to point to the first newline in LINE.
|
If RESTP is not NULL, *RESTP is set to point to the first newline in LINE.
|
||||||
If *RESTP is NULL, newlines will be ignored.
|
If *RESTP is NULL, newlines will be ignored.
|
||||||
@@ -1332,7 +1324,7 @@ construct_command_argv_internal (line, restp, shell, ifs)
|
|||||||
string_char:
|
string_char:
|
||||||
/* Inside a string, just copy any char except a closing quote
|
/* Inside a string, just copy any char except a closing quote
|
||||||
or a backslash-newline combination. */
|
or a backslash-newline combination. */
|
||||||
if (*p == '\'')
|
if (*p == instring)
|
||||||
instring = 0;
|
instring = 0;
|
||||||
else if (*p == '\\' && p[1] == '\n')
|
else if (*p == '\\' && p[1] == '\n')
|
||||||
goto swallow_escaped_newline;
|
goto swallow_escaped_newline;
|
||||||
@@ -1342,6 +1334,10 @@ construct_command_argv_internal (line, restp, shell, ifs)
|
|||||||
*restp = p;
|
*restp = p;
|
||||||
goto end_of_line;
|
goto end_of_line;
|
||||||
}
|
}
|
||||||
|
/* Backslash, $, and ` are special inside double quotes.
|
||||||
|
If we see any of those, punt. */
|
||||||
|
else if (instring == '"' && index ("\\$`", *p) != 0)
|
||||||
|
goto slow;
|
||||||
else
|
else
|
||||||
*ap++ = *p;
|
*ap++ = *p;
|
||||||
}
|
}
|
||||||
@@ -1399,7 +1395,8 @@ construct_command_argv_internal (line, restp, shell, ifs)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case '\'':
|
case '\'':
|
||||||
instring = 1;
|
case '"':
|
||||||
|
instring = *p;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case '\n':
|
case '\n':
|
||||||
@@ -1564,7 +1561,7 @@ construct_command_argv_internal (line, restp, shell, ifs)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (*p == '\\' || *p == '\''
|
if (*p == '\\' || *p == '\'' || *p == '"'
|
||||||
|| isspace (*p)
|
|| isspace (*p)
|
||||||
|| index (sh_chars, *p) != 0)
|
|| index (sh_chars, *p) != 0)
|
||||||
*ap++ = '\\';
|
*ap++ = '\\';
|
||||||
@@ -1580,11 +1577,12 @@ construct_command_argv_internal (line, restp, shell, ifs)
|
|||||||
return new_argv;
|
return new_argv;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Figure out the argument list necessary to run LINE as a command.
|
/* Figure out the argument list necessary to run LINE as a command. Try to
|
||||||
Try to avoid using a shell. This routine handles only ' quoting.
|
avoid using a shell. This routine handles only ' quoting, and " quoting
|
||||||
Starting quotes may be escaped with a backslash. If any of the
|
when no backslash, $ or ` characters are seen in the quotes. Starting
|
||||||
characters in sh_chars[] is seen, or any of the builtin commands
|
quotes may be escaped with a backslash. If any of the characters in
|
||||||
listed in sh_cmds[] is the first word of a line, the shell is used.
|
sh_chars[] is seen, or any of the builtin commands listed in sh_cmds[]
|
||||||
|
is the first word of a line, the shell is used.
|
||||||
|
|
||||||
If RESTP is not NULL, *RESTP is set to point to the first newline in LINE.
|
If RESTP is not NULL, *RESTP is set to point to the first newline in LINE.
|
||||||
If *RESTP is NULL, newlines will be ignored.
|
If *RESTP is NULL, newlines will be ignored.
|
||||||
|
|||||||
36
main.c
36
main.c
@@ -1,5 +1,5 @@
|
|||||||
/* Argument parsing and main program of GNU Make.
|
/* Argument parsing and main program of GNU Make.
|
||||||
Copyright (C) 1988, 89, 90, 91, 94 Free Software Foundation, Inc.
|
Copyright (C) 1988, 89, 90, 91, 94, 1995 Free Software Foundation, Inc.
|
||||||
This file is part of GNU Make.
|
This file is part of GNU Make.
|
||||||
|
|
||||||
GNU Make is free software; you can redistribute it and/or modify
|
GNU Make is free software; you can redistribute it and/or modify
|
||||||
@@ -397,6 +397,15 @@ enter_command_line_file (name)
|
|||||||
return enter_file (savestring (name, strlen (name)));
|
return enter_file (savestring (name, strlen (name)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Toggle -d on receipt of SIGUSR1. */
|
||||||
|
|
||||||
|
static RETSIGTYPE
|
||||||
|
debug_signal_handler (sig)
|
||||||
|
int sig;
|
||||||
|
{
|
||||||
|
debug_flag = ! debug_flag;
|
||||||
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
main (argc, argv, envp)
|
main (argc, argv, envp)
|
||||||
int argc;
|
int argc;
|
||||||
@@ -589,7 +598,7 @@ main (argc, argv, envp)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Now allocate a buffer big enough and fill it. */
|
/* Now allocate a buffer big enough and fill it. */
|
||||||
p = value = alloca (len);
|
p = value = (char *) alloca (len);
|
||||||
for (cv = command_variables; cv != 0; cv = cv->next)
|
for (cv = command_variables; cv != 0; cv = cv->next)
|
||||||
{
|
{
|
||||||
v = cv->variable;
|
v = cv->variable;
|
||||||
@@ -691,11 +700,16 @@ main (argc, argv, envp)
|
|||||||
/* This makefile is standard input. Since we may re-exec
|
/* This makefile is standard input. Since we may re-exec
|
||||||
and thus re-read the makefiles, we read standard input
|
and thus re-read the makefiles, we read standard input
|
||||||
into a temporary file and read from that. */
|
into a temporary file and read from that. */
|
||||||
static char name[] = "/tmp/GmXXXXXX";
|
|
||||||
FILE *outfile;
|
FILE *outfile;
|
||||||
|
|
||||||
/* Make a unique filename. */
|
/* Make a unique filename. */
|
||||||
|
#ifdef HAVE_MKTEMP
|
||||||
|
static char name[] = "/tmp/GmXXXXXX";
|
||||||
(void) mktemp (name);
|
(void) mktemp (name);
|
||||||
|
#else
|
||||||
|
static char name[L_tmpnam];
|
||||||
|
(void) tmpnam ();
|
||||||
|
#endif
|
||||||
|
|
||||||
outfile = fopen (name, "w");
|
outfile = fopen (name, "w");
|
||||||
if (outfile == 0)
|
if (outfile == 0)
|
||||||
@@ -744,6 +758,11 @@ main (argc, argv, envp)
|
|||||||
(void) signal (SIGCLD, child_handler);
|
(void) signal (SIGCLD, child_handler);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* Let the user send us SIGUSR1 to toggle the -d flag during the run. */
|
||||||
|
#ifdef SIGUSR1
|
||||||
|
(void) signal (SIGUSR1, debug_signal_handler);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Define the initial list of suffixes for old-style rules. */
|
/* Define the initial list of suffixes for old-style rules. */
|
||||||
|
|
||||||
set_default_suffixes ();
|
set_default_suffixes ();
|
||||||
@@ -1367,13 +1386,16 @@ positive integral argument",
|
|||||||
if (!env && (bad || print_usage_flag))
|
if (!env && (bad || print_usage_flag))
|
||||||
{
|
{
|
||||||
/* Print a nice usage message. */
|
/* Print a nice usage message. */
|
||||||
|
FILE *usageto;
|
||||||
|
|
||||||
if (print_version_flag)
|
if (print_version_flag)
|
||||||
print_version ();
|
print_version ();
|
||||||
|
|
||||||
fprintf (stderr, "Usage: %s [options] [target] ...\n", program);
|
usageto = bad ? stderr : stdout;
|
||||||
|
|
||||||
fputs ("Options:\n", stderr);
|
fprintf (usageto, "Usage: %s [options] [target] ...\n", program);
|
||||||
|
|
||||||
|
fputs ("Options:\n", usageto);
|
||||||
for (cs = switches; cs->c != '\0'; ++cs)
|
for (cs = switches; cs->c != '\0'; ++cs)
|
||||||
{
|
{
|
||||||
char buf[1024], shortarg[50], longarg[50], *p;
|
char buf[1024], shortarg[50], longarg[50], *p;
|
||||||
@@ -1444,11 +1466,11 @@ positive integral argument",
|
|||||||
line with the description, leaving at least two spaces.
|
line with the description, leaving at least two spaces.
|
||||||
Print it on its own line instead. */
|
Print it on its own line instead. */
|
||||||
{
|
{
|
||||||
fprintf (stderr, "%s\n", buf);
|
fprintf (usageto, "%s\n", buf);
|
||||||
buf[0] = '\0';
|
buf[0] = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
fprintf (stderr, "%*s%s.\n",
|
fprintf (usageto, "%*s%s.\n",
|
||||||
- DESCRIPTION_COLUMN,
|
- DESCRIPTION_COLUMN,
|
||||||
buf, cs->description);
|
buf, cs->description);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -163,6 +163,11 @@ the file names where they should reside for actual use. If there is a
|
|||||||
simple test to verify that a program is properly installed, this target
|
simple test to verify that a program is properly installed, this target
|
||||||
should run that test.
|
should run that test.
|
||||||
|
|
||||||
|
If possible, write the @code{install} target rule so that it does not
|
||||||
|
modify anything in the directory where the program was built, provided
|
||||||
|
@samp{make all} has just been done. This is convenient for building the
|
||||||
|
program under one user name and installing it under another.
|
||||||
|
|
||||||
The commands should create all the directories in which files are to be
|
The commands should create all the directories in which files are to be
|
||||||
installed, if they don't already exist. This includes the directories
|
installed, if they don't already exist. This includes the directories
|
||||||
specified as the values of the variables @code{prefix} and
|
specified as the values of the variables @code{prefix} and
|
||||||
@@ -205,6 +210,9 @@ Delete all the installed files that the @samp{install} target would
|
|||||||
create (but not the noninstalled files such as @samp{make all} would
|
create (but not the noninstalled files such as @samp{make all} would
|
||||||
create).
|
create).
|
||||||
|
|
||||||
|
This rule should not modify the directories where compilation is done,
|
||||||
|
only the directories where files are installed.
|
||||||
|
|
||||||
@comment The gratuitous blank line here is to make the table look better
|
@comment The gratuitous blank line here is to make the table look better
|
||||||
@comment in the printed Make manual. Please leave it in.
|
@comment in the printed Make manual. Please leave it in.
|
||||||
@item clean
|
@item clean
|
||||||
@@ -228,17 +236,34 @@ normally don't want to recompile. For example, the @samp{mostlyclean}
|
|||||||
target for GCC does not delete @file{libgcc.a}, because recompiling it
|
target for GCC does not delete @file{libgcc.a}, because recompiling it
|
||||||
is rarely necessary and takes a lot of time.
|
is rarely necessary and takes a lot of time.
|
||||||
|
|
||||||
@item realclean
|
@item maintainer-clean
|
||||||
Delete everything from the current directory that can be reconstructed
|
Delete almost everything from the current directory that can be
|
||||||
with this Makefile. This typically includes everything deleted by
|
reconstructed with this Makefile. This typically includes everything
|
||||||
@code{distclean}, plus more: C source files produced by Bison, tags tables,
|
deleted by @code{distclean}, plus more: C source files produced by
|
||||||
Info files, and so on.
|
Bison, tags tables, Info files, and so on.
|
||||||
|
|
||||||
One exception, however: @samp{make realclean} should not delete
|
The reason we say ``almost everything'' is that @samp{make
|
||||||
@file{configure} even if @file{configure} can be remade using a rule in
|
maintainer-clean} should not delete @file{configure} even if
|
||||||
the Makefile. More generally, @samp{make realclean} should not delete
|
@file{configure} can be remade using a rule in the Makefile. More
|
||||||
anything that needs to exist in order to run @file{configure}
|
generally, @samp{make maintainer-clean} should not delete anything that
|
||||||
and then begin to build the program.
|
needs to exist in order to run @file{configure} and then begin to build
|
||||||
|
the program. This is the only exception; @code{maintainer-clean} should
|
||||||
|
delete everything else that can be rebuilt.
|
||||||
|
|
||||||
|
The @samp{maintainer-clean} is intended to be used by a maintainer of
|
||||||
|
the package, not by ordinary users. You may need special tools to
|
||||||
|
reconstruct some of the files that @samp{make maintainer-clean} deletes.
|
||||||
|
Since these files are normally included in the distribution, we don't
|
||||||
|
take care to make them easy to reconstruct. If you find you need to
|
||||||
|
unpack the full distribution again, don't blame us.
|
||||||
|
|
||||||
|
To help make users aware of this, the commands for
|
||||||
|
@code{maintainer-clean} should start with these two:
|
||||||
|
|
||||||
|
@example
|
||||||
|
@@echo "This command is intended for maintainers to use;"
|
||||||
|
@@echo "it deletes files that may require special tools to rebuild."
|
||||||
|
@end example
|
||||||
|
|
||||||
@item TAGS
|
@item TAGS
|
||||||
Update a tags table for this program.
|
Update a tags table for this program.
|
||||||
@@ -327,6 +352,9 @@ installdirs: mkinstalldirs
|
|||||||
$(libdir) $(infodir) \
|
$(libdir) $(infodir) \
|
||||||
$(mandir)
|
$(mandir)
|
||||||
@end smallexample
|
@end smallexample
|
||||||
|
|
||||||
|
This rule should not modify the directories where compilation is done.
|
||||||
|
It should do nothing but create installation directories.
|
||||||
@end table
|
@end table
|
||||||
|
|
||||||
@node Command Variables
|
@node Command Variables
|
||||||
|
|||||||
3
make.h
3
make.h
@@ -1,5 +1,5 @@
|
|||||||
/* Miscellaneous global declarations and portability cruft for GNU Make.
|
/* Miscellaneous global declarations and portability cruft for GNU Make.
|
||||||
Copyright (C) 1988, 89, 90, 91, 92, 93, 94 Free Software Foundation, Inc.
|
Copyright (C) 1988, 89, 90, 91, 92, 93, 94, 95 Free Software Foundation, Inc.
|
||||||
This file is part of GNU Make.
|
This file is part of GNU Make.
|
||||||
|
|
||||||
GNU Make is free software; you can redistribute it and/or modify
|
GNU Make is free software; you can redistribute it and/or modify
|
||||||
@@ -173,7 +173,6 @@ extern unsigned int get_path_max ();
|
|||||||
extern char *malloc (), *realloc ();
|
extern char *malloc (), *realloc ();
|
||||||
extern void free ();
|
extern void free ();
|
||||||
|
|
||||||
extern void qsort ();
|
|
||||||
extern void abort (), exit ();
|
extern void abort (), exit ();
|
||||||
|
|
||||||
#endif /* Standard headers. */
|
#endif /* Standard headers. */
|
||||||
|
|||||||
@@ -5400,12 +5400,12 @@ variable names because many strange things are valid variable names, but
|
|||||||
are probably not what you intended. For example,
|
are probably not what you intended. For example,
|
||||||
|
|
||||||
@smallexample
|
@smallexample
|
||||||
files := $(foreach Es escrito en espanol!,b c ch,$(find_files))
|
files := $(foreach Esta escrito en espanol!,b c ch,$(find_files))
|
||||||
@end smallexample
|
@end smallexample
|
||||||
|
|
||||||
@noindent
|
@noindent
|
||||||
might be useful if the value of @code{find_files} references the variable
|
might be useful if the value of @code{find_files} references the variable
|
||||||
whose name is @samp{Es escrito en espanol!} (es un nombre bastante largo,
|
whose name is @samp{Esta escrito en espanol!} (es un nombre bastante largo,
|
||||||
no?), but it is more likely to be a mistake.
|
no?), but it is more likely to be a mistake.
|
||||||
|
|
||||||
@node Origin Function, Shell Function, Foreach Function, Functions
|
@node Origin Function, Shell Function, Foreach Function, Functions
|
||||||
|
|||||||
4
read.c
4
read.c
@@ -1,5 +1,5 @@
|
|||||||
/* Reading and parsing of makefiles for GNU Make.
|
/* Reading and parsing of makefiles for GNU Make.
|
||||||
Copyright (C) 1988, 89, 90, 91, 92, 93, 94 Free Software Foundation, Inc.
|
Copyright (C) 1988, 89, 90, 91, 92, 93, 94, 1995 Free Software Foundation, Inc.
|
||||||
This file is part of GNU Make.
|
This file is part of GNU Make.
|
||||||
|
|
||||||
GNU Make is free software; you can redistribute it and/or modify
|
GNU Make is free software; you can redistribute it and/or modify
|
||||||
@@ -631,7 +631,7 @@ read_makefile (filename, flags)
|
|||||||
;
|
;
|
||||||
else if (lb.buffer[0] == '\t')
|
else if (lb.buffer[0] == '\t')
|
||||||
{
|
{
|
||||||
p = lb.buffer;
|
p = collapsed; /* Ignore comments. */
|
||||||
while (isblank (*p))
|
while (isblank (*p))
|
||||||
++p;
|
++p;
|
||||||
if (*p == '\0')
|
if (*p == '\0')
|
||||||
|
|||||||
16
remake.c
16
remake.c
@@ -1,5 +1,5 @@
|
|||||||
/* Basic dependency engine for GNU Make.
|
/* Basic dependency engine for GNU Make.
|
||||||
Copyright (C) 1988, 89, 90, 91, 92, 93, 94 Free Software Foundation, Inc.
|
Copyright (C) 1988, 89, 90, 91, 92, 93, 94, 1995 Free Software Foundation, Inc.
|
||||||
This file is part of GNU Make.
|
This file is part of GNU Make.
|
||||||
|
|
||||||
GNU Make is free software; you can redistribute it and/or modify
|
GNU Make is free software; you can redistribute it and/or modify
|
||||||
@@ -556,7 +556,6 @@ update_file_1 (file, depth)
|
|||||||
if (!must_make)
|
if (!must_make)
|
||||||
{
|
{
|
||||||
DEBUGPR ("No need to remake target `%s'.\n");
|
DEBUGPR ("No need to remake target `%s'.\n");
|
||||||
file->update_status = 0;
|
|
||||||
notice_finished_file (file);
|
notice_finished_file (file);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -605,12 +604,12 @@ notice_finished_file (file)
|
|||||||
|
|
||||||
if (touch_flag
|
if (touch_flag
|
||||||
/* The update status will be:
|
/* The update status will be:
|
||||||
-1 if no commands were run;
|
-1 if this target was not remade;
|
||||||
0 if some commands (+ or ${MAKE}) were run and won;
|
0 if 0 or more commands (+ or ${MAKE}) were run and won;
|
||||||
1 if some commands were run and lost.
|
1 if some commands were run and lost.
|
||||||
The only time we don't want to touch the target is if
|
We touch the target if it has commands which either were not run
|
||||||
it had some recursive commands, and they lost. */
|
or won when they ran (i.e. status is 0). */
|
||||||
&& file->update_status != 1)
|
&& file->update_status == 0)
|
||||||
{
|
{
|
||||||
if (file->cmds != 0 && file->cmds->any_recurse)
|
if (file->cmds != 0 && file->cmds->any_recurse)
|
||||||
{
|
{
|
||||||
@@ -854,6 +853,9 @@ remake_file (file)
|
|||||||
execute_file_commands (file);
|
execute_file_commands (file);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
/* This tells notice_finished_file it is ok to touch the file. */
|
||||||
|
file->update_status = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* This does the touching under -t. */
|
/* This does the touching under -t. */
|
||||||
|
|||||||
Reference in New Issue
Block a user