1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-02-13 03:32:24 +00:00

Another build system overhaul (re: 35672208, 580ff616, 6cc2f6a0)

So far we've been handling AST release build and git commit flags
and ksh SHOPT_* compile time options in the generic package build
script. That was a hack that was necessary before I had sufficient
understanding of the build system. Some of it did not work very
well, e.g. the correct git commit did not show up in ${.sh.version}
when compiling from a git repo.

As of this commit, this is properly included in the mamake
dependency tree by handling it from the libast and ksh93 Mamfiles,
guaranteeing they are properly up to date.

For a release build, the _AST_ksh_release macro is renamed to
_AST_release, because some aspects of libast also use this.

This commit also adds my first attempt at documenting the (very
simple, six-command) mamake language as it is currently implemented
-- which is significantly different from Glenn Fowler's original
paper. This is mostly based on reading the mamake.c source code.

src/cmd/INIT/README-mamake.md:
- Added.

bin/package, src/cmd/INIT/package.sh:
- Delete the hack.

**/Mamfile:
- Remove KSH_RELFLAGS and KSH_SHOPTFLAGS, which supported the hack.
- Delete 'meta' commands. They were no-ops; mamake.c ignores them.
  They also did not add any informative value.

src/lib/libast/Mamfile:
- Add a 'virtual' target that obtains the current git commit,
  examines the git branch, and decides whether to auto-set an
  _AST_git_commit and/or or _AST_release #define to a new
  releaseflags.h header file. This is overwritten on each run.
- Add code to the install target that copies limit.h to
  include/ast, but only if it doesn't exist or the content of the
  original changed. This allows '#include <releaseflags.h>' from
  any program using libast while avoiding needless recompiles.
- When there are uncommitted changes, add /MOD (modified) to the
  commit hash instead of not defining it at all.

src/cmd/ksh93/**:
- Mamfile: Add a shopt.h target that reads SHOPT.sh and converts it
  into a new shopt.h header file in the object code directory. The
  shopt.h header only contains SHOPT_* directives that have a value
  in SHOPT.sh (not the empty/probe ones). They also do not redefine
  the macros if they already exist, so overriding with something
  like CCFLAGS+=' -DSHOPT_FOO=1' remains possible.
- **.c: Every c file now #includes "shopt.h" first. So SHOPT_*
  macros are no longer passed via environment/MAM variables.
* SHOPT.sh: The AUDITFILE and CMDLIB_DIR macros no longer need an
  extra backslash-escape for the double quotes in their values.
  (The old way required this because mamake inserts MAM variables
  directly into shell scripts as literals without quoting.  :-/ )

src/cmd/INIT/mamake.c:
- Import the two minor changes between from 93u+ and 93v-: bind()
  is renamed to bindfile() and there is a tweak to detecting an
  "improper done statement".
- Allow arbitrary whitespace (isspace()) everywhere, instead of
  spaces only. This obsoletes my earlier indentation workaround
  from 6cc2f6a0; turns out mamake always supported indentation, but
  with spaces only.
- Do not skip line numbers at the beginning of each line. This
  undocumented feature is not and (AFAICT) never has been used.
- Throw an error on unknown command or rule attribute. Quite an
  important feature for manual maintenance: catches typos, etc.
This commit is contained in:
Martijn Dekker 2022-06-12 05:35:15 +01:00
parent ed5d561a72
commit 148a8a3f46
84 changed files with 1924 additions and 1896 deletions

View file

@ -109,7 +109,7 @@ command=${0##*/}
case $(getopts '[-][123:xyz]' opt --xyz 2>/dev/null; echo 0$opt) in
0123) USAGE=$'
[-?
@(#)$Id: '$command$' (ksh 93u+m) 2022-02-24 $
@(#)$Id: '$command$' (ksh 93u+m) 2022-06-12 $
]
[-author?Glenn Fowler <gsf@research.att.com>]
[-author?Contributors to https://github.com/ksh93/ksh]
@ -674,45 +674,6 @@ case $CC in
*) export CC ;;
esac
# Add build type flags via KSH_RELFLAGS, which is used in src/cmd/ksh93/Mamfile.
# (Avoid using CCFLAGS; setting it would overwrite autodetected optimization flags.)
ksh_relflags=
case $(git branch 2>/dev/null) in
'' | *\*\ [0-9]*.[0-9]*)
# If we're not on a git branch (tarball) or on a branch that starts
# with a number (release branch), then compile as a release version
ksh_relflags="${ksh_relflags:+$ksh_relflags }-D_AST_ksh_release" ;;
*) # Otherwise, add 8-character git commit hash if available, and if the working dir is clean
git_commit=$(git status >/dev/null 2>&1 && git diff-index --quiet HEAD && git rev-parse --short=8 HEAD)
case $git_commit in
????????)
ksh_relflags="${ksh_relflags:+$ksh_relflags }-D_AST_git_commit=\\\"$git_commit\\\"" ;;
esac
unset git_commit ;;
esac
case $ksh_relflags in
?*) # add the extra flags as an argument to mamake
assign="${assign:+$assign }KSH_RELFLAGS=\"\$ksh_relflags\"" ;;
esac
# Add ksh compile-options via KSH_SHOPTFLAGS.
SHOPT()
{
case $1 in
*=?*) ksh_shoptflags="${ksh_shoptflags:+$ksh_shoptflags }-DSHOPT_$1" ;;
esac
}
ksh_shoptflags=
shopt_sh='src/cmd/ksh93/SHOPT.sh' # this script calls SHOPT() to set options
if test -f "$shopt_sh"
then . "$shopt_sh"
else echo "WARNING: $shopt_sh is missing" >&2
fi
case $ksh_shoptflags in
?*) # add the extra flags as an argument to mamake
assign="${assign:+$assign }KSH_SHOPTFLAGS=\"\$ksh_shoptflags\"" ;;
esac
# grab action specific args
case $action in
@ -3149,7 +3110,7 @@ cat $j $k
# check against previous compiler and flags
err=
for var in CC CCFLAGS CCLDFLAGS LDFLAGS KSH_RELFLAGS
for var in CC CCFLAGS CCLDFLAGS LDFLAGS
do store=$INSTALLROOT/lib/package/gen/$var
eval "new=\$$var"
if test -f $store

View file

@ -1,12 +1,10 @@
info mam static
note *
note * This build file is in the Make Abstract Machine (MAM) language. It was
note * first generated by nmake, but in the ksh 93u+m distribution we maintain
note * it manually because nmake had too many problems to keep using. The
note * Mamfiles are processed by mamake (src/cmd/INIT/mamake.c); we added
note * support for indentation to improve readability. The language is
note * documented in Glenn Fowler's paper "A Make Abstract Machine":
note * http://web.archive.org/web/20041227143022/http://www2.research.att.com/~gsf/mam/mam.html
note * indentation to improve readability. The language is documented in
note * src/cmd/INIT/README-mamake.md.
note *
note source level :MAKE: equivalent
make test

View file

@ -1,18 +1,15 @@
info mam static 00000 1994-07-17 make (AT&T Research) 5.7 2012-06-20
note *
note * This build file is in the Make Abstract Machine (MAM) language. It was
note * first generated by nmake, but in the ksh 93u+m distribution we maintain
note * it manually because nmake had too many problems to keep using. The
note * Mamfiles are processed by mamake (src/cmd/INIT/mamake.c); we added
note * support for indentation to improve readability. The language is
note * documented in Glenn Fowler's paper "A Make Abstract Machine":
note * http://web.archive.org/web/20041227143022/http://www2.research.att.com/~gsf/mam/mam.html
note * indentation to improve readability. The language is documented in
note * src/cmd/INIT/README-mamake.md.
note *
setv INSTALLROOT ../../..
setv PACKAGEROOT ../../../../..
setv CC cc
setv mam_cc_FLAGS
setv KSH_RELFLAGS
setv CCFLAGS ${-debug-symbols?1?${mam_cc_DEBUG} -D_BLD_DEBUG?${mam_cc_OPTIMIZE}?}
setv CCLDFLAGS ${-strip-symbols?1?${mam_cc_LD_STRIP}??}
setv COTEMP $$
@ -21,7 +18,6 @@ make install
make iffe
make iffe.sh
done iffe.sh
meta iffe %.sh>% iffe.sh iffe
prev iffe.sh
exec - case static,port:$OPTIND:$RANDOM in
exec - ?*:*:*|*::*|*:*:$RANDOM)
@ -58,7 +54,6 @@ make install
make mktest
make mktest.sh
done mktest.sh
meta mktest %.sh>% mktest.sh mktest
prev mktest.sh
exec - case static,port:$OPTIND:$RANDOM in
exec - ?*:*:*|*::*|*:*:$RANDOM)
@ -95,7 +90,6 @@ make install
make package
make package.sh
done package.sh
meta package %.sh>% package.sh package
prev package.sh
exec - case static,port:$OPTIND:$RANDOM in
exec - ?*:*:*|*::*|*:*:$RANDOM)
@ -132,7 +126,6 @@ make install
make regress
make regress.sh
done regress.sh
meta regress %.sh>% regress.sh regress
prev regress.sh
exec - case static,port:$OPTIND:$RANDOM in
exec - ?*:*:*|*::*|*:*:$RANDOM)
@ -169,7 +162,6 @@ make install
make rt
make rt.sh
done rt.sh
meta rt %.sh>% rt.sh rt
prev rt.sh
exec - case static,port:$OPTIND:$RANDOM in
exec - ?*:*:*|*::*|*:*:$RANDOM)
@ -206,7 +198,6 @@ make install
make crossexec
make crossexec.sh
done crossexec.sh
meta crossexec %.sh>% crossexec.sh crossexec
prev crossexec.sh
exec - case static,port:$OPTIND:$RANDOM in
exec - ?*:*:*|*::*|*:*:$RANDOM)
@ -243,7 +234,6 @@ make install
make execrate
make execrate.sh
done execrate.sh
meta execrate %.sh>% execrate.sh execrate
prev execrate.sh
exec - case static,port:$OPTIND:$RANDOM in
exec - ?*:*:*|*::*|*:*:$RANDOM)
@ -280,7 +270,6 @@ make install
make filter
make filter.sh
done filter.sh
meta filter %.sh>% filter.sh filter
prev filter.sh
exec - case static,port:$OPTIND:$RANDOM in
exec - ?*:*:*|*::*|*:*:$RANDOM)
@ -317,7 +306,6 @@ make install
make ignore
make ignore.sh
done ignore.sh
meta ignore %.sh>% ignore.sh ignore
prev ignore.sh
exec - case static,port:$OPTIND:$RANDOM in
exec - ?*:*:*|*::*|*:*:$RANDOM)
@ -357,7 +345,6 @@ make install
make silent
make silent.sh
done silent.sh
meta silent %.sh>% silent.sh silent
prev silent.sh
exec - case static,port:$OPTIND:$RANDOM in
exec - ?*:*:*|*::*|*:*:$RANDOM)
@ -402,16 +389,14 @@ make install
make ast.h implicit
done ast.h dontcare virtual
done mamake.c
meta mamake.o %.c>%.o mamake.c mamake
prev mamake.c
exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} -c mamake.c
exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -c mamake.c
done mamake.o generated
exec - ${CC} ${CCLDFLAGS} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} ${LDFLAGS} -o mamake mamake.o
exec - ${CC} ${CCLDFLAGS} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} -o mamake mamake.o
done mamake generated
make mprobe
make mprobe.sh
done mprobe.sh
meta mprobe %.sh>% mprobe.sh mprobe
prev mprobe.sh
exec - case static,port:$OPTIND:$RANDOM in
exec - ?*:*:*|*::*|*:*:$RANDOM)
@ -456,7 +441,6 @@ make install
done make.probe
exec - cat C+probe make.probe > probe.sh
done probe.sh generated
meta probe %.sh>% probe.sh probe
prev probe.sh
exec - case static,port:$OPTIND:$RANDOM in
exec - ?*:*:*|*::*|*:*:$RANDOM)
@ -534,7 +518,6 @@ make install
done ${PACKAGEROOT}/bin/ignore generated
make ${PACKAGEROOT}/bin/mamprobe
make mamprobe
meta mamprobe %.sh>% mamprobe.sh mamprobe
make mamprobe.sh
done mamprobe.sh
exec - case static,port:$OPTIND:$RANDOM in
@ -1110,15 +1093,12 @@ make install
done install virtual
make test
make test.iffe
prev iffe
make iffe.tst
done iffe.tst
exec - regress iffe.tst iffe
done test.iffe virtual
make test.mamake
prev mamake
make mamake.tst
meta mamake.tst %.rt>%.tst mamake.rt mamake
make mamake.rt
done mamake.rt
exec - if [[ "1" || "mamake.rt" -nt "mamake.tst" ]]

View file

