Fix 1989/jar.2
There were some things unclear in the README.md file that have now been corrected. Clarified in the README.md that running make clobber all will run the program itself. The make alt target now runs the alt code just like the entry itself. This is fine because it is a simulation (to avoid annoyance of writing binary data to /dev/tty) and since one may still run the program or script directly it's fine. The alternate code section in the README.md was cleaned up and formatted as well.
This commit is contained in:
1 parent
7b1ed2bc94
commit
db6b154b70
5 files changed
+50
-10
No files matched your search
+3
-1
@@ -140,10 +140,12 @@ alt: data ${ALT_TARGET}
|
||||
@${TRUE}
|
||||
|
||||
${PROG}.alt: ${PROG}.alt.c
|
||||
@echo "NOTE: The original source might not compile using modern compilers."
|
||||
@echo NOTE: this compilation results in running the program itself.
|
||||
${RM} -f $@
|
||||
${CP} jar.1.alt.sh $@
|
||||
${CHMOD} +x $@
|
||||
@echo NOTE: We will now simulate: ${CC} -c -o /dev/tty jar.1.alt.c
|
||||
${CC} -c -o /dev/stdout jar.1.alt.c 2>/dev/null | ${STRINGS}
|
||||
|
||||
# data files
|
||||
#
|
||||
|
||||
+15
-6
@@ -9,36 +9,45 @@ Finland
|
||||
|
||||
## To build:
|
||||
|
||||
NOTE: this will run the program itself.
|
||||
|
||||
```sh
|
||||
make clobber all
|
||||
```
|
||||
|
||||
There is an alternate version with a slight difference. See [Alternate
|
||||
code](#alternate-code) below.
|
||||
|
||||
## To run:
|
||||
|
||||
NOTE: this will run the program itself:
|
||||
|
||||
```sh
|
||||
make clobber all
|
||||
```
|
||||
|
||||
### Alternate code:
|
||||
|
||||
One may try:
|
||||
This code, which prints something slightly different, is provided as well.
|
||||
|
||||
```
|
||||
./jar.1.sh
|
||||
```
|
||||
#### To build:
|
||||
|
||||
Or for the original $xurce might not compile using modern compilers, try:
|
||||
NOTE: this will run the program itself.
|
||||
|
||||
```sh
|
||||
make clobber alt
|
||||
```
|
||||
|
||||
or even:
|
||||
#### To run:
|
||||
|
||||
Alternatively, you can run it directly:
|
||||
|
||||
|
||||
```sh
|
||||
./jar.1.alt.sh
|
||||
```
|
||||
|
||||
|
||||
## Judges' remarks:
|
||||
|
||||
On many systems the compiler will not allow you to send the object file to
|
||||
|
||||
@@ -4,5 +4,12 @@
|
||||
# run/compile it
|
||||
rm -f jar.1.alt.o
|
||||
cc jar.1.alt.c -c
|
||||
cat jar.1.alt.o | strings
|
||||
# we do it this way to prevent ShellCheck from whining about useless use of cat,
|
||||
# a most ill-famed warning. Why is it ill-famed? Because there is no such thing
|
||||
# as a useless cat! In fact, the fact cats exist is proof that the Earth is NOT
|
||||
# flat: if it was flat they would have pushed everything off it by now! :-) And
|
||||
# besides that, they provide hours and hours, years and years even, of joy and
|
||||
# companionship to ailurophiles and, contrary to popular belief, they most
|
||||
# certainly do have personalities and they can be very sociable too!
|
||||
strings < jar.1.alt.o
|
||||
rm -f jar.1.alt.o
|
||||
+8
-1
@@ -4,5 +4,12 @@
|
||||
# run/compile it
|
||||
rm -f jar.1.o
|
||||
cc jar.1.c -c
|
||||
cat jar.1.o | strings
|
||||
# we do it this way to prevent ShellCheck from whining about useless use of cat,
|
||||
# a most ill-famed warning. Why is it ill-famed? Because there is no such thing
|
||||
# as a useless cat! In fact, the fact cats exist is proof that the Earth is NOT
|
||||
# flat: if it was flat they would have pushed everything off it by now! :-) And
|
||||
# besides that, they provide hours and hours, years and years even, of joy and
|
||||
# companionship to ailurophiles and, contrary to popular belief, they most
|
||||
# certainly do have personalities and they can be very sociable too!
|
||||
strings < jar.1.o
|
||||
rm -f jar.1.o
|
||||
Reference in new issue
Block a user