The use of `cindent(1)` and `indent(1)` by the IOCCC Judges
during final round processing has been deprecated in favor
of the `clang-format(1)` tool.
Removed rules in `1337.mk` related to `cindent(1)` and `indent(1)`.
Added `make clang-format` rule to `1337.mk`.
Added `${CLANG_FORMAT}` Makefile variable to `var.mk`.
Created `.clang-format` to hold the IOCCC style, a style that
is somewhat similar to the Linux Kernel style.
Regarding use of `temp-test-ioccc` in current repo files:
We will ignore files under `tmp/` as they are going away.
We will ignore files under `bin/` as they will have their default `REPO_URL` value changed during the later parts of the **Great Fork Merge**.
We will ignore `*.html` files as the above changes to `bin/` tool will also change them during the later parts of the **Great Fork Merge**.
We will ignore `sitemap.xml` as the it will change during the later parts of the **Great Fork Merge**.
So this leaves for our consideration the files printed by this command:
```sh
find * -type f ! -name '*.html' ! -name sitemap.xml ! -path 'tmp/*' ! -path 'bin/*' -print0 | xargs -0 grep -l 'temp-test-ioccc'
```
We see 5 (3 sir), 3 cases:
* README.md index.md
The reference to `temp-test-ioccc` will be removed when a given section goes away as part of the later parts of the **Great Fork Merge**.
Nothing needs to be dome here other than to add some **XXX** comments to help remind us of what needs to be done in later parts of the **Great Fork Merge**.
* bugs.md faq.md news.md var.mk
The use of `temp-test-ioccc` is outside of a blob.
Here `https://github.com/ioccc-src/temp-test-ioccc/` may be be replaced by `https://github.com/ioccc-src/winner/` in anticipation of the **Great Fork Merge**.
There is an exception: The historic discussion abouts the history of the `temp-test-ioccc` repo needs to retain their `https://github.com/ioccc-src/temp-test-ioccc/` strings in `faq.md` and `news.md`.
* 2005/sykes/README.md
The markdown links that start with `https://github.com/ioccc-src/temp-test-ioccc/blob/master/` should instead start with `%%REPO_URL%%/`.
After the **Great Fork Merge**, the `%%REPO_URL%%/` value will refer to `https://github.com/ioccc-src/winner/blob/master/` instead.
* 2020/ferguson1/snake.1
There is not a tool to "pre-process" cat pages like there is for markdown files: no should there be.
The cat page refers to a markdown file when instead it should refer to a HTML page.
In this case we suggest that `https://github.com/ioccc-src/temp-test-ioccc/blob/` be replaced by `https://www.isthe.com/`, and `.md` be replaced by `.html` in anticipation of what it will need to be after the **Great Fork Merge**.
* YYYY/entry_dir/*.sh
The shell scripts references by the above command are "helper shell scripts. Like man pages, there is no "pre-processor" for shell scripts, nor should there be.
Looking at these helper shell script files in detail:
```sh
find * -name '*.sh' ! -path 'tmp/*' ! -path 'bin/*' -print0 | xargs -0 grep 'temp-test-ioccc/blob/master'
```
We see that they all make references to `faq.md#something.`.
This is wrong in 2 ways:
0) They should not refer to the markdown file `faq.md` but rather to the HTML file `faq.html`.
1) They punctuate a literal string (with one exception) by adding a final period (".") to a string that requires somebody to copy and paste and exclude the final period (".").
Since these echo commands are suggesting that the user view something within the FAQ, we recommend that `echo "Tip: see https://github.com/ioccc-src/temp-test-ioccc/blob/master/faq.md#` be replaced by `echo "Tip: see https://www.ioccc.org/faq.html#` AND that the final period (".") be removed. Thus they too will anticipate what they will need to be after the **Great Fork Merge**.
This is not strictly necessary any more than some of the others but two
entries use this tool (at least since I added them back - they were
missing) and it seems better to have it this way.
Instead of writing the literal output of the binary to /dev/tty,
we simulate the output by silencing stderr and by piping the binary
thru strings.
The raw binary executable output to /dev/tty was capable "ill effects".
Such "ill effects" could be as mild as printing strange characters, to
beeping (sometimes for extended periods), and even the termination
of the terminal app window in some cases.
The "ill effects" from the printing of the raw binary executable
is highly dependent on the compiler, compiler version, libc, crt0.o,
operating system, terminal app and/or terminal driver. As such,
the "ill effects" that one user might see may be hard to reproduce
in order environments. While some of the more extreme "ill effects"
might be unlikely, what was more common was for the binary output
to be interpreted strangely by the terminal app and/or driver to
the extent that the was lost or not well seen by the user.
This change introduces the ${STRINGS} Makefile variable to the
`/var/mk` file and uses to to "clean out" any output that might
produce such "ill effects". Prior to the command, the echo does
clearly state:
```
NOTE: We will now simulate: cc -c -o /dev/tty jar.1.c
```
We also modify the `1989/jar.1/jar.1.sh` and `1989/jar.1/jar.1.alt.sh'
shell scripts to pipe raw binary through strings as well.
Thus the user can, if they wish, try the raw command themselves.
If that command does produce the more extreme examples of "ill
effects", the fault rests with the user. We mention that the
Makefile will echo the command to stdout in the `README.md`. But
that is as far as we go. We do **NOT RECOMMEND** having a shell
script or Makefile rule that would write the raw binary to `/dev/tty`
but rather let the immigration of the user try or not try it.
In general, the use piping raw binary thru stings makes the original
output more apparent, as was the case when using dumb CRT terminals
that couldn't even process ANSI escape sequences were more common.
Remove how to install SDL1 / SDL2 from var.mk as it's already in faq.md.
Instead refer to faq.md. How to compile (variables etc.) is still in the
var.mk file.
Reworded that section a bit and added 'Other linux distributions'
subsection to 'Linux' (in faq.md).
Minor typo fix in faq.md at the same time as the above change. Normally
I would not do this but it's one word changed and I am too tired at this
time (or can't be bothered?) to do another pull request for one word.
Add instructions on how to install SDL or SDL2 for macOS, Linux and
Debian for:
2005/jetro
2014/maffiodo1
2018/giles
Put variables and instructions into the top level `var.mk` file.
The problem was that SDL2 removed two functions that are used in this
code. Since SDL1 is still available and since changing it to SDL2 is
more complicated than it is worth I've decided to keep it as SDL1,
changing sdl2-config to sdl-config. Nevertheless it actually segfaults
or it does at least in macOS. I have not tested it in linux but I will
in time. At this point I will try debugging it but at least now it will
link.
Typo fixes in README.md and update the reference to SDL2 to be SDL1. I
noted that currently it does not work at least under macOS. I've not yet
put it in the bugs.md file but will in time if I don't get it to work
(again once I test it under linux).
As per a request on GitHub the LESSECHO variable has been removed from
all the Makefiles. It was only in the 2019 and 2020 Makefiles as well as
var.mk.