@ -0,0 +1,176 @@
## mamake and the MAM language ##
MAM (Make Abstract Machine) is a simple rule-based make language
that is implemented in just six four-letter commands and five attributes,
yet allows unlimited flexibility as it can execute arbitrary shell code.
The program implementing MAM, `mamake`,
is a portable C90 program written in a single file, `mamake.c`.
This allows ksh 93u+m,
or other programs using this build system,
to be built using only a standard C compiler and utilities installation
without any other dependencies or complications.
MAM was designed by Glenn Fowler at AT&T.
The [original documentation](http://web.archive.org/web/20041227143022/http://www2.research.att.com/~gsf/mam/mam.html)
for MAM specified a more extensive language than was actually implemented in `mamake.c`,
while the `ignore` attribute is not documented there.
This file documents the MAM implementation that we are actually using.
`mamake` processes make files called `Mamfile`.
These were originally generated by a complex AT&T make system called `nmake`.
The intention was for `mamake` to process generated Mamfiles only
and not for it to replace `make`.
Yet, we are using it as our `make` in the ksh 93u+m distribution.
`nmake` was slow, brittle, and did not work on some modern systems, e.g. macOS.
It was not worth fixing because it is about as complex as ksh itself --
whereas `mamake` is simple and portable, and offers all the same flexibility.
Compared to the 2012-08-01 AT&T distribution,
ksh 93u+m made a few minor changes to `mamake` that make it easier to maintain Mamfiles by hand:
* All Mamfiles have been indented for legibility. (See `bin/Mamfile_indent` in the distribution.)
* Indentation and word separators may use any whitespace (e.g. tabs), not only spaces.
* Unrecognized commands and rule attributes throw an error instead of being silently ignored.
* Fixed some crashing bugs and memory leaks.
### Comments and unrecognized commands ###
MAM commands have the following basic form:
*command* [ *argument* [ *operand string* ] ]
The *command* name consists of four lower-case letters.
Any other command name is an error.
Unrecognized commands or attributes produce a warning and are then ignored.
The first argument is a single word.
The operand string is any arbitrary text until the end of the line.
### Comments ###
`note` is the comment command and is ignored.
For historical reasons, `info` and `meta` are also ignored.
### Rules ###
`make` *rule* [ *attribute* ... ]
`done` *rule* [ *attribute* ... ]
A `make`...`done` block defines the target rule named *rule* using the other commands described here.
Unless the `virtual` attribute is used, *rule* names the pathname of the file generated or referenced by the rule.
Dependencies may be defined in two ways:
1. By nesting `make`...`done` blocks:
the enclosing *rule* is the parent
and the enclosed *rules* are the prerequisites.
2. By using the `prev` command (see **Referencing previously defined rules** below)
to reference a previous `make`...`done` block.
The dependency is defined as if that block were repeated at the `prev` command's location.
If the block contains one or more `exec` commands (see **Shell actions** below),
the `done` command executes the shell script defined by them.
One or more of the following *attribute*s may be specified
by appending them to the `make` or `done` command:
* `archive`: Ignored.
Historically used to mark the generation of an `ar`(1) archive.
* `dontcare`: Marks files that do not need to exist.
If the file exists then its last-modified timestamp is checked and propagated,
otherwise it is silently ignored.
* `generated`: Marks rules that produce output files generated by a shell action.
The `exec` command implicitly assigns this attribute, but it is customary to specify it regardless.
* `ignore`: The timestamp associated with *rule* is ignored in dependency resolution.
* `implicit`: Marks the current rule as an implicit prerequisite of the enclosing parent rule.
An implicit prerequisite can make the parent rule out of date without triggering the parent action.
Implicit prerequisites usually correspond to `#include` prerequisites.
For example, if `foo.o` is generated from `foo.c` and `foo.c` includes `foo.h`,
then `foo.h` should be marked as an implicit prerequisite of `foo.c`
so that touching `foo.h` does not make `foo.c` out of date while making `foo.o` out of date.
* `joint`: Ignored.
Historically used to mark one of a group of rules that are built by a single shell action.
* `virtual`: Marks a rule that is not associated with any file.
The commands within are executed every time the Mamfile is processed.
By convention, a virtual rule named `all` makes everything,
and a virtual rule named `install` performs installation.
Unrecognized attributes produce a warning and are then ignored.
### Referencing previously defined rules ###
`prev` *rule* [ *attribute* ... ]
This command references a rule that has previously been defined by `make`...`done`,
regardless of block nesting level.
It can be used to make a rule a prerequisite of multiple `make`...`done` blocks without repeating the rule.
By convention, the *attribute*s of the referenced block are repeated in the `prev` command.
However, `mamake` ignores anything after *rule*.
### MAM variables ###
`setv` *variable* [ *defaultvalue* ]
Defines a new MAM *variable*, optionally assigning the initial *defaultvalue*.
If the *defaultvalue* begins and ends with double quotes (`"`), those are discarded.
If the variable already has a value, the `setv` command is ignored; assigning a new value is not possible.
When `mamake` starts, it imports all environment variables as MAM variables,
so any variable's default value can be overridden by exporting an environment variable by its name.
MAM variables are referenced using the sh-style `${`...`}` syntax, though the braces are *not* optional.
Any reference to an undefined variable is silently left unexpanded (and not replaced by the empty string).
Expansion of MAM variable references is recursive, i.e., the value may itself contain other variable references.
Beware: there is no reference loop detection.
[`TODO`: figure out and document advanced expansion syntax supported by `substitute()` in `mamake.c`]
### Shell actions ###
`exec` `-` *code*
One or more `exec` commands within a `make`...`done` block
define a shell script that is executed for *rule*.
The word following `exec` is ignored; by convention it is `-`.
Each `exec` command appends a line of code to the shell script for the current rule.
It is customary for a rule's `exec` commands to be contiguous, but not necessary.
Before adding each line of code to the script,
MAM variable references (see **MAM variables** above)
are expanded; their literal values are inserted into the *code* line
(beware: no quoting is applied!).
When `mamake` encounters the `done` command,
the script is executed by the shell whose path is in the `SHELL` environment variable
or, absent that, by `/bin/sh`.
The `exec` command assigns the `generated` attribute to the current rule, even if it was not specified.
### Binding libraries ###
`bind` `-l`*libraryname* [ `dontcare` ]
An argument of `-l`*libraryname* (or `+l`*libraryname*)
causes a MAM variable `mam_lib`*libraryname* to be defined (see **MAM variables** above).
The variable will contain either the compiler argument for linking to the library *libraryname*
(either the `-l`*libraryname* flag, or the full path in case of a static library)
or, if the `dontcare` attribute is specified, possibly the empty string.
This can be used both for AST libraries shipped with the distribution and for system libraries.
If the library file is found in the distribution,
its time stamp is checked and the current target is marked as outdated if it is newer.
There is also a mechanism to communicate library dependency information across Mamfiles and `mamake` invocations.
If a file named *libraryname* in the current directory
or an `${INSTALLROOT}/lib/lib/`*libraryname*`.req` file
exists, `mamake` processes each of the words in the form `-l`*libraryname* in its contents
as if they were arguments to `bind` commands
and the resulting values are appended to the value of `mam_lib`*libraryname*
as dependencies separated by spaces.
`mamake` does not create these dependency files;
they are expected to be generated by Mamfile shell actions (see **Shell actions** above).
If no such dependency file exists, and the `dontcare` attribute is added,
then `mamake` compiles a small test program on the fly to check if the library exists;
if this fails, the `mam_lib`*libraryname* variable will be emptied.
Any `bind` command whose argument does not start with `-l` or `+l` is ignored.
[`TODO`: `bind` is not yet fully understood; more `mamake.c` code analysis is required.
In `require()` in `mamake.c` there is some special handling for dynamic libraries.
Note that the `bind` functionality implemented in `mamake.c`
is completely different from that described in the original documentation.]

View file

@ -1,8 +1,8 @@
/***********************************************************************
* *
* This software is part of the ast package *
* Copyright (c) 1990-2011 AT&T Intellectual Property *
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
* Copyright (c) 1990-2013 AT&T Intellectual Property *
* Copyright (c) 2020-2022 Contributors to ksh 93u+m *
* and is licensed under the *
* Eclipse Public License, Version 1.0 *
* by AT&T Intellectual Property *
@ -27,7 +27,7 @@
* coded for portability
*/
#define RELEASE_DATE "2021-01-21"
#define RELEASE_DATE "2022-06-12"
static char id[] = "\n@(#)$Id: mamake (ksh 93u+m) " RELEASE_DATE " $\0\n";
#if _PACKAGE_ast
@ -70,11 +70,8 @@ static const char usage[] =
"[n:?Print actions but do not execute. Recursion actions (see \b-r\b) are still"
" executed. Use \b-N\b to disable recursion actions too.]"
"[r:?Recursively make leaf directories matching \apattern\a. Only leaf"
" directories containing a makefile named \bNmakefile\b, \bnmakefile\b,"
" \bMakefile\b or \bmakefile\b are considered. The first makefile"
" found in each leaf directory is scanned for leaf directory"
" prerequisites; the recursion order is determined by a topological sort"
" of these prerequisites.]:[pattern]"
" directories containing a file named \bMamfile\b"
" are considered.]:[pattern]"
"[C:?Do all work in \adirectory\a. All messages will mention"
" \adirectory\a.]:[directory]"
"[D:?Set the debug trace level to \alevel\a. Higher levels produce more"
@ -693,6 +690,7 @@ view(void)
{
p = state.pwd + strlen(state.pwd);
while (p > state.pwd)
{
if (*--p == '/')
{
if (p == state.pwd)
@ -707,6 +705,7 @@ view(void)
break;
}
}
}
if (p <= state.pwd)
report(3, "cannot determine viewpath offset", s, (unsigned long)0);
}
@ -873,8 +872,8 @@ substitute(Buf_t* buf, register char* s)
{
if (a && t[0] == 'm' && t[1] == 'a' && t[2] == 'm' && t[3] == '_' && t[4] == 'l' && t[5] == 'i' && t[6] == 'b')
{
for (t = v; *t == ' '; t++);
for (; *t && *t != ' '; t++);
for (t = v; isspace(*t); t++);
for (; *t && !isspace(*t); t++);
if (*t)
*t = 0;
else
@ -990,6 +989,7 @@ find(Buf_t* buf, char* file, struct stat* st)
else
vp = vp->next;
if (vp)
{
do
{
if (node)
@ -1013,6 +1013,7 @@ find(Buf_t* buf, char* file, struct stat* st)
return s;
}
} while (vp = vp->next);
}
}
return 0;
}
@ -1022,7 +1023,7 @@ find(Buf_t* buf, char* file, struct stat* st)
*/
static unsigned long
bind(Rule_t* r)
bindfile(Rule_t* r)
{
char* s;
Buf_t* buf;
@ -1143,10 +1144,7 @@ input(void)
else if (*state.input && *(e = state.input + strlen(state.input) - 1) == '\n')
*e = 0;
state.sp->line++;
e = state.input;
while (isspace(*e))
e++; /* allow indentation */
return e;
return state.input;
}
/*
@ -1242,9 +1240,9 @@ run(Rule_t* r, register char* s)
i = 2;
else
{
for (i = 3; *(t + i) == ' ' || *(t + i) == '\t'; i++);
for (i = 3; isspace(*(t + i)); i++);
*s = c;
for (s = t + i; *s && *s != ' ' && *s != '\t' && *s != '\n'; s++);
for (s = t + i; *s && !isspace(*s); s++);
c = *s;
*s = 0;
append(buf, t + 2);
@ -1315,7 +1313,7 @@ path(Buf_t* buf, char* s, int must)
int o;
Stat_t st;
for (e = s; *e && *e != ' ' && *e != '\t'; e++);
for (e = s; *e && !isspace(*e); e++);
t = *e;
if ((x = status(buf, 0, s, &st)) && (st.st_mode & (S_IXUSR|S_IXGRP|S_IXOTH)))
return x;
@ -1416,30 +1414,46 @@ attributes(register Rule_t* r, register char* s)
for (;;)
{
for (; *s == ' '; s++);
for (t = s; *s && *s != ' '; s++);
int flag = 0;
for (; isspace(*s); s++);
for (t = s; *s && !isspace(*s); s++);
if (!(n = s - t))
break;
switch (*t)
{
case 'd':
if (n == 8 && !strncmp(t, "dontcare", n))
r->flags |= RULE_dontcare;
flag = RULE_dontcare;
break;
case 'g':
if (n == 9 && !strncmp(t, "generated", n))
r->flags |= RULE_generated;
flag = RULE_generated;
break;
case 'i':
if (n == 6 && !strncmp(t, "ignore", n))
r->flags |= RULE_ignore;
flag = RULE_ignore;
else if (n == 8 && !strncmp(t, "implicit", n))
r->flags |= RULE_implicit;
flag = RULE_implicit;
break;
case 'v':
if (n == 7 && !strncmp(t, "virtual", n))
r->flags |= RULE_virtual;
flag = RULE_virtual;
break;
case 'a':
if (n == 7 && !strncmp(t, "archive", n))
flag = -1; /* ignore (not implemented) */
break;
case 'j':
if (n == 5 && !strncmp(t, "joint", n))
flag = -1; /* ignore (not implemented) */
break;
}
if(flag > 0)
r->flags |= flag;
else if(flag == 0)
{
t[n] = '\0';
report(3, "unknown attribute", t, (unsigned long)0);
}
}
}
@ -1521,13 +1535,13 @@ require(char* lib, int dontcare)
{
for (;;)
{
while ((c = fgetc(f)) == ' ' || c == '\t' || c == '\n');
while (isspace(c = fgetc(f)));
if (c == EOF)
break;
do
{
add(tmp, c);
} while ((c = fgetc(f)) != EOF && c != ' ' && c != '\t' && c != '\n');
} while ((c = fgetc(f)) != EOF && !isspace(c));
s = use(tmp);
if (s[0] && (s[0] != '-' || s[1]))
{
@ -1591,7 +1605,7 @@ make(Rule_t* r)
state.active++;
if (*r->name)
{
z = bind(r);
z = bindfile(r);
state.indent++;
report(-1, r->name, "make", r->time);
}
@ -1599,29 +1613,38 @@ make(Rule_t* r)
z = 0;
buf = buffer();
cmd = 0;
/*
* Parse lines
*/
while (s = input())
{
for (; *s == ' '; s++);
for (; isdigit(*s); s++);
for (; *s == ' '; s++);
for (u = s; *s && *s != ' '; s++);
/* skip initial whitespace and empty line */
for (; isspace(*s); s++);
if (!*s)
continue;
/* isolate command name (u), argument word (t), and the operand string (v) */
for (u = s; *s && !isspace(*s); s++);
if (*s)
{
for (*s++ = 0; *s == ' '; s++);
for (t = s; *s && *s != ' '; s++);
for (*s++ = 0; isspace(*s); s++);
for (t = s; *s && !isspace(*s); s++);
if (*s)
for (*s++ = 0; *s == ' '; s++);
for (*s++ = 0; isspace(*s); s++);
v = s;
}
else
t = v = s;
/* enforce 4-letter lowercase command name */
if(u[0]<'a' || u[0]>'z' || u[1]<'a' || u[1]>'z' || u[2]<'a' || u[2]>'z' || u[3]<'a' || u[3]>'z' || u[4] && !isspace(u[4]))
report(3, "not a command name", u, (unsigned long)0);
switch (KEY(u[0], u[1], u[2], u[3]))
{
case KEY('b','i','n','d'):
if ((t[0] == '-' || t[0] == '+') && t[1] == 'l' && (s = require(t, !strcmp(v, "dontcare"))) && strncmp(r->name, "FEATURE/", 8) && strcmp(r->name, "configure.h"))
{
for (;;)
{
for (t = s; *s && *s != ' '; s++);
for (t = s; *s && !isspace(*s); s++);
if (*s)
*s = 0;
else
@ -1630,7 +1653,7 @@ make(Rule_t* r)
{
q = rule(expand(buf, t));
attributes(q, v);
x = bind(q);
x = bindfile(q);
if (z < x)
z = x;
if (q->flags & RULE_error)
@ -1638,12 +1661,13 @@ make(Rule_t* r)
}
if (!s)
break;
for (*s++ = ' '; *s == ' '; s++);
for (*s++ = ' '; isspace(*s); s++);
}
}
continue;
case KEY('d','o','n','e'):
q = rule(expand(buf, t));
if (q != r)
if (q != r && t[0] != '$')
report(2, "improper done statement", t, (unsigned long)0);
attributes(r, v);
if (cmd && state.active && (state.force || r->time < z || !r->time && !z))
@ -1726,8 +1750,13 @@ make(Rule_t* r)
probe();
}
continue;
default:
case KEY('i','n','f','o'):
case KEY('n','o','t','e'):
case KEY('m','e','t','a'):
/* comment command */
continue;
default:
report(3, "unknown command", u, (unsigned long)0);
}
break;
}
@ -1863,8 +1892,8 @@ scan(Dict_item_t* item, void* handle)
j = p = 0;
while (*s)
{
for (k = 1; (i = *s) == ' ' || i == '\t' || i == '"' || i == '\''; s++);
for (t = s; (i = *s) && i != ' ' && i != '\t' && i != '"' && i != '\'' && i != '\\' && i != ':'; s++)
for (k = 1; isspace(i = *s) || i == '"' || i == '\''; s++);
for (t = s; (i = *s) && !isspace(i) && i != '"' && i != '\'' && i != '\\' && i != ':'; s++)
if (i == '/')
t = s + 1;
else if (i == '.' && *(s + 1) != 'c' && *(s + 1) != 'C' && *(s + 1) != 'h' && *(s + 1) != 'H' && t[0] == 'l' && t[1] == 'i' && t[2] == 'b')
@ -1892,7 +1921,7 @@ scan(Dict_item_t* item, void* handle)
t = use(buf);
}
if (i == ':')
while (*s && (*s == ' ' || *s == '\t'))
while (*s && isspace(*s))
s++;
}
}
@ -1906,7 +1935,9 @@ scan(Dict_item_t* item, void* handle)
k = 0;
}
else
{
for (u = t; *u; u++)
{
if (isupper(*u))
*u = tolower(*u);
else if (!isalnum(*u))
@ -1914,16 +1945,22 @@ scan(Dict_item_t* item, void* handle)
k = 0;
break;
}
}
}
}
else if (t[0] != 'l' || t[1] != 'i' || t[2] != 'b')
k = 0;
else
{
for (u = t + 3; *u; u++)
{
if (!isalnum(*u))
{
k = 0;
break;
}
}
}
if (k && ((q = (Rule_t*)search(state.leaf, t, NiL)) && q != r || *t++ == 'l' && *t++ == 'i' && *t++ == 'b' && *t && (q = (Rule_t*)search(state.leaf, t, NiL)) && q != r))
{
for (t = w = r->name; *w; w++)
@ -2319,7 +2356,9 @@ main(int argc, char** argv)
*/
for (e = environ; s = *e; e++)
{
for (t = s; *t; t++)
{
if (*t == '=')
{
*t = 0;
@ -2327,6 +2366,8 @@ main(int argc, char** argv)
*t = '=';
break;
}
}
}
/*
* grab the command line targets and variable definitions
@ -2335,6 +2376,7 @@ main(int argc, char** argv)
while (s = *argv++)
{
for (t = s; *t; t++)
{
if (*t == '=')
{
v = t + 1;
@ -2351,6 +2393,7 @@ main(int argc, char** argv)
*t = c;
break;
}
}
if (!*t)
{
/*

View file

@ -109,7 +109,7 @@ command=${0##*/}
case $(getopts '[-][123:xyz]' opt --xyz 2>/dev/null; echo 0$opt) in
0123) USAGE=$'
[-?
@(#)$Id: '$command$' (ksh 93u+m) 2022-02-24 $
@(#)$Id: '$command$' (ksh 93u+m) 2022-06-12 $
]
[-author?Glenn Fowler <gsf@research.att.com>]
[-author?Contributors to https://github.com/ksh93/ksh]
@ -674,45 +674,6 @@ case $CC in
*) export CC ;;
esac
# Add build type flags via KSH_RELFLAGS, which is used in src/cmd/ksh93/Mamfile.
# (Avoid using CCFLAGS; setting it would overwrite autodetected optimization flags.)
ksh_relflags=
case $(git branch 2>/dev/null) in
'' | *\*\ [0-9]*.[0-9]*)
# If we're not on a git branch (tarball) or on a branch that starts
# with a number (release branch), then compile as a release version
ksh_relflags="${ksh_relflags:+$ksh_relflags }-D_AST_ksh_release" ;;
*) # Otherwise, add 8-character git commit hash if available, and if the working dir is clean
git_commit=$(git status >/dev/null 2>&1 && git diff-index --quiet HEAD && git rev-parse --short=8 HEAD)
case $git_commit in
????????)
ksh_relflags="${ksh_relflags:+$ksh_relflags }-D_AST_git_commit=\\\"$git_commit\\\"" ;;
esac
unset git_commit ;;
esac
case $ksh_relflags in
?*) # add the extra flags as an argument to mamake
assign="${assign:+$assign }KSH_RELFLAGS=\"\$ksh_relflags\"" ;;
esac
# Add ksh compile-options via KSH_SHOPTFLAGS.
SHOPT()
{
case $1 in
*=?*) ksh_shoptflags="${ksh_shoptflags:+$ksh_shoptflags }-DSHOPT_$1" ;;
esac
}
ksh_shoptflags=
shopt_sh='src/cmd/ksh93/SHOPT.sh' # this script calls SHOPT() to set options
if test -f "$shopt_sh"
then . "$shopt_sh"
else echo "WARNING: $shopt_sh is missing" >&2
fi
case $ksh_shoptflags in
?*) # add the extra flags as an argument to mamake
assign="${assign:+$assign }KSH_SHOPTFLAGS=\"\$ksh_shoptflags\"" ;;
esac
# grab action specific args
case $action in
@ -3149,7 +3110,7 @@ cat $j $k
# check against previous compiler and flags
err=
for var in CC CCFLAGS CCLDFLAGS LDFLAGS KSH_RELFLAGS
for var in CC CCFLAGS CCLDFLAGS LDFLAGS
do store=$INSTALLROOT/lib/package/gen/$var
eval "new=\$$var"
if test -f $store

