Merge pull request #1317 from xexyl/1992-ant

This commit is contained in:
Landon Curt Noll authored and GitHub committed 2023-11-08 12:46:43 -07:00
commit c96f6974f3
6 files changed
+55 -26

No files matched your search

+18 -10
View File
@@ -113,7 +113,7 @@ PROG= ${ENTRY}
#
OBJ= ${PROG}.o
DATA=
TARGET= ${PROG} am
TARGET= ${PROG}
#
ALT_OBJ=
ALT_TARGET=
@@ -129,15 +129,18 @@ all: data ${TARGET}
.PHONY: all alt data everything diff_orig_prog diff_prog_orig \
diff_alt_prog diff_prog_alt diff_orig_alt diff_alt_orig \
clean clobber install love haste waste maker easter_egg \
sandwich supernova deep_magic magic charon pluto
sandwich supernova deep_magic magic charon pluto \
supernova deep_magic magic charon pluto
${PROG}: ${PROG}.c
${CC} ${CFLAGS} $< -o $@ ${LDFLAGS}
am: ${PROG}
${RM} -f $@
${LN} $< $@
am: ant
rm -f am
ln ant am
cp am am.safe
cp am.safe am
rm -f am.safe
# alternative executable
#
@@ -215,11 +218,16 @@ clobber: clean
echo 'ate sandwich'; \
fi
am_clobber: clean am
${RM} -f am.safe
${CP} am am.safe
${CP} am.safe am
${RM} -f am.safe
am_clean:
rm -f ant.o am.o
@-if [ -f indent.c ]; then \
echo ${RM} -f indent.c; \
${RM} -f indent.c; \
fi
am_clobber: am_clean
rm -f am.safe
install:
@echo "Dr. Spock says that is not logical!"
+8 -7
View File
@@ -8,7 +8,7 @@ make all
## To use:
```sh
./am Makefile
./ant Makefile
```
where `Makefile` is a Makefile to use.
@@ -16,16 +16,17 @@ where `Makefile` is a Makefile to use.
### Try:
First build the tool itself with our Makefile:
```sh
./ant ant.test.mk
./ant Makefile am
```
We also suggest that you try:
Now use `am` to do some things:
```sh
make am
./am Makefile am_clobber # clobber everything except am
./am Makefile all
./am ant.test.mk # run the test Makefile with am
```
@@ -34,8 +35,8 @@ make am
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\
This entry comes complete with a POSIX-like command description.
Interested POSIX balloters should lobby the IEEE for an obfuscated
P1003 subcommittee.
+8 -8
View File
@@ -35,7 +35,7 @@ None.
OPERANDS
makefile This required argument, is a pathname of a description
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.
@@ -123,7 +123,7 @@ 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()
passing the command line to the command interpreter via the system(3)
function.
The environment for the command being executed shall contain all of the
@@ -168,7 +168,7 @@ 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.
There are no special targets and no inference rule support.
MACROS
@@ -191,7 +191,7 @@ 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
references (i.e. 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.
@@ -233,7 +233,7 @@ tested on
For all machines, the compile command line should be
cc -O -o am am.c
cc -O -o ant ant.c
The value RULES represents the number of slots available to record
target rules, dependencies, and commands. The default value chosen
@@ -261,9 +261,9 @@ REFERENCES
FILES
howe.c Obfuscated source
howe.README Manual for AM
howe.test.mk Test makefile
ant.c Obfuscated source
ant.README Manual for AM
ant.test.mk Test makefile
BUGS
+1
View File
@@ -8,6 +8,7 @@
#include <stdio.h>
#include <string.h>
#include <sys/stat.h>
#include <time.h>
#ifndef RULES
#define RULES 500
+1 -1
View File
@@ -180,7 +180,7 @@ error.1:
# Target where dependency does not exist.
error.2: unknown
# Receipe command causes error.
# Recipe command causes error.
error.3: t1 fail t2
fail:
ls -l unknown
+19
View File
@@ -1387,6 +1387,25 @@ Thus Cody's fixed applies to the original entry. The problems were that
function returning without a value. The function was changed to return void.
## [1992/ant](1992/ant/ant.c) ([README.md](1992/ant/README.md]))
Cody fixed the Makefile so that the program will actually work with it (or at
least the rule to clobber files and link `am` to `ant`). The issue was that the
variables in the Makefile could not be evaluated in the same way as it's not as
feature-rich as other implementations of `make`. Thus the use of `${RM}` and
`${CP}` were in the respective rules changed to `rm` and `cp`, for two examples.
A new rule had to be added as well. The variable situation might be because they
are obtained from the root variable Makefile `var.mk` via `include` which the
program might not support (this has not been tested, however) and also because
it appears that the syntax for this program is to use `$()` rather than `${}`.
Cody also fixed another problem, unrelated, in the Makefile with the `.PHONY`
rule where a line was not ended with a `\` but should have been.
The author stated that in some systems like DOS with Turbo C, it might be
necessary to include `time.h` so Cody did this as well.
## [1992/buzzard.1](1992/buzzard.1/buzzard.1.c) ([README.md](1992/buzzard.1/README.md))
Cody added a check for the right number of args, exiting 1 if not enough (2)