Move 1988-2004 entries into subdirs
We we move 1988-2004 entries from all of a year's winning entries in a single directory to each winner being in their own sub-directory under the given year directory.
This commit is contained in:
1 parent
1e82e8aa3e
commit
d2a42f42e8
478 files changed
No files matched your search
@@ -0,0 +1,271 @@
|
||||
NAME
|
||||
|
||||
am Anthony's Make
|
||||
|
||||
|
||||
SYNOPSIS
|
||||
|
||||
am <makefile> [target]
|
||||
|
||||
|
||||
DESCRIPTION
|
||||
|
||||
AM is a programmer's tool to maintain, update, and regenerate groups
|
||||
of files and/or programs. It is similar to MAKE as described by the
|
||||
POSIX.2 draft standard 11.2, and this document parallels the draft
|
||||
in order to point out the subtle differences between AM and MAKE.
|
||||
|
||||
The AM utility can be used as part of software development to update
|
||||
files that are derived from other files. A typical case is one where
|
||||
object files are derived from the corresponding source files. The AM
|
||||
utility examines time relationships and updates those derived files
|
||||
(targets) that have modified times earlier than the modified times of
|
||||
the files (prerequisites) from which they are derived. A description
|
||||
file ("makefile") contains a description of the relationships between
|
||||
files, and the commands that must be executed to update the targets to
|
||||
reflect changes in their prerequisites. Each specification, or rule,
|
||||
shall consist of a target, optional prerequisites, and optional
|
||||
commands to be executed when a prerequisite is newer than the target.
|
||||
|
||||
|
||||
OPTIONS
|
||||
|
||||
None.
|
||||
|
||||
|
||||
OPERANDS
|
||||
|
||||
makefile This required argument, is a pathname of a description
|
||||
file, which is also referred to as the "makfile". A
|
||||
pathname of "-", shall *NOT* denote the standard input.
|
||||
|
||||
target This optional argument, is the first target to be
|
||||
processed. If no target is specified, when AM is
|
||||
processing the makefile, the first target that AM
|
||||
encounters shall be used.
|
||||
|
||||
|
||||
EXTERNAL INFLUENCES
|
||||
|
||||
STANDARD INPUT
|
||||
|
||||
Not used.
|
||||
|
||||
|
||||
INPUT FILES
|
||||
|
||||
The input file, otherwise known as the makefile, is a text file
|
||||
containing rules, macro definitions, and comments.
|
||||
|
||||
|
||||
ASYNCHRONOUS EVENTS
|
||||
|
||||
All traps are left to their default actions. If AM receives a SIGHUP,
|
||||
SIGTERM, SIGINT, or SIGQUIT then AM will terminate as per request
|
||||
*WITHOUT* removing the current target.
|
||||
|
||||
|
||||
EXTERNAL EFFECTS
|
||||
|
||||
STANDARD OUTPUT
|
||||
|
||||
The AM utility shall write all commands to be executed to standard
|
||||
output unless the command is prefixed with an at-sign (@). If AM is
|
||||
invoked without any work needing to be done, it shall *NOT* write a
|
||||
message to standard output indicating that no action was taken.
|
||||
|
||||
|
||||
STANDARD ERROR
|
||||
|
||||
Standard error is used for diagnostic messages only.
|
||||
|
||||
|
||||
OUTPUT FILES
|
||||
|
||||
None. However, the utilities invoked by AM may create additional files.
|
||||
|
||||
|
||||
EXTENDED DESCRIPTION
|
||||
|
||||
The AM utility attempts to perform the actions required to ensure
|
||||
that the specified target(s) are up-to-date. A target is considered
|
||||
out-of-date if it is older than any of its prerequisites or it does
|
||||
not exist. The AM utility shall treat all prerequisites as targets
|
||||
themselves and recursively ensure that they are up-to-date, processing
|
||||
them in the order which they appear in the rule. The AM utility shall
|
||||
use the modification times of files to determine if the corresponding
|
||||
targets are out-of-date.
|
||||
|
||||
After AM has ensured that all of the prerequisites of a target are
|
||||
up-to-date, and if the target is out-of-date, the commands associated
|
||||
with the target entry shall be executed. If there are no commands
|
||||
listed for the target, the target shall be treated as up-to-date.
|
||||
|
||||
|
||||
MAKEFILE SYNTAX
|
||||
|
||||
A makefile can contain rules, macro definitions, and comments. If a
|
||||
macro is defined more than once, the value of the macro shall be the
|
||||
last one specified. Comments start with a number-sign (#) and
|
||||
continue until an unescaped <newline> is reached.
|
||||
|
||||
A backslash before a <newline> serves as a line continuation mark, and
|
||||
is used to create long-lines. A line will continue to be extended until
|
||||
an unescaped <newline> is reached.
|
||||
|
||||
When an escaped <newline> (one preceded by a backslash) is found anywhere
|
||||
in the makefile, it shall be replaced, along with any leading white
|
||||
space on the following line, with a single <space>.
|
||||
|
||||
|
||||
MAKEFILE EXECUTION
|
||||
|
||||
Command lines shall be processed one at a time by writing the command
|
||||
line to standard output, unless prefixed with an at-sign (@), and
|
||||
executing the command(s) in the line. Commands shall be executed by
|
||||
passing the command line to the command interpreter via the system()
|
||||
function.
|
||||
|
||||
The environment for the command being executed shall contain all of the
|
||||
variables in the environment of AM. All macros are considered to be part
|
||||
of the environment too.
|
||||
|
||||
By default, when AM receives a non-zero status from the execution of a
|
||||
command, it terminates with an error message to standard error. If
|
||||
the command is prefixed by a hyphen (-) then any error found while
|
||||
executing the command shall be ignored.
|
||||
|
||||
Command lines can have one or more of the following prefixes: a hyphen
|
||||
(-) to ignore errors, an at-sign (@) to be silent, or a plus-sign (+)
|
||||
if the command is always executed (this prefix is for compatibility with
|
||||
MAKE and is ignored).
|
||||
|
||||
|
||||
TARGET RULES
|
||||
|
||||
Target rules are formatted as follows:
|
||||
|
||||
target [target ...] : [prerequisite ...]
|
||||
[<tab>command
|
||||
<tab>command
|
||||
...]
|
||||
|
||||
(line that does not begin with <tab>)
|
||||
|
||||
Target entries are specified by a <blank>-separated, non-null list of
|
||||
targets, then a colon, then a <blank>-separated, possibly empty list
|
||||
of prerequisite. All following lines, if any, that begin with a <tab>,
|
||||
are command lines to be executed to update the target(s). The first
|
||||
line that does not begin with a <tab> shall begin a new entry.
|
||||
|
||||
Target names can be any character supported by the host system,
|
||||
excluding <blank>s, <tab>s, <newline>s, and colons (:), which are used
|
||||
for delimiters.
|
||||
|
||||
For any given target there can be only one target rule. The first
|
||||
occurrence of a target in a makefile shall be used. All subsequent
|
||||
rules for the same target are ignored. There is *no* support for
|
||||
adding prerequisites to a target's prerequisite list once a target
|
||||
rule is defined.
|
||||
|
||||
There are no special targets or inference rule support.
|
||||
|
||||
|
||||
MACROS
|
||||
|
||||
Macro definitions are in the form:
|
||||
|
||||
string1 = [string2]
|
||||
|
||||
The macro named string1 is defined as having the value of string2,
|
||||
where string2 is defined as all characters, if any, after the equal
|
||||
sign up to an unescaped <newline>. Any <blank>s immediately before or
|
||||
after the equal sign shall be ignored.
|
||||
|
||||
Subsequent appearances of $(string1) shall be replaced by string2.
|
||||
The parentheses are *NOT* optional if string1 is a single character.
|
||||
The macro $$ shall be replaced by the single character $.
|
||||
|
||||
Macro names can be any character that the host system would allow in
|
||||
the definition of environment variables, excluding parentheses, ( and ),
|
||||
which are used for delimiters.
|
||||
|
||||
Macros can appear anywhere in the makefile, except within other macro
|
||||
references (ie. no nesting). Macros in target and command lines shall
|
||||
be evaluated when the line is read. Macros in macro definition lines
|
||||
shall be evaluated *IMMEDIATELY*. A macro that has not been defined
|
||||
shall evaluate to a null string without causing any error condition.
|
||||
|
||||
If a macro is defined more than once, the value of the macro shall be the
|
||||
last one specified prior to it being referenced.
|
||||
|
||||
Macro assignments shall be accepted from the sources listed below, in
|
||||
the order shown. If a macro name already exists at the time it is being
|
||||
processed, the newer definition shall replace the existing definition.
|
||||
|
||||
1) The contents of the environment, including the variables with
|
||||
null values in the order defined in the environment.
|
||||
|
||||
2) Macros defined in the makefile, processed in the order specified.
|
||||
|
||||
There are no internal macros supported. The SHELL macro shall *NOT* be
|
||||
treated specially.
|
||||
|
||||
|
||||
EXIT STATUS
|
||||
|
||||
0 Successful completion.
|
||||
1 General error.
|
||||
2 Usage error.
|
||||
3 Failed to open makefile.
|
||||
4 Failed to allocate memory.
|
||||
|
||||
|
||||
INSTALLATION
|
||||
|
||||
AM can be built on any system providing at least K&R C. It has been
|
||||
tested on
|
||||
|
||||
o SunOS with GCC
|
||||
o ATARI Mega ST with Sozobon C
|
||||
o PC clone with Turbo C
|
||||
o Interactive UNIX System V/386 release 3.2
|
||||
|
||||
For all machines, the compile command line should be
|
||||
|
||||
cc -O -o am am.c
|
||||
|
||||
The value RULES represents the number of slots available to record
|
||||
target rules, dependencies, and commands. The default value chosen
|
||||
should handle most project makefiles. RULES can be overridden on the
|
||||
command line with -DRULES=nn, where 0 < nn < INT_MAX.
|
||||
|
||||
On a DOS machine using Turbo C, it may be necessary to add the include
|
||||
directive
|
||||
|
||||
#include <time.h>
|
||||
|
||||
with the rest of the includes if sys/stat.h does not properly define or
|
||||
use time_t. Also, on some older K&R C compilers, stdlib.h may not be
|
||||
defined and so it might be necessary to remove the include directive for
|
||||
it.
|
||||
|
||||
|
||||
REFERENCES
|
||||
|
||||
[Mil87] Webb Miller, "A Software Tools Sampler", Prentice Hall, 87
|
||||
ISBN 0-13-822305-X, chaper 2
|
||||
|
||||
[POSIX] POSIX.2 draft 11.2 MAKE
|
||||
|
||||
|
||||
FILES
|
||||
|
||||
ant.c Obfuscated source
|
||||
ant.README Manual for AM
|
||||
ant.test.mk Test makefile
|
||||
|
||||
|
||||
BUGS
|
||||
|
||||
Unknown as of 20 March 92.
|
||||
+178
@@ -0,0 +1,178 @@
|
||||
#define W while
|
||||
#define S strspn
|
||||
#define R return
|
||||
#define F fprintf(stderr,
|
||||
#define C continue;
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#ifndef RULES
|
||||
#define RULES 500
|
||||
#endif
|
||||
|
||||
#define N(p, i) (p += i, p += S(p, w), i = strcspn(p, w))
|
||||
|
||||
char *b, l[BUFSIZ], *t[RULES], *d[RULES], *c[RULES], w[] = "\n\t ";
|
||||
|
||||
time_t M();
|
||||
int T();
|
||||
void U();
|
||||
|
||||
|
||||
time_t
|
||||
M(f)
|
||||
char *f;
|
||||
{
|
||||
int j, x;
|
||||
size_t i = 0;
|
||||
struct stat s;
|
||||
N(f, i);
|
||||
x = f[i];
|
||||
f[i] = 0;
|
||||
j = stat(f, &s);
|
||||
f[i] = x;
|
||||
R j < 0 ? 0 : s.st_mtime;
|
||||
}
|
||||
|
||||
int
|
||||
T(f)
|
||||
char *f;
|
||||
{
|
||||
char *q;
|
||||
size_t i = 0, j, k = 1;
|
||||
N(f, i);
|
||||
W ((q = t[k])) {
|
||||
j = 0;
|
||||
W (N(q, j)) {
|
||||
if (i == j && !strncmp(f, q, i))
|
||||
R k;
|
||||
}
|
||||
++k;
|
||||
}
|
||||
R 0;
|
||||
}
|
||||
|
||||
void
|
||||
U(f)
|
||||
char *f;
|
||||
{
|
||||
time_t t = M(f);
|
||||
size_t i = 0, j = !t, k = T(f);
|
||||
char *p = d[k], *q = c[k];
|
||||
if (!N(p, i) && q && *q != '\t' && j) {
|
||||
F "am: Don't know how to make '%s'.\n", f);
|
||||
exit(1);
|
||||
}
|
||||
W (0 < i) {
|
||||
U(p);
|
||||
if (t < M(p))
|
||||
j = 1;
|
||||
N(p, i);
|
||||
}
|
||||
if (j && q && *q == '\t') {
|
||||
sleep(1);
|
||||
W (*q++ == '\t') {
|
||||
i = j = 1;
|
||||
W (0 < S(q, "-+@")) {
|
||||
if (*q == '@')
|
||||
|
||||
i = 0;
|
||||
if (*q++ == '-')
|
||||
|
||||
j = 0;
|
||||
}
|
||||
if (i)
|
||||
puts(q);
|
||||
if (system(q) && j) {
|
||||
F "am: Error making '%s'\n", f);
|
||||
exit(1);
|
||||
}
|
||||
q += strlen(q) + 1;
|
||||
}
|
||||
c[k] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
main(u, v)
|
||||
int u;
|
||||
char **v;
|
||||
{
|
||||
FILE *f;
|
||||
struct stat s;
|
||||
size_t i, j, k;
|
||||
char *m, *n, *p, *q, *r;
|
||||
if (u < 2) {
|
||||
F "usage: am <makefile> [target]\n");
|
||||
R 2;
|
||||
}
|
||||
if (stat(*++v, &s) || !(f = fopen(*v, "r")))
|
||||
R 3;
|
||||
q = b = malloc(2*s.st_size);
|
||||
if (!b)
|
||||
R 4;
|
||||
i = 1;
|
||||
k = 0;
|
||||
m = 0;
|
||||
*t = *d = *c = "";
|
||||
W ((r = fgets(l, BUFSIZ, f))) {
|
||||
if (RULES <= i) {
|
||||
F "am: Number of target-rules exceeds %d.\n", RULES);
|
||||
R 1;
|
||||
}
|
||||
if (k) {
|
||||
*q++ = ' ';
|
||||
r += S(r, w);
|
||||
} else {
|
||||
if (t[i])
|
||||
c[i++] = q;
|
||||
if (m && putenv(m))
|
||||
F "am: No more environment space.\n");
|
||||
m = 0;
|
||||
if (*l == '#' || *l == '\n')
|
||||
C
|
||||
p = q;
|
||||
}
|
||||
W (!(k = *r == '\\' && r[1] == '\n') && *r) {
|
||||
if (*r == '$') {
|
||||
if (r[1] == '(') {
|
||||
n = r+2;
|
||||
r += strcspn(r, ")");
|
||||
*r++ = 0;
|
||||
n = getenv(n);
|
||||
if (n)
|
||||
q = strcpy(q, n) + strlen(n);
|
||||
C
|
||||
}
|
||||
if (*r == r[1])
|
||||
++r;
|
||||
}
|
||||
if (*r == '=' && *l != '\t' && !m) {
|
||||
*q = 0;
|
||||
m = p;
|
||||
j = 0;
|
||||
q = N(m, j) + m;
|
||||
*q++ = *r;
|
||||
j = 1;
|
||||
if (!N(r, j))
|
||||
*q++ = 0;
|
||||
C
|
||||
}
|
||||
if (*r == ':') {
|
||||
t[i] = p;
|
||||
*r = 0;
|
||||
d[i] = q+1;
|
||||
}
|
||||
if (*r == '\n')
|
||||
*r = 0;
|
||||
*q++ = *r++;
|
||||
}
|
||||
}
|
||||
fclose(f);
|
||||
U(2 < u ? *++v : t[1]);
|
||||
R 0;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
Best Utility:
|
||||
|
||||
Anthony C Howe
|
||||
Mortice Kern Systems Inc.
|
||||
Unit 1, 14 Weber Street North
|
||||
Waterloo, Ontario
|
||||
N2J 3G4
|
||||
Canada
|
||||
|
||||
|
||||
Judges' comments:
|
||||
|
||||
To use:
|
||||
make am
|
||||
am ant.test.mk
|
||||
|
||||
Like much of Posix, obfuscation has its place. Your task is to
|
||||
figure out where.
|
||||
|
||||
This entry comes complete with a Posix-like command description.
|
||||
Interested Posix balloters should lobby the IEEE for an obfuscated
|
||||
P1003 sub-committee.
|
||||
|
||||
We also suggest that you try:
|
||||
make am
|
||||
am Makefile am_clobber <-- clobber everything except am
|
||||
am Makefile all
|
||||
|
||||
|
||||
Selected notes from the author:
|
||||
|
||||
See the file ant.README.
|
||||
|
||||
Copyright (c) 1992, Landon Curt Noll & Larry Bassel.
|
||||
All Rights Reserved. Permission for personal, educational or non-profit use is
|
||||
granted provided this this copyright and notice are included in its entirety
|
||||
and remains unaltered. All other uses must receive prior permission in writing
|
||||
from both Landon Curt Noll and Larry Bassel.
|
||||
@@ -0,0 +1,196 @@
|
||||
#
|
||||
# Test makefile for AM
|
||||
#
|
||||
|
||||
#
|
||||
# Allow for empty macros.
|
||||
#
|
||||
EMPTY=
|
||||
|
||||
#
|
||||
# Allow for white space in macro assignment.
|
||||
#
|
||||
TEXT_1=no white space
|
||||
TEXT_2 =left hand side
|
||||
TEXT_3= right hand side
|
||||
TEXT_4 = both sides
|
||||
TEXT_5 = tabs boths sides
|
||||
|
||||
#
|
||||
# Test psuedo targets.
|
||||
#
|
||||
all : print_macros repeat redefine many flags multiple split errors done
|
||||
|
||||
print_macros : empty t1 t2 t3 t4 t5 t.all
|
||||
|
||||
#
|
||||
# Targets with no dependencies.
|
||||
#
|
||||
empty :
|
||||
echo EMPTY='$(EMPTY)'
|
||||
|
||||
t1 :
|
||||
echo TEXT_1='$(TEXT_1)'
|
||||
|
||||
t2 :
|
||||
echo TEXT_2='$(TEXT_2)'
|
||||
|
||||
t3 :
|
||||
echo TEXT_3='$(TEXT_3)'
|
||||
|
||||
t4 :
|
||||
echo TEXT_4='$(TEXT_4)'
|
||||
|
||||
t5 :
|
||||
echo TEXT_5='$(TEXT_5)'
|
||||
|
||||
t.all :
|
||||
echo $(TEXT_1) $(TEXT_2) $(TEXT_3) $(TEXT_4) $(TEXT_5)
|
||||
|
||||
#
|
||||
# Test redefinition of macros. AM allows redefinition and
|
||||
# evaluates macros immediately.
|
||||
#
|
||||
TEXT_1 =text number 1
|
||||
TEXT_2 = test macro split \
|
||||
across lines \
|
||||
three lines
|
||||
TEXT_3 = test dollar macro '$$'
|
||||
TEXT_4 = test dollar again "$$(TEXT_1)"
|
||||
TEXT_5 = imbeded macro '$(TEXT_1)'
|
||||
|
||||
redefine : r1 r2 r3 r4 r5
|
||||
|
||||
r1 :
|
||||
echo TEXT_1='$(TEXT_1)'
|
||||
|
||||
r2 :
|
||||
echo TEXT_2='$(TEXT_2)'
|
||||
|
||||
r3 :
|
||||
echo TEXT_3='$(TEXT_3)'
|
||||
|
||||
r4 :
|
||||
echo TEXT_4='$(TEXT_4)'
|
||||
|
||||
r5 :
|
||||
echo TEXT_5='$(TEXT_5)'
|
||||
|
||||
#
|
||||
# Try to update a prerequisite more than once. Subsequent occurences
|
||||
# should be ignored once a prerequisite has been updated.
|
||||
#
|
||||
repeat: t1 repeat.a t3
|
||||
repeat.a : t2 t1
|
||||
|
||||
|
||||
#
|
||||
# Target with multi-line receipe.
|
||||
#
|
||||
many : leaf.1 leaf.2
|
||||
echo Execute receipe with multiple commands.
|
||||
ls -1 leaf.*
|
||||
echo Last line of receipe for target 'many'.
|
||||
|
||||
leaf.1 :
|
||||
touch leaf.1
|
||||
|
||||
leaf.2 :
|
||||
touch leaf.2
|
||||
|
||||
|
||||
#
|
||||
# Test receipe line flags.
|
||||
#
|
||||
flags : silence ignore always combination
|
||||
|
||||
# Command not displayed before execution.
|
||||
silence :
|
||||
echo You should not see the 'ls' command printed.
|
||||
@ls leaf.*
|
||||
|
||||
# Ignore errors from command.
|
||||
ignore :
|
||||
echo The 'ls' command should fail but not terminate AM.
|
||||
-ls unknown
|
||||
|
||||
# This flag is ignored by AM since we don't support a silence option (-n).
|
||||
always :
|
||||
+echo The '+' flag is accepted and ignored.
|
||||
|
||||
combination:
|
||||
-@echo The next displayed line should not be 'ls unknown'
|
||||
@-ls unknown
|
||||
@+-echo Combined flags test completed.
|
||||
|
||||
|
||||
#
|
||||
# Multiple targets.
|
||||
#
|
||||
multiple : node.2 node.5
|
||||
|
||||
node.1 node.2 node.3 : leaf.1 leaf.2
|
||||
touch node.1 node.2 node.3
|
||||
|
||||
node.4 node.5 : node.2 leaf.3
|
||||
touch node.4 node.5
|
||||
|
||||
leaf.3 :
|
||||
touch leaf.3
|
||||
|
||||
|
||||
#
|
||||
# Test split lines.
|
||||
#
|
||||
split : node.6 leaf.4 split.cmd
|
||||
echo Completed split line tests.
|
||||
|
||||
# Target dependencies split across lines.
|
||||
node.6 : leaf.1 \
|
||||
leaf.2 \
|
||||
leaf.3
|
||||
echo Test dependency list split across lines.
|
||||
touch node.6
|
||||
|
||||
# Target list split across lines.
|
||||
split.tar \
|
||||
leaf.4 \
|
||||
leaf.5 :
|
||||
echo Test target list split across lines
|
||||
touch leaf.4 leaf.5
|
||||
|
||||
# Command lines split across lines.
|
||||
split.cmd:
|
||||
echo Try spliting command \
|
||||
lines across more \
|
||||
than one line.
|
||||
|
||||
|
||||
#
|
||||
# Test AM error reports and exit statuses.
|
||||
#
|
||||
errors:
|
||||
-am test.mk error.1
|
||||
-am test.mk error.2
|
||||
-am test.mk error.3
|
||||
|
||||
# Target that does not exist, has no dependencies, and no commands.
|
||||
error.1:
|
||||
|
||||
# Target where dependency does not exist.
|
||||
error.2: unknown
|
||||
|
||||
# Receipe command causes error.
|
||||
error.3: t1 fail t2
|
||||
fail:
|
||||
ls -l unknown
|
||||
|
||||
|
||||
#
|
||||
#
|
||||
#
|
||||
done:
|
||||
echo AM Test Complete
|
||||
|
||||
clean:
|
||||
rm leaf.* node.*
|
||||
Reference in new issue
Block a user