View file

@ -1,12 +1,10 @@
info mam static
note *
note * This build file is in the Make Abstract Machine (MAM) language. It was
note * first generated by nmake, but in the ksh 93u+m distribution we maintain
note * it manually because nmake had too many problems to keep using. The
note * Mamfiles are processed by mamake (src/cmd/INIT/mamake.c); we added
note * support for indentation to improve readability. The language is
note * documented in Glenn Fowler's paper "A Make Abstract Machine":
note * http://web.archive.org/web/20041227143022/http://www2.research.att.com/~gsf/mam/mam.html
note * indentation to improve readability. The language is documented in
note * src/cmd/INIT/README-mamake.md.
note *
note component level :MAKE: equivalent
make test

View file

@ -1,12 +1,10 @@
info mam static 00000 1994-07-17 make (AT&T Research) 5.7 2012-06-20
note *
note * This build file is in the Make Abstract Machine (MAM) language. It was
note * first generated by nmake, but in the ksh 93u+m distribution we maintain
note * it manually because nmake had too many problems to keep using. The
note * Mamfiles are processed by mamake (src/cmd/INIT/mamake.c); we added
note * support for indentation to improve readability. The language is
note * documented in Glenn Fowler's paper "A Make Abstract Machine":
note * http://web.archive.org/web/20041227143022/http://www2.research.att.com/~gsf/mam/mam.html
note * indentation to improve readability. The language is documented in
note * src/cmd/INIT/README-mamake.md.
note *
setv INSTALLROOT ../../..
setv PACKAGE_ast_INCLUDE ${INSTALLROOT}/include/ast
@ -14,7 +12,6 @@ setv PACKAGE_cmd ${INSTALLROOT}
setv PACKAGEROOT ../../../../..
setv CC cc
setv mam_cc_FLAGS
setv KSH_RELFLAGS
setv CCFLAGS ${-debug-symbols?1?${mam_cc_DEBUG} -D_BLD_DEBUG?${mam_cc_OPTIMIZE}?}
setv CCLDFLAGS ${-strip-symbols?1?${mam_cc_LD_STRIP}??}
setv IFFEFLAGS
@ -30,10 +27,9 @@ make install
make pty.o
make pty.c
make FEATURE/pty implicit
meta FEATURE/pty features/%>FEATURE/% features/pty pty
make features/pty
done features/pty
exec - iffe ${IFFEFLAGS} -v -c "${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} ${LDFLAGS}" ref ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libast} ${mam_libcmd} : run features/pty
exec - iffe ${IFFEFLAGS} -v -c "${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS}" ref ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libast} ${mam_libcmd} : run features/pty
done FEATURE/pty generated
make ${PACKAGE_ast_INCLUDE}/ast_time.h implicit
done ${PACKAGE_ast_INCLUDE}/ast_time.h
@ -45,12 +41,11 @@ make install
prev ${PACKAGE_ast_INCLUDE}/error.h implicit
prev ${PACKAGE_ast_INCLUDE}/cmd.h implicit
done pty.c
meta pty.o %.c>%.o pty.c pty
prev pty.c
exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""builtin"\" -D_PACKAGE_ast -DCMD_STANDALONE=b_pty -c pty.c
exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""builtin"\" -D_PACKAGE_ast -DCMD_STANDALONE=b_pty -c pty.c
done pty.o generated
bind -lutil dontcare
exec - ${CC} ${CCLDFLAGS} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} ${LDFLAGS} ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -o pty pty.o ${mam_libutil} ${mam_libast} -lm ${mam_libcmd}
exec - ${CC} ${CCLDFLAGS} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -o pty pty.o ${mam_libutil} ${mam_libast} -lm ${mam_libcmd}
done pty generated
make ${INSTALLROOT}/bin
exec - if silent test ! -d ${INSTALLROOT}/bin

File diff suppressed because it is too large Load diff

View file

@ -8,11 +8,11 @@
SHOPT ACCT=0 # accounting
SHOPT ACCTFILE=0 # per-user accounting info
SHOPT AUDIT=1 # enable auditing per SHOPT_AUDITFILE
SHOPT AUDITFILE='\"/etc/ksh_audit\"' # auditing file
SHOPT AUDITFILE='"/etc/ksh_audit"' # auditing file
SHOPT BGX=1 # one SIGCHLD trap per completed job
SHOPT BRACEPAT=1 # C-shell {...,...} expansions (, required)
SHOPT CMDLIB_HDR= # '<cmdlist.h>' # custom -lcmd list for path-bound builtins
SHOPT CMDLIB_DIR= # '\"/opt/ast/bin\"' # virtual directory prefix for path-bound builtins
SHOPT CMDLIB_DIR= # '"/opt/ast/bin"' # virtual directory prefix for path-bound builtins
SHOPT CRNL= # accept MS Windows newlines (<cr><nl>) for <nl>
SHOPT DEVFD= # use /dev/fd instead of FIFOs for process substitutions
SHOPT DYNAMIC=1 # dynamic loading for builtins

View file

@ -36,6 +36,7 @@
* > it is blocked and it should return and then handle the trap.
*/
#include "shopt.h"
#include "defs.h"
#include <error.h>
#include <stak.h>

View file

@ -29,6 +29,7 @@
*
*/
#include "shopt.h"
#include "defs.h"
#include <stak.h>
#include <error.h>

View file

@ -30,6 +30,7 @@
*
*/
#include "shopt.h"
#include "defs.h"
#include <ast.h>
#include <error.h>

View file

@ -18,6 +18,7 @@
* David Korn <dgk@research.att.com> *
* *
***********************************************************************/
#include "shopt.h"
#include "defs.h"
#define ENUM_ID "enum (ksh 93u+m) 2022-03-05"

View file

@ -27,6 +27,7 @@
*
*/
#include "shopt.h"
#include "defs.h"
#include "variables.h"
#include <error.h>

View file

@ -18,6 +18,7 @@
* David Korn <dgk@research.att.com> *
* *
***********************************************************************/
#include "shopt.h"
#include "defs.h"
#include <stak.h>
#include <ls.h>

View file

@ -39,6 +39,7 @@
*
*/
#include "shopt.h"
#include "defs.h"
#include "variables.h"
#include "shnodes.h"

View file

@ -25,6 +25,7 @@
* AT&T Labs
*/
#include "shopt.h"
#if !SHOPT_MKSERVICE
void _STUB_b_mkservice(){}
#else

View file

@ -27,6 +27,7 @@
* AT&T Labs
*/
#include "shopt.h"
#include "defs.h"
#include <error.h>
#include <stak.h>

View file

@ -26,6 +26,7 @@
*
*/
#include "shopt.h"
#include <ast.h>
#include <error.h>
#include "defs.h"

View file

@ -29,6 +29,7 @@
* AT&T Research
*/
#include "shopt.h"
#include "defs.h"
#if SHOPT_REGRESS

View file

@ -26,6 +26,7 @@
*
*/
#include "shopt.h"
#include "defs.h"
#include <error.h>
#include <errno.h>

View file

@ -27,6 +27,7 @@
*
*/
#include "shopt.h"
#include "defs.h"
#include <error.h>
#include <ls.h>

View file

@ -31,6 +31,7 @@
*
*/
#include "shopt.h"
#include "defs.h"
#include "jobs.h"
#include "builtins.h"

View file

@ -40,6 +40,7 @@
*
*/
#include "shopt.h"
#include "defs.h"
#include <error.h>
#include "path.h"

View file

@ -26,6 +26,7 @@
*
*/
#include "shopt.h"
#include <ast.h>
#include <sfio.h>
#include <error.h>

View file

@ -2,7 +2,7 @@
* *
* This software is part of the ast package *
* Copyright (c) 1982-2012 AT&T Intellectual Property *
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
* Copyright (c) 2020-2022 Contributors to ksh 93u+m *
* and is licensed under the *
* Eclipse Public License, Version 1.0 *
* by AT&T Intellectual Property *
@ -27,6 +27,7 @@
*
*/
#include "shopt.h"
#include <ast.h>
#include <sfio.h>
#include <error.h>

View file

@ -28,6 +28,7 @@
*
*/
#include "shopt.h"
#include "defs.h"
#include <error.h>
#include "shtable.h"

View file

@ -2,7 +2,7 @@
* *
* This software is part of the ast package *
* Copyright (c) 1982-2012 AT&T Intellectual Property *
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
* Copyright (c) 2020-2022 Contributors to ksh 93u+m *
* and is licensed under the *
* Eclipse Public License, Version 1.0 *
* by AT&T Intellectual Property *
@ -18,6 +18,7 @@
* David Korn <dgk@research.att.com> *
* *
***********************************************************************/
#include "shopt.h"
#include "defs.h"
#include <signal.h>
#include "FEATURE/options"

View file

@ -20,6 +20,7 @@
***********************************************************************/
#include "shopt.h"
#include "defs.h"
#include "shtable.h"
#include <signal.h>

View file

@ -2,7 +2,7 @@
* *
* This software is part of the ast package *
* Copyright (c) 1982-2012 AT&T Intellectual Property *
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
* Copyright (c) 2020-2022 Contributors to ksh 93u+m *
* and is licensed under the *
* Eclipse Public License, Version 1.0 *
* by AT&T Intellectual Property *
@ -18,6 +18,7 @@
* David Korn <dgk@research.att.com> *
* *
***********************************************************************/
#include "shopt.h"
#include "shell.h"
#include "shlex.h"
#include "FEATURE/options"

View file

@ -19,8 +19,8 @@
* *
***********************************************************************/
#include "shopt.h"
#include <ast.h>
#include "FEATURE/options"
#include "lexstates.h"

View file

@ -2,7 +2,7 @@
* *
* This software is part of the ast package *
* Copyright (c) 1982-2012 AT&T Intellectual Property *
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
* Copyright (c) 2020-2022 Contributors to ksh 93u+m *
* and is licensed under the *
* Eclipse Public License, Version 1.0 *
* by AT&T Intellectual Property *
@ -19,6 +19,7 @@
* *
***********************************************************************/
#include "shopt.h"
#include <ast.h>
#include "ulimit.h"

View file

@ -27,6 +27,7 @@
*
*/
#include "shopt.h"
#include <ast.h>
#include <errno.h>
#include "defs.h"

View file

@ -19,6 +19,7 @@
* *
***********************************************************************/
#include "shopt.h"
#include "defs.h"
#include "name.h"
#include "shtable.h"

View file

@ -18,6 +18,7 @@
* David Korn <dgk@research.att.com> *
* *
***********************************************************************/
#include "shopt.h"
#include "defs.h"
#include "jobs.h"

View file

@ -2,7 +2,7 @@
* *
* This software is part of the ast package *
* Copyright (c) 1982-2011 AT&T Intellectual Property *
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
* Copyright (c) 2020-2022 Contributors to ksh 93u+m *
* and is licensed under the *
* Eclipse Public License, Version 1.0 *
* by AT&T Intellectual Property *
@ -22,6 +22,7 @@
* data for string evaluator library
*/
#include "shopt.h"
#include <ast_standards.h>
#include "FEATURE/options"
#include "streval.h"

View file

@ -23,8 +23,8 @@
* tables for the test builtin [[ ... ]] and [ ... ]
*/
#include "shopt.h"
#include <ast.h>
#include "defs.h"
#include "test.h"

View file

@ -19,6 +19,7 @@
* *
***********************************************************************/
#include "shopt.h"
#include <ast.h>
#include "FEATURE/options"
#include "FEATURE/dynamic"

View file

@ -23,6 +23,7 @@
*
*/
#include "shopt.h"
#include "defs.h"
#include <ast_wchar.h>
#include "lexstates.h"

View file

@ -27,6 +27,7 @@
* Coded April 1983.
*/
#include "shopt.h"
#include <ast.h>
#include <errno.h>
#include <ccode.h>

View file

@ -61,9 +61,12 @@ One line screen editor for any program
* but you can use them to separate features.
*/
#include "shopt.h"
#if SHOPT_ESH
#include <ast.h>
#include <releaseflags.h>
#include "FEATURE/cmds"
#include "defs.h"
#include "io.h"
@ -1313,7 +1316,7 @@ static void xcommands(register Emacs_t *ep,int count)
show_info(ep,hbuf);
return;
}
# if !_AST_ksh_release /* debugging, modify as required */
# if !_AST_release /* debugging, modify as required */
case cntl('D'): /* ^X^D show debugging info */
{
char debugbuf[MAXLINE];

View file

@ -32,6 +32,7 @@
*/
#include "shopt.h"
#include "defs.h"
#include "edit.h"

View file

@ -39,6 +39,8 @@
*/
#include "shopt.h"
#define HIST_MAX (sizeof(int)*HIST_BSIZE)
#define HIST_BIG (0100000-1024) /* 1K less than maximum short */
#define HIST_LINE 32 /* typical length for history line */

View file

@ -28,6 +28,8 @@
* cbosgd!pds
-*/
#include "shopt.h"
#if SHOPT_VSH
#include "defs.h"

View file

@ -48,6 +48,7 @@
#include <sfio.h>
#include <error.h>
#include "shopt.h"
#include "FEATURE/externs"
#include "FEATURE/options"
#include <cdt.h>

View file

@ -19,6 +19,8 @@
* *
***********************************************************************/
#include <releaseflags.h>
#define SH_RELEASE_FORK "93u+m" /* only change if you develop a new ksh93 fork */
#define SH_RELEASE_SVER "1.0.0-beta.2" /* semantic version number: https://semver.org */
#define SH_RELEASE_DATE "2022-06-09" /* must be in this format for $((.sh.version)) */
@ -26,7 +28,7 @@
/* Scripts sometimes field-split ${.sh.version}, so don't change amount of whitespace. */
/* Arithmetic $((.sh.version)) uses the last 10 chars, so the date must be at the end. */
#if _AST_ksh_release
#if _AST_release
# define SH_RELEASE SH_RELEASE_FORK "/" SH_RELEASE_SVER " " SH_RELEASE_DATE
#else
# ifdef _AST_git_commit

View file

@ -27,6 +27,7 @@
*
*/
#include "shopt.h"
#include "defs.h"
#include "path.h"
#include "jobs.h"

View file

@ -24,6 +24,7 @@
* AT&T Labs
*/
#include "shopt.h"
#include "defs.h"
#include "lexstates.h"
#include "name.h"

View file

@ -27,6 +27,7 @@
*
*/
#include "shopt.h"
#include "defs.h"
#include <stak.h>
#include "name.h"

View file

@ -2,7 +2,7 @@
* *
* This software is part of the ast package *
* Copyright (c) 1982-2011 AT&T Intellectual Property *
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
* Copyright (c) 2020-2022 Contributors to ksh 93u+m *
* and is licensed under the *
* Eclipse Public License, Version 1.0 *
* by AT&T Intellectual Property *
@ -24,6 +24,7 @@
* This file defines all the read/write shell global variables
*/
#include "shopt.h"
#include "defs.h"
#include "jobs.h"
#include "shlex.h"

603
src/cmd/ksh93/sh/deparse.c Normal file
View file

@ -0,0 +1,603 @@
/***********************************************************************
* *
* This software is part of the ast package *
* Copyright (c) 1982-2011 AT&T Intellectual Property *
* Copyright (c) 2020-2022 Contributors to ksh 93u+m *
* and is licensed under the *
* Eclipse Public License, Version 1.0 *
* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.eclipse.org/org/documents/epl-v10.html *
* (with md5 checksum b35adb5213ca9657e911e9befb180842) *
* *
* Information and Software Systems Research *
* AT&T Research *
* Florham Park NJ *
* *
* David Korn <dgk@research.att.com> *
* *
***********************************************************************/
/*
* David Korn
* AT&T Labs
*
* shell deparser
*
*/
#include "shopt.h"
#include "defs.h"
#include "shnodes.h"
#include "test.h"
#define HUGE_INT (((unsigned)-1)>>1)
#define BEGIN 0
#define MIDDLE 1
#define END 2
#define PRE 1
#define POST 2
/* flags that can be specified with p_tree() */
#define NO_NEWLINE (1 << 0)
#define NEED_BRACE (1 << 1)
#define NO_BRACKET (1 << 2)
#define PROCSUBST (1 << 3)
static void p_comlist(const struct dolnod*,int);
static void p_arg(const struct argnod*, int endchar, int opts);
static void p_comarg(const struct comnod*);
static void p_keyword(const char*,int);
static void p_redirect(const struct ionod*);
static void p_switch(const struct regnod*);
static void here_body(const struct ionod*);
static void p_tree(const Shnode_t*,int);
static int level;
static int begin_line;
static int end_line;
static char io_op[7];
static char un_op[3] = "-?";
static const struct ionod *here_doc;
static Sfio_t *outfile;
static const char *forinit = "";
void sh_deparse(Sfio_t *out, const Shnode_t *t,int tflags)
{
outfile = out;
p_tree(t,tflags);
}
/*
* print script corresponding to shell tree <t>
*/
static void p_tree(register const Shnode_t *t,register int tflags)
{
register char *cp=0;
int save = end_line;
int needbrace = (tflags&NEED_BRACE);
int procsub = (tflags&PROCSUBST);
tflags &= ~NEED_BRACE;
if(tflags&NO_NEWLINE)
end_line = ' ';
else if(procsub)
end_line = ')';
else
end_line = '\n';
switch(t->tre.tretyp&COMMSK)
{
case TTIME:
if(t->tre.tretyp&COMSCAN)
p_keyword("!",BEGIN);
else
p_keyword("time",BEGIN);
if(t->par.partre)
p_tree(t->par.partre,tflags);
level--;
break;
case TCOM:
if(begin_line && level>0)
sfnputc(outfile,'\t',level);
begin_line = 0;
p_comarg((struct comnod*)t);
break;
case TSETIO:
if(t->tre.tretyp&FPCL)
tflags |= NEED_BRACE;
else
tflags = NO_NEWLINE|NEED_BRACE;
p_tree(t->fork.forktre,tflags);
p_redirect(t->fork.forkio);
break;
case TFORK:
if(needbrace)
tflags |= NEED_BRACE;
if((t->tre.tretyp&(FAMP|FCOOP)) && (t->tre.tretyp&(FAMP|FINT))!=FAMP)
{
tflags = NEED_BRACE|NO_NEWLINE;
end_line = ' ';
}
else if(t->fork.forkio)
tflags = NO_NEWLINE;
p_tree(t->fork.forktre,tflags);
if(t->fork.forkio)
p_redirect(t->fork.forkio);
if(t->tre.tretyp&FCOOP)
{
sfputr(outfile,"|&",procsub?')':'\n');
begin_line = 1;
}
else if((t->tre.tretyp&(FAMP|FINT))==(FAMP|FINT))
{
sfputr(outfile,"&",procsub?')':'\n');
begin_line = 1;
}
break;
case TIF:
p_keyword("if",BEGIN);
p_tree(t->if_.iftre,0);
p_keyword("then",MIDDLE);
p_tree(t->if_.thtre,0);
if(t->if_.eltre)
{
p_keyword("else",MIDDLE);
p_tree(t->if_.eltre,0);
}
p_keyword("fi",END);
break;
case TWH:
if(t->wh.whinc)
cp = "for";
else if(t->tre.tretyp&COMSCAN)
cp = "until";
else
cp = "while";
p_keyword(cp,BEGIN);
if(t->wh.whinc)
{
struct argnod *arg = (t->wh.whtre)->ar.arexpr;
sfprintf(outfile,"(( %s; ",forinit);
forinit = "";
sfputr(outfile,arg->argval,';');
arg = (t->wh.whinc)->arexpr;
sfprintf(outfile," %s))\n",arg->argval);
}
else
p_tree(t->wh.whtre,0);
t = t->wh.dotre;
goto dolist;
case TLST:
{
Shnode_t *tr = t->lst.lstrit;
if(tr->tre.tretyp==TWH && tr->wh.whinc && t->lst.lstlef->tre.tretyp==TARITH)
{
/* arithmetic for statement */
struct argnod *init = (t->lst.lstlef)->ar.arexpr;
forinit= init->argval;
p_tree(t->lst.lstrit,tflags);
break;
}
if(needbrace)
p_keyword("{",BEGIN);
p_tree(t->lst.lstlef,0);
if(needbrace)
tflags = 0;
p_tree(t->lst.lstrit,tflags);
if(needbrace)
p_keyword("}",END);
break;
}
case TAND:
cp = "&&";
goto andor;
case TORF:
cp = "||";
goto andor;
case TFIL:
cp = "|";
andor:
{
int bracket = 0;
if(t->tre.tretyp&TTEST)
{
tflags |= NO_NEWLINE;
if(!(tflags&NO_BRACKET))
{
p_keyword("[[",BEGIN);
tflags |= NO_BRACKET;
bracket=1;
}
}
p_tree(t->lst.lstlef,NEED_BRACE|NO_NEWLINE|(tflags&NO_BRACKET));
if(tflags&FALTPIPE)
{
Shnode_t *tt = t->lst.lstrit;
if(tt->tre.tretyp!=TFIL || !(tt->lst.lstlef->tre.tretyp&FALTPIPE))
{
sfputc(outfile,'\n');
return;
}
}
sfputr(outfile,cp,here_doc?'\n':' ');
if(here_doc)
{
here_body(here_doc);
here_doc = 0;
}
level++;
p_tree(t->lst.lstrit,tflags|NEED_BRACE);
if(bracket)
p_keyword("]]",END);
level--;
break;
}
case TPAR:
p_keyword("(",BEGIN);
p_tree(t->par.partre,0);
p_keyword(")",END);
break;
case TARITH:
{
register struct argnod *ap = t->ar.arexpr;
if(begin_line && level)
sfnputc(outfile,'\t',level);
sfprintf(outfile,"(( %s ))%c",ap->argval,end_line);
if(!(tflags&NO_NEWLINE))
begin_line=1;
break;
}
case TFOR:
cp = ((t->tre.tretyp&COMSCAN)?"select":"for");
p_keyword(cp,BEGIN);
sfputr(outfile,t->for_.fornam,' ');
if(t->for_.forlst)
{
sfputr(outfile,"in",' ');
tflags = end_line;
end_line = '\n';
p_comarg(t->for_.forlst);
end_line = tflags;
}
else
sfputc(outfile,'\n');
begin_line = 1;
t = t->for_.fortre;
dolist:
p_keyword("do",MIDDLE);
p_tree(t,0);
p_keyword("done",END);
break;
case TSW:
p_keyword("case",BEGIN);
p_arg(t->sw.swarg,' ',0);
if(t->sw.swlst)
{
begin_line = 1;
sfputr(outfile,"in",'\n');
tflags = end_line;
end_line = '\n';
p_switch(t->sw.swlst);
end_line = tflags;
}
p_keyword("esac",END);
break;
case TFUN:
if(t->tre.tretyp&FPOSIX)
{
sfprintf(outfile,"%s",t->funct.functnam);
p_keyword("()\n",BEGIN);
}
else
{
p_keyword("function",BEGIN);
tflags = (t->funct.functargs?' ':'\n');
sfputr(outfile,t->funct.functnam,tflags);
if(t->funct.functargs)
{
tflags = end_line;
end_line = '\n';
p_comarg(t->funct.functargs);
end_line = tflags;
}
}
begin_line = 1;
p_keyword("{\n",MIDDLE);
begin_line = 1;
p_tree(t->funct.functtre,0);
p_keyword("}",END);
break;
/* new test compound command */
case TTST:
if(!(tflags&NO_BRACKET))
p_keyword("[[",BEGIN);
if((t->tre.tretyp&TPAREN)==TPAREN)
{
p_keyword("(",BEGIN);
p_tree(t->lst.lstlef,NO_BRACKET|NO_NEWLINE);
p_keyword(")",END);
}
else
{
int flags = (t->tre.tretyp)>>TSHIFT;
if(t->tre.tretyp&TNEGATE)
sfputr(outfile,"!",' ');
if(t->tre.tretyp&TUNARY)
{
un_op[1] = flags;
sfputr(outfile,un_op,' ');
}
else
cp = ((char*)(shtab_testops+(flags&037)-1)->sh_name);
p_arg(&(t->lst.lstlef->arg),' ',0);
if(t->tre.tretyp&TBINARY)
{
sfputr(outfile,cp,' ');
p_arg(&(t->lst.lstrit->arg),' ',0);
}
}
if(!(tflags&NO_BRACKET))
p_keyword("]]",END);
}
while(begin_line && here_doc)
{
here_body(here_doc);
here_doc = 0;
}
end_line = save;
return;
}
/*
* print a keyword
* increment indent level for flag==BEGIN
* decrement indent level for flag==END
*/
static void p_keyword(const char *word,int flag)
{
register int sep;
if(flag==END)
sep = end_line;
else if(*word=='[' || *word=='(')
sep = ' ';
else
sep = '\t';
if(flag!=BEGIN)
level--;
if(begin_line && level)
sfnputc(outfile,'\t',level);
sfputr(outfile,word,sep);
if(sep=='\n')
begin_line=1;
else
begin_line=0;
if(flag!=END)
level++;
}
static void p_arg(register const struct argnod *arg,register int endchar,int opts)
{
register const char *cp;
register int flag=0;
do
{
if(!arg->argnxt.ap)
flag = endchar;
else if(opts&PRE)
{
/* case alternation lists in reverse order */
p_arg(arg->argnxt.ap,'|',opts);
flag = endchar;
}
else if(opts)
flag = ' ';
cp = arg->argval;
if(*cp==0 && (arg->argflag&ARG_EXP) && arg->argchn.ap)
{
/* process substitution */
int c = (arg->argflag&ARG_RAW)?'>':'<';
sfputc(outfile,c);
sfputc(outfile,'(');
p_tree((Shnode_t*)arg->argchn.ap,PROCSUBST);
}
else if(*cp==0 && opts==POST && arg->argchn.ap)
{
/* compound assignment */
struct fornod *fp=(struct fornod*)arg->argchn.ap;
sfprintf(outfile,"%s=(\n",fp->fornam);
sfnputc(outfile,'\t',++level);
p_tree(fp->fortre,0);
if(--level)
sfnputc(outfile,'\t',level);
sfputc(outfile,')');
}
else if((arg->argflag&ARG_RAW) && (cp[1] || (*cp!='[' && *cp!=']')))
cp = sh_fmtq(cp);
sfputr(outfile,cp,flag);
if(flag=='\n')
begin_line = 1;
arg = arg->argnxt.ap;
}
while((opts&POST) && arg);
return;
}
static void p_redirect(register const struct ionod *iop)
{
register char *cp;
register int iof,iof2;
for(;iop;iop=iop->ionxt)
{
iof=iop->iofile;
cp = io_op;
if(iop->iovname)
{
sfwrite(outfile,"(;",2);
sfputr(outfile,iop->iovname,')');
cp++;
}
else
*cp = '0'+(iof&IOUFD);
if(iof&IOPUT)
{
if(*cp == '1' && !iop->iovname)
cp++;
io_op[1] = '>';
}
else
{
if(*cp == '0' && !iop->iovname)
cp++;
io_op[1] = '<';
}
io_op[2] = 0;
io_op[3] = 0;
if(iof&IOLSEEK)
{
io_op[1] = '#';
if(iof&IOARITH)
strcpy(&io_op[3]," ((");
}
else if(iof&IOMOV)
io_op[2] = '&';
else if(iof&(IORDW|IOAPP))
io_op[2] = '>';
else if(iof&IOCLOB)
io_op[2] = '|';
if(iop->iodelim)
{
/* here document */
here_doc = iop;
io_op[2] = '<';
}
sfputr(outfile,cp,' ');
if(iop->ionxt)
iof = ' ';
else
{
if((iof=end_line)=='\n')
begin_line = 1;
}
if((iof&IOLSEEK) && (iof&IOARITH))
iof2 = iof, iof = ' ';
if((iop->iofile & IOPROCSUB) && !(iop->iofile & IOLSEEK))
{
/* process substitution as argument to redirection */
if(iop->iofile & IOPUT)
sfwrite(outfile,">(",2);
else
sfwrite(outfile,"<(",2);
p_tree((Shnode_t*)iop->ioname,PROCSUBST);
sfputc(outfile,iof);
}
else if(iop->iodelim)
{
if(!(iop->iofile&IODOC))
sfwrite(outfile,"''",2);
sfputr(outfile,sh_fmtq(iop->iodelim),iof);
}
else if(iop->iofile&IORAW)
sfputr(outfile,sh_fmtq(iop->ioname),iof);
else
sfputr(outfile,iop->ioname,iof);
if((iof&IOLSEEK) && (iof&IOARITH))
sfputr(outfile, "))", iof2);
}
return;
}
static void p_comarg(register const struct comnod *com)
{
register int flag = end_line;
if(com->comtyp&FAMP)
sfwrite(outfile,"& ",2);
if(com->comarg || com->comio)
flag = ' ';
if(com->comset)
p_arg(com->comset,flag,POST);
if(com->comarg)
{
if(!com->comio)
flag = end_line;
if(com->comtyp&COMSCAN)
p_arg(com->comarg,flag,POST);
else
p_comlist((struct dolnod*)com->comarg,flag);
}
if(com->comio)
p_redirect(com->comio);
return;
}
static void p_comlist(const struct dolnod *dol,int endchar)
{
register char *cp, *const*argv;
register int flag = ' ', special;
argv = dol->dolval+ARG_SPARE;
cp = *argv;
special = (*cp=='[' && cp[1]==0);
do
{
if(cp)
argv++;
else
cp = "";
if(*argv==0)
{
if((flag=endchar)=='\n')
begin_line = 1;
special = (*cp==']' && cp[1]==0);
}
sfputr(outfile,special?cp:sh_fmtq(cp),flag);
special = 0;
}
while(cp = *argv);
return;
}
static void p_switch(register const struct regnod *reg)
{
if(level>1)
sfnputc(outfile,'\t',level-1);
p_arg(reg->regptr,')',PRE);
begin_line = 0;
sfputc(outfile,'\t');
if(reg->regcom)
p_tree(reg->regcom,0);
level++;
if(reg->regflag)
p_keyword(";&",END);
else
p_keyword(";;",END);
if(reg->regnxt)
p_switch(reg->regnxt);
return;
}
/*
* output here documents
*/
static void here_body(register const struct ionod *iop)
{
Sfio_t *infile;
if(iop->iofile&IOSTRG)
infile = sfnew((Sfio_t*)0,iop->ioname,iop->iosize,-1,SF_STRING|SF_READ);
else
sfseek(infile=sh.heredocs,iop->iooffset,SEEK_SET);
sfmove(infile,outfile,iop->iosize,-1);
if(iop->iofile&IOSTRG)
sfclose(infile);
sfputr(outfile,iop->iodelim,'\n');
}

View file

@ -26,6 +26,7 @@
*
*/
#include "shopt.h"
#include "defs.h"
#include "variables.h"
#include "test.h"

View file

@ -26,6 +26,7 @@
*
*/
#include "shopt.h"
#include "defs.h"
#include <fcin.h>
#include "io.h"

View file

@ -2,7 +2,7 @@
* *
* This software is part of the ast package *
* Copyright (c) 1982-2011 AT&T Intellectual Property *
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
* Copyright (c) 2020-2022 Contributors to ksh 93u+m *
* and is licensed under the *
* Eclipse Public License, Version 1.0 *
* by AT&T Intellectual Property *
@ -26,6 +26,7 @@
*
*/
#include "shopt.h"
#include <ast.h>
#include <sfio.h>
#include <error.h>

View file

@ -27,6 +27,7 @@
*
*/
#include "shopt.h"
#include "defs.h"
#include <stak.h>
#include <ccode.h>

View file

@ -27,6 +27,7 @@
*
*/
#include "shopt.h"
#include "defs.h"
#include <fcin.h>
#include <ls.h>

View file

@ -50,6 +50,7 @@
* may be temporarily turned off without turning off the option.
*/
#include "shopt.h"
#include "defs.h"
#include <wait.h>
#include "io.h"

View file

@ -26,7 +26,9 @@
*
*/
#include "shopt.h"
#include <ast.h>
#include <releaseflags.h>
#include <stak.h>
#include <fcin.h>
#include <nval.h>
@ -1410,7 +1412,7 @@ breakloop:
alt = ">="; /* '-ge' --> '>=' */
break;
default:
#if _AST_ksh_release
#if _AST_release
alt = NIL(char*); /* output '(null)' (should never happen) */
#else
abort();

View file

@ -31,6 +31,7 @@
*
*/
#include "shopt.h"
#include "defs.h"
#include <fcin.h>
#include <pwd.h>

View file

@ -27,6 +27,7 @@
*
*/
#include "shopt.h"
#include <ast.h>
#include <sfio.h>
#include <stak.h>

View file

@ -25,6 +25,7 @@
#define putenv ___putenv
#include "shopt.h"
#include "defs.h"
#include "variables.h"
#include "path.h"

View file

@ -23,6 +23,7 @@
*
*/
#include "shopt.h"
#include "defs.h"
#include "variables.h"
#include "builtins.h"

View file

@ -27,6 +27,7 @@
*
*/
#include "shopt.h"
#include "defs.h"
#include "name.h"
#include "argnod.h"

View file

@ -23,6 +23,7 @@
* AT&T Labs
*
*/
#include "shopt.h"
#include "defs.h"
#include "io.h"
#include "variables.h"

View file

@ -28,6 +28,7 @@
* This is the parser for a shell language
*/
#include "shopt.h"
#include "defs.h"
#include <fcin.h>
#include <error.h>

View file

@ -24,6 +24,7 @@
*
*/
#include "shopt.h"
#include "defs.h"
#include <fcin.h>
#include <ls.h>

View file

@ -2,7 +2,7 @@
* *
* This software is part of the ast package *
* Copyright (c) 1982-2011 AT&T Intellectual Property *
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
* Copyright (c) 2020-2022 Contributors to ksh 93u+m *
* and is licensed under the *
* Eclipse Public License, Version 1.0 *
* by AT&T Intellectual Property *
@ -19,8 +19,8 @@
* *
***********************************************************************/
#include "shopt.h"
#include <shell.h>
#include "FEATURE/externs"
#if defined(__sun) && _sys_mman && _lib_memcntl && defined(MHA_MAPSIZE_STACK) && defined(MC_HAT_ADVISE)

View file

@ -26,6 +26,7 @@
*
*/
#include "shopt.h"
#include "version.h"
static const char usage[] =

View file

@ -29,6 +29,7 @@
* and has a separate executor
*/
#include "shopt.h"
#include "streval.h"
#include <ctype.h>
#include <error.h>

View file

@ -23,6 +23,7 @@
*
*/
#include "shopt.h"
#include <ast.h>
#include <ast_wchar.h>
#include "defs.h"

View file

@ -26,6 +26,7 @@
*
*/
#include "shopt.h"
#include "defs.h"
#include <ls.h>
#include "io.h"

View file

@ -26,6 +26,7 @@
*
*/
#include "shopt.h"
#include "defs.h"
#include "shnodes.h"
#include "path.h"

View file

@ -19,6 +19,7 @@
* *
***********************************************************************/
#include "shopt.h"
#include <ast.h>
#include <sig.h>
#include <error.h>

View file

@ -26,6 +26,7 @@
*
*/
#include "shopt.h"
#include "defs.h"
#include "shnodes.h"
#include "path.h"

View file

@ -19,6 +19,7 @@
* *
***********************************************************************/
#include "shopt.h"
#include "defs.h"
/*
* This installs a hook to allow the processing of events when

View file

@ -26,6 +26,7 @@
*
*/
#include "shopt.h"
#include "defs.h"
#include <fcin.h>
#include "variables.h"

View file

@ -2,7 +2,7 @@
# #
# This software is part of the ast package #
# Copyright (c) 1982-2011 AT&T Intellectual Property #
# Copyright (c) 2020-2021 Contributors to ksh 93u+m #
# Copyright (c) 2020-2022 Contributors to ksh 93u+m #
# and is licensed under the #
# Eclipse Public License, Version 1.0 #
# by AT&T Intellectual Property #

View file

@ -1,12 +1,10 @@
info mam static
note *
note * This build file is in the Make Abstract Machine (MAM) language. It was
note * first generated by nmake, but in the ksh 93u+m distribution we maintain
note * it manually because nmake had too many problems to keep using. The
note * Mamfiles are processed by mamake (src/cmd/INIT/mamake.c); we added
note * support for indentation to improve readability. The language is
note * documented in Glenn Fowler's paper "A Make Abstract Machine":
note * http://web.archive.org/web/20041227143022/http://www2.research.att.com/~gsf/mam/mam.html
note * indentation to improve readability. The language is documented in
note * src/cmd/INIT/README-mamake.md.
note *
note component level :MAKE: equivalent
make test

File diff suppressed because it is too large Load diff

View file

@ -605,6 +605,7 @@ tst - note{ does this compiler have __builtin_unreachable() }end output{
* argc should never be zero on init, but hopefully optimizers aren't that smart.
*/
#include <stdio.h>
#include "releaseflags.h"
void testfn(int a)
{
switch(a)
@ -612,11 +613,11 @@ tst - note{ does this compiler have __builtin_unreachable() }end output{
case 0:
__builtin_unreachable();
default:
printf("#if _AST_ksh_release\n");
#if _AST_release
printf("# define UNREACHABLE()\t__builtin_unreachable()\n");
printf("#else\n");
#else
printf("# define UNREACHABLE()\tabort()\n");
printf("#endif\n");
#endif
}
}
int main(int argc, char *argv[])
@ -625,9 +626,5 @@ tst - note{ does this compiler have __builtin_unreachable() }end output{
return 0;
}
}end fail{
echo '#if _AST_ksh_release'
echo '# define UNREACHABLE() 0'
echo '#else'
echo '# define UNREACHABLE() abort()'
echo '#endif'
echo '#define UNREACHABLE() abort()'
}end

View file

@ -1,12 +1,10 @@
info mam static 00000 1994-07-17 make (AT&T Research) 5.7 2012-06-20
note *
note * This build file is in the Make Abstract Machine (MAM) language. It was
note * first generated by nmake, but in the ksh 93u+m distribution we maintain
note * it manually because nmake had too many problems to keep using. The
note * Mamfiles are processed by mamake (src/cmd/INIT/mamake.c); we added
note * support for indentation to improve readability. The language is
note * documented in Glenn Fowler's paper "A Make Abstract Machine":
note * http://web.archive.org/web/20041227143022/http://www2.research.att.com/~gsf/mam/mam.html
note * indentation to improve readability. The language is documented in
note * src/cmd/INIT/README-mamake.md.
note *
setv INSTALLROOT ../../..
setv PACKAGE_ast_INCLUDE ${INSTALLROOT}/include/ast
@ -14,7 +12,6 @@ setv PACKAGEROOT ../../../../..
setv AR ${mam_cc_AR} ${mam_cc_AR_ARFLAGS}
setv CC cc
setv mam_cc_FLAGS ${mam_cc_DLL}
setv KSH_RELFLAGS
setv CCFLAGS ${-debug-symbols?1?${mam_cc_DEBUG} -D_BLD_DEBUG?${mam_cc_OPTIMIZE}?}
setv COTEMP $$
setv IFFEFLAGS
@ -25,8 +22,8 @@ make install
make cmd.req
exec - set -
exec - echo 'int main(){return 0;}' > 1.${COTEMP}.c
exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} -c 1.${COTEMP}.c &&
exec - x=`${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} ${LDFLAGS} -o 1.${COTEMP}.x 1.${COTEMP}.o -l'*' 2>&1 | sed -e 's/[][()+@?]/#/g' || :` &&
exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -c 1.${COTEMP}.c &&
exec - x=`${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} -o 1.${COTEMP}.x 1.${COTEMP}.o -l'*' 2>&1 | sed -e 's/[][()+@?]/#/g' || :` &&
exec - {
exec - case "" in
exec - *?) echo " " ;;
@ -42,8 +39,8 @@ make install
exec - esac
exec - continue
exec - elif test ! -f ${INSTALLROOT}/lib/lib$i.a
exec - then case `{ ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} -L${INSTALLROOT}/lib ${LDFLAGS} -o 1.${COTEMP}.x 1.${COTEMP}.o -l$i 2>&1 || echo '' "$x" ;} | sed -e 's/[][()+@?]/#/g' || :` in
exec - *$x*) case `{ ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} ${LDFLAGS} -o 1.${COTEMP}.x 1.${COTEMP}.o -l$i 2>&1 || echo '' "$x" ;} | sed -e 's/[][()+@?]/#/g' || :` in
exec - then case `{ ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -L${INSTALLROOT}/lib ${LDFLAGS} -o 1.${COTEMP}.x 1.${COTEMP}.o -l$i 2>&1 || echo '' "$x" ;} | sed -e 's/[][()+@?]/#/g' || :` in
exec - *$x*) case `{ ${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} -o 1.${COTEMP}.x 1.${COTEMP}.o -l$i 2>&1 || echo '' "$x" ;} | sed -e 's/[][()+@?]/#/g' || :` in
exec - *$x*) continue ;;
exec - esac
exec - ;;
@ -81,12 +78,11 @@ make install
done cat.c
make chgrp.c
make FEATURE/symlink implicit
meta FEATURE/symlink features/%>FEATURE/% features/symlink symlink
make features/symlink
done features/symlink
bind -lutil
bind -last
exec - iffe ${IFFEFLAGS} -v -c "${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} ${LDFLAGS}" ref ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libutil} ${mam_libast} : run features/symlink
exec - iffe ${IFFEFLAGS} -v -c "${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS}" ref ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libutil} ${mam_libast} : run features/symlink
done FEATURE/symlink generated
make ${PACKAGE_ast_INCLUDE}/fts.h implicit
make ${PACKAGE_ast_INCLUDE}/ast_mode.h implicit
@ -251,10 +247,9 @@ make install
make fds.c
prev ${PACKAGE_ast_INCLUDE}/endian.h implicit
make FEATURE/sockets implicit
meta FEATURE/sockets features/%>FEATURE/% features/sockets sockets
make features/sockets
done features/sockets
exec - iffe ${IFFEFLAGS} -v -c "${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} ${LDFLAGS}" ref ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libutil} ${mam_libast} : run features/sockets
exec - iffe ${IFFEFLAGS} -v -c "${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS}" ref ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libutil} ${mam_libast} : run features/sockets
done FEATURE/sockets generated
prev ${PACKAGE_ast_INCLUDE}/ls.h implicit
prev cmd.h implicit
@ -279,10 +274,9 @@ make install
prev ${PACKAGE_ast_INCLUDE}/stdio.h implicit
prev ${PACKAGE_ast_INCLUDE}/stdio.h implicit
make FEATURE/ids implicit
meta FEATURE/ids features/%>FEATURE/% features/ids ids
make features/ids
done features/ids
exec - iffe ${IFFEFLAGS} -v -c "${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} ${LDFLAGS}" ref ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libutil} ${mam_libast} : run features/ids
exec - iffe ${IFFEFLAGS} -v -c "${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS}" ref ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libutil} ${mam_libast} : run features/ids
done FEATURE/ids generated
prev cmd.h implicit
done id.c
@ -373,10 +367,9 @@ make install
done tty.c
make uname.c
make FEATURE/utsname implicit
meta FEATURE/utsname features/%>FEATURE/% features/utsname utsname
make features/utsname
done features/utsname
exec - iffe ${IFFEFLAGS} -v -c "${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} ${LDFLAGS}" ref ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libutil} ${mam_libast} : run features/utsname
exec - iffe ${IFFEFLAGS} -v -c "${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS}" ref ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libutil} ${mam_libast} : run features/utsname
done FEATURE/utsname generated
prev ${PACKAGE_ast_INCLUDE}/proc.h implicit
prev cmd.h implicit
@ -443,279 +436,233 @@ make install
prev ${PACKAGE_ast_INCLUDE}/ast.h implicit
done cmd.h
done cmdinit.c
meta cmdinit.o %.c>%.o cmdinit.c cmdinit
prev cmdinit.c
exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -D_BLD_cmd -D_PACKAGE_ast -c cmdinit.c
exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -D_BLD_cmd -D_PACKAGE_ast -c cmdinit.c
done cmdinit.o generated
make basename.o
prev basename.c
meta basename.o %.c>%.o basename.c basename
prev basename.c
exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_BLD_cmd -D_PACKAGE_ast -c basename.c
exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_BLD_cmd -D_PACKAGE_ast -c basename.c
done basename.o generated
make cat.o
prev cat.c
meta cat.o %.c>%.o cat.c cat
prev cat.c
exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_BLD_cmd -D_PACKAGE_ast -c cat.c
exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_BLD_cmd -D_PACKAGE_ast -c cat.c
done cat.o generated
make chgrp.o
prev chgrp.c
meta chgrp.o %.c>%.o chgrp.c chgrp
prev chgrp.c
exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_PACKAGE_ast -D_BLD_cmd -c chgrp.c
exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_PACKAGE_ast -D_BLD_cmd -c chgrp.c
done chgrp.o generated
make chmod.o
prev chmod.c
meta chmod.o %.c>%.o chmod.c chmod
prev chmod.c
exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_BLD_cmd -D_PACKAGE_ast -c chmod.c
exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_BLD_cmd -D_PACKAGE_ast -c chmod.c
done chmod.o generated
make chown.o
prev chown.c
meta chown.o %.c>%.o chown.c chown
prev chown.c
exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -D_BLD_cmd -D_PACKAGE_ast -c chown.c
exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -D_BLD_cmd -D_PACKAGE_ast -c chown.c
done chown.o generated
make cksum.o
prev cksum.c
meta cksum.o %.c>%.o cksum.c cksum
prev cksum.c
exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_PACKAGE_ast -D_BLD_cmd -c cksum.c
exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_PACKAGE_ast -D_BLD_cmd -c cksum.c
done cksum.o generated
make cmp.o
prev cmp.c
meta cmp.o %.c>%.o cmp.c cmp
prev cmp.c
exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_BLD_cmd -D_PACKAGE_ast -c cmp.c
exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_BLD_cmd -D_PACKAGE_ast -c cmp.c
done cmp.o generated
make comm.o
prev comm.c
meta comm.o %.c>%.o comm.c comm
prev comm.c
exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_BLD_cmd -D_PACKAGE_ast -c comm.c
exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_BLD_cmd -D_PACKAGE_ast -c comm.c
done comm.o generated
make cp.o
prev cp.c
meta cp.o %.c>%.o cp.c cp
prev cp.c
exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_PACKAGE_ast -D_BLD_cmd -c cp.c
exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_PACKAGE_ast -D_BLD_cmd -c cp.c
done cp.o generated
make cut.o
prev cut.c
meta cut.o %.c>%.o cut.c cut
prev cut.c
exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_BLD_cmd -D_PACKAGE_ast -c cut.c
exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_BLD_cmd -D_PACKAGE_ast -c cut.c
done cut.o generated
make dirname.o
prev dirname.c
meta dirname.o %.c>%.o dirname.c dirname
prev dirname.c
exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_BLD_cmd -D_PACKAGE_ast -c dirname.c
exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_BLD_cmd -D_PACKAGE_ast -c dirname.c
done dirname.o generated
make date.o
prev date.c
meta date.o %.c>%.o date.c date
prev date.c
exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_PACKAGE_ast -D_BLD_cmd -c date.c
exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_PACKAGE_ast -D_BLD_cmd -c date.c
done date.o generated
make expr.o
prev expr.c
meta expr.o %.c>%.o expr.c expr
prev expr.c
exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_BLD_cmd -D_PACKAGE_ast -c expr.c
exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_BLD_cmd -D_PACKAGE_ast -c expr.c
done expr.o generated
make fds.o
prev fds.c
meta fds.o %.c>%.o fds.c fds
prev fds.c
exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_BLD_cmd -D_PACKAGE_ast -c fds.c
exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_BLD_cmd -D_PACKAGE_ast -c fds.c
done fds.o generated
make fmt.o
prev fmt.c
meta fmt.o %.c>%.o fmt.c fmt
prev fmt.c
exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_BLD_cmd -D_PACKAGE_ast -c fmt.c
exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_BLD_cmd -D_PACKAGE_ast -c fmt.c
done fmt.o generated
make fold.o
prev fold.c
meta fold.o %.c>%.o fold.c fold
prev fold.c
exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_BLD_cmd -D_PACKAGE_ast -c fold.c
exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_BLD_cmd -D_PACKAGE_ast -c fold.c
done fold.o generated
make getconf.o
prev getconf.c
meta getconf.o %.c>%.o getconf.c getconf
prev getconf.c
exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_PACKAGE_ast -D_BLD_cmd -c getconf.c
exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_PACKAGE_ast -D_BLD_cmd -c getconf.c
done getconf.o generated
make head.o
prev head.c
meta head.o %.c>%.o head.c head
prev head.c
exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_BLD_cmd -D_PACKAGE_ast -c head.c
exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_BLD_cmd -D_PACKAGE_ast -c head.c
done head.o generated
make id.o
prev id.c
meta id.o %.c>%.o id.c id
prev id.c
exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} ${-debug-symbols?1?${mam_cc_DEBUG} -D_BLD_DEBUG?${CCFLAGS.FORCE}?} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_BLD_cmd -D_PACKAGE_ast -c id.c
exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${-debug-symbols?1?${mam_cc_DEBUG} -D_BLD_DEBUG?${CCFLAGS.FORCE}?} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_BLD_cmd -D_PACKAGE_ast -c id.c
done id.o generated
make join.o
prev join.c
meta join.o %.c>%.o join.c join
prev join.c
exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_PACKAGE_ast -D_BLD_cmd -c join.c
exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_PACKAGE_ast -D_BLD_cmd -c join.c
done join.o generated
make ln.o
prev ln.c
meta ln.o %.c>%.o ln.c ln
prev ln.c
exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -D_BLD_cmd -D_PACKAGE_ast -c ln.c
exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -D_BLD_cmd -D_PACKAGE_ast -c ln.c
done ln.o generated
make logname.o
prev logname.c
meta logname.o %.c>%.o logname.c logname
prev logname.c
exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_BLD_cmd -D_PACKAGE_ast -c logname.c
exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_BLD_cmd -D_PACKAGE_ast -c logname.c
done logname.o generated
make md5sum.o
prev md5sum.c
meta md5sum.o %.c>%.o md5sum.c md5sum
prev md5sum.c
exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -D_BLD_cmd -D_PACKAGE_ast -c md5sum.c
exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -D_BLD_cmd -D_PACKAGE_ast -c md5sum.c
done md5sum.o generated
make mkdir.o
prev mkdir.c
meta mkdir.o %.c>%.o mkdir.c mkdir
prev mkdir.c
exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_BLD_cmd -D_PACKAGE_ast -c mkdir.c
exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_BLD_cmd -D_PACKAGE_ast -c mkdir.c
done mkdir.o generated
make mkfifo.o
prev mkfifo.c
meta mkfifo.o %.c>%.o mkfifo.c mkfifo
prev mkfifo.c
exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_BLD_cmd -D_PACKAGE_ast -c mkfifo.c
exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_BLD_cmd -D_PACKAGE_ast -c mkfifo.c
done mkfifo.o generated
make mktemp.o
prev mktemp.c
meta mktemp.o %.c>%.o mktemp.c mktemp
prev mktemp.c
exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_BLD_cmd -D_PACKAGE_ast -c mktemp.c
exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_BLD_cmd -D_PACKAGE_ast -c mktemp.c
done mktemp.o generated
make mv.o
prev mv.c
meta mv.o %.c>%.o mv.c mv
prev mv.c
exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -D_BLD_cmd -D_PACKAGE_ast -c mv.c
exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -D_BLD_cmd -D_PACKAGE_ast -c mv.c
done mv.o generated
make paste.o
prev paste.c
meta paste.o %.c>%.o paste.c paste
prev paste.c
exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_BLD_cmd -D_PACKAGE_ast -c paste.c
exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_BLD_cmd -D_PACKAGE_ast -c paste.c
done paste.o generated
make pathchk.o
prev pathchk.c
meta pathchk.o %.c>%.o pathchk.c pathchk
prev pathchk.c
exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_BLD_cmd -D_PACKAGE_ast -c pathchk.c
exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_BLD_cmd -D_PACKAGE_ast -c pathchk.c
done pathchk.o generated
make pids.o
prev pids.c
meta pids.o %.c>%.o pids.c pids
prev pids.c
exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_PACKAGE_ast -D_BLD_cmd -c pids.c
exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_PACKAGE_ast -D_BLD_cmd -c pids.c
done pids.o generated
make rev.o
prev rev.c
meta rev.o %.c>%.o rev.c rev
prev rev.c
exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_BLD_cmd -D_PACKAGE_ast -c rev.c
exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_BLD_cmd -D_PACKAGE_ast -c rev.c
done rev.o generated
make rm.o
prev rm.c
meta rm.o %.c>%.o rm.c rm
prev rm.c
exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_BLD_cmd -D_PACKAGE_ast -c rm.c
exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_BLD_cmd -D_PACKAGE_ast -c rm.c
done rm.o generated
make rmdir.o
prev rmdir.c
meta rmdir.o %.c>%.o rmdir.c rmdir
prev rmdir.c
exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_BLD_cmd -D_PACKAGE_ast -c rmdir.c
exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_BLD_cmd -D_PACKAGE_ast -c rmdir.c
done rmdir.o generated
make stty.o
prev stty.c
meta stty.o %.c>%.o stty.c stty
prev stty.c
exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_BLD_cmd -D_PACKAGE_ast -c stty.c
exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_BLD_cmd -D_PACKAGE_ast -c stty.c
done stty.o generated
make sum.o
prev sum.c
meta sum.o %.c>%.o sum.c sum
prev sum.c
exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -D_BLD_cmd -D_PACKAGE_ast -c sum.c
exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -D_BLD_cmd -D_PACKAGE_ast -c sum.c
done sum.o generated
make sync.o
prev sync.c
meta sync.o %.c>%.o sync.c sync
prev sync.c
exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_BLD_cmd -D_PACKAGE_ast -c sync.c
exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_BLD_cmd -D_PACKAGE_ast -c sync.c
done sync.o generated
make tail.o
prev tail.c
meta tail.o %.c>%.o tail.c tail
prev tail.c
exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_PACKAGE_ast -D_BLD_cmd -c tail.c
exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_PACKAGE_ast -D_BLD_cmd -c tail.c
done tail.o generated
make tee.o
prev tee.c
meta tee.o %.c>%.o tee.c tee
prev tee.c
exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_BLD_cmd -D_PACKAGE_ast -c tee.c
exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_BLD_cmd -D_PACKAGE_ast -c tee.c
done tee.o generated
make tty.o
prev tty.c
meta tty.o %.c>%.o tty.c tty
prev tty.c
exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_BLD_cmd -D_PACKAGE_ast -c tty.c
exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_BLD_cmd -D_PACKAGE_ast -c tty.c
done tty.o generated
make uname.o
prev uname.c
meta uname.o %.c>%.o uname.c uname
prev uname.c
exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -DHOSTTYPE=\""${mam_cc_HOSTTYPE}"\" -D_PACKAGE_ast -D_BLD_cmd -c uname.c
exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -DHOSTTYPE=\""${mam_cc_HOSTTYPE}"\" -D_PACKAGE_ast -D_BLD_cmd -c uname.c
done uname.o generated
make uniq.o
prev uniq.c
meta uniq.o %.c>%.o uniq.c uniq
prev uniq.c
exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_BLD_cmd -D_PACKAGE_ast -c uniq.c
exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_BLD_cmd -D_PACKAGE_ast -c uniq.c
done uniq.o generated
make vmstate.o
prev vmstate.c
meta vmstate.o %.c>%.o vmstate.c vmstate
prev vmstate.c
exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_PACKAGE_ast -D_BLD_cmd -c vmstate.c
exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_PACKAGE_ast -D_BLD_cmd -c vmstate.c
done vmstate.o generated
make wc.o
prev wc.c
meta wc.o %.c>%.o wc.c wc
prev wc.c
exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_PACKAGE_ast -D_BLD_cmd -c wc.c
exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_PACKAGE_ast -D_BLD_cmd -c wc.c
done wc.o generated
make revlib.o
prev revlib.c
meta revlib.o %.c>%.o revlib.c revlib
prev revlib.c
exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -D_BLD_cmd -D_PACKAGE_ast -c revlib.c
exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -D_BLD_cmd -D_PACKAGE_ast -c revlib.c
done revlib.o generated
make wclib.o
prev wclib.c
meta wclib.o %.c>%.o wclib.c wclib
prev wclib.c
exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -D_PACKAGE_ast -D_BLD_cmd -c wclib.c
exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -D_PACKAGE_ast -D_BLD_cmd -c wclib.c
done wclib.o generated
make sumlib.o
bind -lsum
@ -723,9 +670,8 @@ make install
done sumlib.o generated
make lib.o
prev lib.c
meta lib.o %.c>%.o lib.c lib
prev lib.c
exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -D_BLD_cmd -D_PACKAGE_ast -c lib.c
exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -D_BLD_cmd -D_PACKAGE_ast -c lib.c
done lib.o generated
exec - ${AR} rc libcmd.a cmdinit.o basename.o cat.o chgrp.o chmod.o chown.o cksum.o cmp.o comm.o cp.o cut.o dirname.o date.o expr.o fds.o fmt.o fold.o getconf.o head.o id.o join.o ln.o logname.o md5sum.o mkdir.o mkfifo.o mktemp.o mv.o paste.o pathchk.o
exec - ${AR} rc libcmd.a pids.o rev.o rm.o rmdir.o stty.o sum.o sync.o tail.o tee.o tty.o uname.o uniq.o vmstate.o wc.o revlib.o wclib.o sumlib.o lib.o

View file

@ -1,12 +1,10 @@
info mam static 00000 1994-07-17 make (AT&T Research) 5.7 2012-06-20
note *
note * This build file is in the Make Abstract Machine (MAM) language. It was
note * first generated by nmake, but in the ksh 93u+m distribution we maintain
note * it manually because nmake had too many problems to keep using. The
note * Mamfiles are processed by mamake (src/cmd/INIT/mamake.c); we added
note * support for indentation to improve readability. The language is
note * documented in Glenn Fowler's paper "A Make Abstract Machine":
note * http://web.archive.org/web/20041227143022/http://www2.research.att.com/~gsf/mam/mam.html
note * indentation to improve readability. The language is documented in
note * src/cmd/INIT/README-mamake.md.
note *
setv INSTALLROOT ../../..
setv PACKAGE_ast_INCLUDE ${INSTALLROOT}/include/ast
@ -14,7 +12,6 @@ setv PACKAGEROOT ../../../../..
setv AR ${mam_cc_AR} ${mam_cc_AR_ARFLAGS}
setv CC cc
setv mam_cc_FLAGS ${mam_cc_DLL}
setv KSH_RELFLAGS
setv CCFLAGS ${-debug-symbols?1?${mam_cc_DEBUG} -D_BLD_DEBUG?${mam_cc_OPTIMIZE}?}
setv COTEMP $$
setv IFFEFLAGS
@ -25,8 +22,8 @@ make install
make dll.req
exec - set -
exec - echo 'int main(){return 0;}' > 1.${COTEMP}.c
exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} -c 1.${COTEMP}.c &&
exec - x=`${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} ${LDFLAGS} -o 1.${COTEMP}.x 1.${COTEMP}.o -l'*' 2>&1 | sed -e 's/[][()+@?]/#/g' || :` &&
exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -c 1.${COTEMP}.c &&
exec - x=`${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} -o 1.${COTEMP}.x 1.${COTEMP}.o -l'*' 2>&1 | sed -e 's/[][()+@?]/#/g' || :` &&
exec - {
exec - case "" in
exec - *?) echo " " ;;
@ -42,8 +39,8 @@ make install
exec - esac
exec - continue
exec - elif test ! -f ${INSTALLROOT}/lib/lib$i.a
exec - then case `{ ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} -L${INSTALLROOT}/lib ${LDFLAGS} -o 1.${COTEMP}.x 1.${COTEMP}.o -l$i 2>&1 || echo '' "$x" ;} | sed -e 's/[][()+@?]/#/g' || :` in
exec - *$x*) case `{ ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} ${LDFLAGS} -o 1.${COTEMP}.x 1.${COTEMP}.o -l$i 2>&1 || echo '' "$x" ;} | sed -e 's/[][()+@?]/#/g' || :` in
exec - then case `{ ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -L${INSTALLROOT}/lib ${LDFLAGS} -o 1.${COTEMP}.x 1.${COTEMP}.o -l$i 2>&1 || echo '' "$x" ;} | sed -e 's/[][()+@?]/#/g' || :` in
exec - *$x*) case `{ ${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} -o 1.${COTEMP}.x 1.${COTEMP}.o -l$i 2>&1 || echo '' "$x" ;} | sed -e 's/[][()+@?]/#/g' || :` in
exec - *$x*) continue ;;
exec - esac
exec - ;;
@ -139,20 +136,18 @@ make install
done ${PACKAGE_ast_INCLUDE}/error.h
make dlldefs.h implicit
make FEATURE/dll
meta FEATURE/dll features/%>FEATURE/% features/dll dll
make features/dll
done features/dll
bind -ldl dontcare
bind -last
exec - iffe ${IFFEFLAGS} -v -c "${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} ${LDFLAGS}" ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdl} ${mam_libast} : run features/dll
exec - iffe ${IFFEFLAGS} -v -c "${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS}" ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdl} ${mam_libast} : run features/dll
done FEATURE/dll generated
exec - cmp -s FEATURE/dll dlldefs.h || { rm -f dlldefs.h; silent test -d . || mkdir .; cp FEATURE/dll dlldefs.h; }
done dlldefs.h generated
prev ${PACKAGE_ast_INCLUDE}/ast.h implicit
done dlfcn.c
meta dlfcn.o %.c>%.o dlfcn.c dlfcn
prev dlfcn.c
exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -D_BLD_dll -D_PACKAGE_ast -c dlfcn.c
exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -D_BLD_dll -D_PACKAGE_ast -c dlfcn.c
done dlfcn.o generated
make dllopen.o
make dllopen.c
@ -162,9 +157,8 @@ make install
prev ${PACKAGE_ast_INCLUDE}/ast.h implicit
done dlllib.h
done dllopen.c
meta dllopen.o %.c>%.o dllopen.c dllopen
prev dllopen.c
exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -D_PACKAGE_ast -D_BLD_dll -c dllopen.c
exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -D_PACKAGE_ast -D_BLD_dll -c dllopen.c
done dllopen.o generated
make dllfind.o
make dllfind.c
@ -172,25 +166,22 @@ make install
prev dlldefs.h implicit
prev ${PACKAGE_ast_INCLUDE}/ast.h implicit
done dllfind.c
meta dllfind.o %.c>%.o dllfind.c dllfind
prev dllfind.c
exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -D_PACKAGE_ast -D_BLD_dll -c dllfind.c
exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -D_PACKAGE_ast -D_BLD_dll -c dllfind.c
done dllfind.o generated
make dllplug.o
make dllplug.c
prev dlllib.h implicit
done dllplug.c
meta dllplug.o %.c>%.o dllplug.c dllplug
prev dllplug.c
exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -D_PACKAGE_ast -D_BLD_dll -c dllplug.c
exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -D_PACKAGE_ast -D_BLD_dll -c dllplug.c
done dllplug.o generated
make dll_lib.o
make dll_lib.c
prev dlllib.h implicit
done dll_lib.c
meta dll_lib.o %.c>%.o dll_lib.c dll_lib
prev dll_lib.c
exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -D_PACKAGE_ast -D_BLD_dll -c dll_lib.c
exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -D_PACKAGE_ast -D_BLD_dll -c dll_lib.c
done dll_lib.o generated
make dllnext.o
make dllnext.c
@ -199,9 +190,8 @@ make install
prev dlldefs.h implicit
prev ${PACKAGE_ast_INCLUDE}/ast.h implicit
done dllnext.c
meta dllnext.o %.c>%.o dllnext.c dllnext
prev dllnext.c
exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -D_BLD_dll -D_PACKAGE_ast -c dllnext.c
exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -D_BLD_dll -D_PACKAGE_ast -c dllnext.c
done dllnext.o generated
make dlllook.o
make dlllook.c
@ -209,9 +199,8 @@ make install
prev ${PACKAGE_ast_INCLUDE}/error.h implicit
prev ${PACKAGE_ast_INCLUDE}/ast.h implicit
done dlllook.c
meta dlllook.o %.c>%.o dlllook.c dlllook
prev dlllook.c
exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -D_BLD_dll -D_PACKAGE_ast -c dlllook.c
exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -D_BLD_dll -D_PACKAGE_ast -c dlllook.c
done dlllook.o generated
make dllscan.o
make dllscan.c
@ -231,25 +220,22 @@ make install
done ${PACKAGE_ast_INCLUDE}/cdt.h
prev ${PACKAGE_ast_INCLUDE}/ast.h implicit
done dllscan.c
meta dllscan.o %.c>%.o dllscan.c dllscan
prev dllscan.c
exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} ${-debug-symbols?1?${mam_cc_DEBUG} -D_BLD_DEBUG?${CCFLAGS.FORCE}?} -I. -I${PACKAGE_ast_INCLUDE} -D_BLD_dll -D_PACKAGE_ast -c dllscan.c
exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${-debug-symbols?1?${mam_cc_DEBUG} -D_BLD_DEBUG?${CCFLAGS.FORCE}?} -I. -I${PACKAGE_ast_INCLUDE} -D_BLD_dll -D_PACKAGE_ast -c dllscan.c
done dllscan.o generated
make dllcheck.o
make dllcheck.c
prev dlllib.h implicit
done dllcheck.c
meta dllcheck.o %.c>%.o dllcheck.c dllcheck
prev dllcheck.c
exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -D_PACKAGE_ast -D_BLD_dll -c dllcheck.c
exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -D_PACKAGE_ast -D_BLD_dll -c dllcheck.c
done dllcheck.o generated
make dllerror.o
make dllerror.c
prev dlllib.h implicit
done dllerror.c
meta dllerror.o %.c>%.o dllerror.c dllerror
prev dllerror.c
exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -D_PACKAGE_ast -D_BLD_dll -c dllerror.c
exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -D_PACKAGE_ast -D_BLD_dll -c dllerror.c
done dllerror.o generated
exec - ${AR} rc libdll.a dlfcn.o dllopen.o dllfind.o dllplug.o dll_lib.o dllnext.o dlllook.o dllscan.o dllcheck.o dllerror.o
exec - (ranlib libdll.a) >/dev/null 2>&1 || true

View file

@ -1,12 +1,10 @@
info mam static 00000 1994-07-17 make (AT&T Research) 5.7 2012-06-20
note *
note * This build file is in the Make Abstract Machine (MAM) language. It was
note * first generated by nmake, but in the ksh 93u+m distribution we maintain
note * it manually because nmake had too many problems to keep using. The
note * Mamfiles are processed by mamake (src/cmd/INIT/mamake.c); we added
note * support for indentation to improve readability. The language is
note * documented in Glenn Fowler's paper "A Make Abstract Machine":
note * http://web.archive.org/web/20041227143022/http://www2.research.att.com/~gsf/mam/mam.html
note * indentation to improve readability. The language is documented in
note * src/cmd/INIT/README-mamake.md.
note *
setv INSTALLROOT ../../..
setv PACKAGE_ast_INCLUDE ${INSTALLROOT}/include/ast
@ -14,7 +12,6 @@ setv PACKAGEROOT ../../../../..
setv AR ${mam_cc_AR} ${mam_cc_AR_ARFLAGS}
setv CC cc
setv mam_cc_FLAGS ${mam_cc_PIC}
setv KSH_RELFLAGS
setv CCFLAGS ${-debug-symbols?1?${mam_cc_DEBUG} -D_BLD_DEBUG?${mam_cc_OPTIMIZE}?}
setv COTEMP $$
setv IFFEFLAGS
@ -25,8 +22,8 @@ make install
make sum.req
exec - set -
exec - echo 'int main(){return 0;}' > 1.${COTEMP}.c
exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} -c 1.${COTEMP}.c &&
exec - x=`${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} ${LDFLAGS} -o 1.${COTEMP}.x 1.${COTEMP}.o -l'*' 2>&1 | sed -e 's/[][()+@?]/#/g' || :` &&
exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -c 1.${COTEMP}.c &&
exec - x=`${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} -o 1.${COTEMP}.x 1.${COTEMP}.o -l'*' 2>&1 | sed -e 's/[][()+@?]/#/g' || :` &&
exec - {
exec - case "" in
exec - *?) echo " " ;;
@ -42,8 +39,8 @@ make install
exec - esac
exec - continue
exec - elif test ! -f ${INSTALLROOT}/lib/lib$i.a
exec - then case `{ ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} -L${INSTALLROOT}/lib ${LDFLAGS} -o 1.${COTEMP}.x 1.${COTEMP}.o -l$i 2>&1 || echo '' "$x" ;} | sed -e 's/[][()+@?]/#/g' || :` in
exec - *$x*) case `{ ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} ${LDFLAGS} -o 1.${COTEMP}.x 1.${COTEMP}.o -l$i 2>&1 || echo '' "$x" ;} | sed -e 's/[][()+@?]/#/g' || :` in
exec - then case `{ ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -L${INSTALLROOT}/lib ${LDFLAGS} -o 1.${COTEMP}.x 1.${COTEMP}.o -l$i 2>&1 || echo '' "$x" ;} | sed -e 's/[][()+@?]/#/g' || :` in
exec - *$x*) case `{ ${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} -o 1.${COTEMP}.x 1.${COTEMP}.o -l$i 2>&1 || echo '' "$x" ;} | sed -e 's/[][()+@?]/#/g' || :` in
exec - *$x*) continue ;;
exec - esac
exec - ;;
@ -93,11 +90,10 @@ make install
make sum-ast4.c implicit
done sum-ast4.c
make FEATURE/sum implicit
meta FEATURE/sum features/%>FEATURE/% features/sum sum
make features/sum
done features/sum
bind -last
exec - iffe ${IFFEFLAGS} -v -c "${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} ${LDFLAGS}" ref ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libast} : run features/sum
exec - iffe ${IFFEFLAGS} -v -c "${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS}" ref ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libast} : run features/sum
done FEATURE/sum generated
make ${PACKAGE_ast_INCLUDE}/hashpart.h implicit
done ${PACKAGE_ast_INCLUDE}/hashpart.h
@ -174,9 +170,8 @@ make install
prev ${PACKAGE_ast_INCLUDE}/ast.h implicit
done sum-crc.c
done sumlib.c
meta sumlib.o %.c>%.o sumlib.c sumlib
prev sumlib.c
exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -D_PACKAGE_ast -c sumlib.c
exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -D_PACKAGE_ast -c sumlib.c
done sumlib.o generated
exec - ${AR} rc libsum.a sumlib.o
exec - (ranlib libsum.a) >/dev/null 2>&1 || true