54 Commits
Author SHA1 Message Date
Cody Boone Ferguson 8eca5d216d Correct comment in Makefiles for CUNKNOWN
It is actually used to silence the unknown warning option, not unknown
warnings.
2024-09-25 09:32:00 -07:00
Landon Curt Noll 96e0f2b966 move some rules into 1337.mk
A number of rules have been moved from entry `Makefile`s into the
`1337.mk` include file to make it easier for these common rules to be
updated or modified globally (by modifying the `1337.mk` include file).

The entry level `Makefile`s are now similar in form to the
/Makefile.example](https://github.com/ioccc-src/mkiocccentry/blob/master/Makefile.example)
file from the other repo.

The following make rules were moved into the `1337.mk` include file:

- `make indent.c`
- `make install`
- `make diff_orig_prog`
- `make diff_prog_orig`
- `make diff_alt_prog`
- `make diff_prog_alt`

This simplifies the entry level `Makefile`s so that they mostly reflect
the specifics of the particular entry.

Mentioned in FAQ 4.2, that the make diff rules are in the `1337.mk` include file.

Fixed invalid TAB character in `faq.md`.

Removed `make clean` directives that removed `indent.c`.  This file is now
removed via `make indent_clean`, a clean rule that also removes `indent.c`.

Removed `make clobber` directives that removed sandwich,  This file is now
removed via `make indent_clobber`, a clean rule that also removes `sandwich`.

Added `make indent_clean` and `make indent_clobber` rules into the top level
`Makefile` and the year level `YYYY/Makefile`.

Performed `make quick_www` to accomplish the above and to test under macOS.
2024-08-21 23:42:28 -07:00
Landon Curt Noll dbf6921b3a use include 1337.mk to hold 1337 hacker rulz
Updated 1337 hacker rulz to version 7.

Added `1337.mk` to contain the updated 1337 hacker rulz (v7).

We use an optional include of `1337.mk` (or `../1337.mk`,
or `../../1337.mk`) to include the 1337 hacker rulz.

Changed `make deep_magic` to `make more_magic`.

Changed `bin/tar-entry.sh` VERSION from "1.3.7 2024-07-22"
to "1.3.8 2024-07-23".

Changed `bin/tar-year.sh` VERSION from "1.2.5 2024-07-22"
to "1.2.6 2024-07-23".

Add `make new_entry` to `YYYY/Makefile` and `template/Makefile.year`.

Change `make new_year` to use `sort -n -u`.

Made minor debug message fixes to `bin/new-year.sh`.

Changed `bin/new-year.sh` VERSION from "1.3 2024-07-23"
to "1.3.1 2024-07-23".

Improved `bin/add-dir.sh` to update `YYYY/Makefile` with
the new entry directory name.

Changed `bin/add-dir.sh` VERSION from "1.0 2024-07-21"
to "1.1 2024-07-23".

Performed `make www` to accomplish the above and to test under macOS.
2024-07-23 22:45:16 -07:00
Landon Curt Noll 50a2a6293c add CUNKNOWN make variables to entry Makefiles 2024-06-30 21:29:27 -07:00
Landon Curt Noll 6ab0485404 improve Makefile warning formatting in 2001/anonymous 2024-03-20 14:04:37 -07:00
Landon Curt Noll e9808ca45d silence compiler warnings for macOS
After silencing compiler warnings for RHEL 9 Linux,
we silence the result on macOS for
Apple clang version 15.0.0 (clang-1500.3.9.4).
2024-03-13 00:38:46 -07:00
Landon Curt Noll 61172e5f88 silence compiler warnings for RHEL 9 Linux
We updated ${CSILENCE} Makefile variables for entries in an attempt to
minimize compiler warnings.  This was tested using
gcc version 11.4.1 20230605 (Red Hat 11.4.1-2) (GCC).

TODO: Recheck macOS clang to see if any new warnings have occur
      under macOS clang.
2024-03-12 23:35:24 -07:00
Landon Curt Noll 2b92c89be8 fix and improve links within the web site
Entry source is now prog.c for IOCCC years 2014 thru 2020,
or is now dirname.c IOCCC years 1984 thru 2013.

To achieve this state, we renamed the following:

renamed:    2004/hibachi/src/hibachi.c -> 2004/hibachi/hibachi.c
renamed:    2012/omoikane/nyaruko.alt.c -> 2012/omoikane/omoikane.alt.c
renamed:    2012/omoikane/nyaruko.alt2.c -> 2012/omoikane/omoikane.alt2.c
renamed:    2012/omoikane/nyaruko.c -> 2012/omoikane/omoikane.c
renamed:    2012/omoikane/nyaruko.orig.c -> 2012/omoikane/omoikane.orig.c

Modified `bin/subst.entry-index.sh` to add to entry `index.html` file,
links to the `Makefile` and the _C code_ to the top navigation bar.
Changed `bin/subst.entry-index.sh` VERSION from "1.2.2 2024-02-25"
to "1.3 2024-03-02".

Moved printing the Inventory link in the top navigation bar
from `bin/subst.entry-navbar.awk` to `bin/subst.entry-index.sh`.
Changed `bin/subst.entry-navbar.awk` VERSION from "1.0.1 2024-02-23"
to "1.1 2024-03-02".

Moved printing the Inventory link in the top navigation bar
from `bin/subst.year-navbar.awk` to `bin/subst.year-index.sh`.
Changed `bin/subst.year-index.sh` VERSION from "1.0 2024-02-11"
to "1.1 2024-03-02".
Changed `bin/subst.year-navbar.awk` VERSION from "1.0 2024-02-11"
to "1.1 2024-03-02".

Added location names (both default and common) to `author.html`.
Changed `tmp/gen_author_json.sh` VERSION from "1.0 2023-06-06"
to "1.1 2024-03-04".

Added location names (both default and common) to `author.html`.
Changed `bin/gen-authors.sh` VERSION from "1.2 2024-03-09"
to "1.3 2024-03-04".

The manifest and the resulting `.entry.json` files have been changed
for `2004/hibachi` and `2012/omoikane`.

The Makefiles for  `2004/hibachi` and `2012/omoikane` copy the
source file into the "previously used location".  The `make clobber`
rule removes the copied source.  The `.gitignore` files have been
updated accordingly.

Improved how the concept of IOCCC terms _entry_, _author_ and _submission_ are
used in markdown files.

Links to markdown files (files ending in .md) within the repo were
changed to link to HTML files (files ending in .html).  Special cases
where `README.md` became `index.html` were modified accordingly.

Fixed URL for `bugs.html` in Makefile comments.

Fixed name of `bin/sgi.sh` referenced in comments in `.gitignore` files.

Links to locations within the repo are now relative.  For example a
link to `/contact.html` may become `../contact.html' or '../../contact.html`
depending on the directory level of the markdown file.

Nearly all links with absolute URLs under _https://www.ioccc.org_
or `https://ioccc-src.github.io/temp-test-ioccc_ have been changed to
relative paths within the repo.  Some exceptions to this (such as
referring to a GitHub repo) were preserved.

Fixed a number of inside `faq.md` and `bugs.md`.

Added HTML name tags (in the form of an _entry_id_) for each entry
referenced in `bugs.md`.  Fixed links from outside of `bugs.html`
into `bugs.html` accordingly.

Where FAQ entries are referenced, a named tag is used so that if a
FAQ is ever renumbered, links outside of `faq.html` will still work.

Changed the _inventory_order_ of a compressed tarball from _300_
to _100000_.  While this may have been done for the manifest,
this changed had not yet been propagated into the `.entry.json` files.

Links to web sites that were in the for <URL> are now [URL](URL).

Performed `name www` to process all of the above.

Improved format of `authors.html`.  Full names are now bold.
Location codes are now links back into `location.html` and
location names (both default and common) are now italics.
Added _author_handle_ each author.

Changed `bin/gen-authors.sh` VERSION from "1.1 2024-02-25"
to "1.2 2024-03-09".

Improved format of `location.html` as location codes are now bold,
author counts in a given location are now bold, and location names
(both default and common) are now italics.

Changed `bin/gen-location.sh` VERSION from "1.0.1 2024-02-23"
to "1.1 2024-03-04".

Added italic location name after location code in entry
`index.html` files.

Changed `bin/output-index-author.sh` VERSION from "1.4.1 2024-02-23"
to "1.5 2024-03-04".

Added _Location of authors_ to the sidebar as a link to `location.html`.

TODO: While nearly all of the above mentioned changes are likely correct,
      they likely introduced a few errors that need correcting.
2024-03-04 23:45:28 -08:00
Cody Boone Ferguson 205fa25ced Change references of many terms to new names
This is a HUGE commit and this task is not done. There are still some
changes that might need to be discussed and since so much is done here I
think it's better to let this go through and then make sure everything
is okay. When the remaining references are discussed they can also be
changed.

I did NOT include changes in the tmp/OLD_manifest directory.

Some of the changes in this commit (it might be exhaustive but it might
not be - not sure):

- In the Makefiles the WINNERS was renamed AUTHORS.
- References to winners.html were changed to authors.html.
- The FAQ named anchor 'fix_a_winner' was renamed 'fix_an_entry'.
- The JSON fields (or whatever they're called) 'winner_id' and
'winner_JSON_format_version' were changed so that 'winner' is 'entry'.
- In scripts for entries 'IOCCC winner' was changed to 'IOCCC entry'.
- 'winners_text' is now 'entries_text'. It might be better to be
'entry_text' as it's per entry but this was not noticed at first. Since
this is easy to fix I am holding off on this for the meantime.
- The script tmp/update-manifest.sh now has the commit log messages
changed to the correct terms as well.

The index.html files were updated as well with any of the above
changes.

There are some references that should NOT be updated. Two examples
caught (and maybe more have slipped through that will have to be changed
back): in 1984/anonymous/README.md the author wrote back to Landon after
being told about the famous tattoo and they used the words:

    .. my entry will be the first IOCCC winner ..

but since this comes from the author it should remain so.

The other one is that winners.html should still refer to winners.html as
it informs people that it's been moved to authors.html (it does redirect
too but even so if it was changed it would defeat the purpose of the
message).

With paths like authors.html I tried to copy paste so that hopefully
there are no typos. It is possible that I did not end up doing this with
all but these can be fixed when discovered.
2024-02-13 07:31:36 -08:00
Cody Boone Ferguson 72b2a42a89 Fix how 2001/anonymous alt code is built
The 64-bit code binaries have been renamed to .alt: anonymous.ten.alt
and anonymous.bed.alt. This is because it's theoretically possible that
they are not compiled as 64-bit binaries (though how this might be I
cannot think of at this time) and in any case they are alt builds
(though they use the same source).

In the case the -m32 fails (whether due to compiler[0] or no access to
32-bit binary compilation) make alt will be used with warnings that the
entry cannot work with them. The reason these are built as .alt and not
the original is to be clearer whereas in other cases (like
1985/sicherman) the point was just a backup plan in case a compiler
objects to it. Here they must be compiled as 32-bit ELF binaries (though
we cannot check if they are ELF - at least not easily and in an entirely
portable way - we can at least determine if they compiled as 32-bit) so
the alt builds are set to be .alt in filenames.

The try.sh script has been updated for this and in the case. However
this file needs to be looked at again and will be later. The purpose of
this commit was to resolve another issue that is in the todo file (this
is not yet done and might or might not be done later today).
2024-01-08 05:23:33 -08:00
Cody Boone Ferguson 801f3fe90c Add missing comment in all Makefiles
The comment for the rule diff_alt_orig was missing. It was added like:

    sgit -e '/diff_alt_orig:/i \
    # diff alt and orig' '*Makefile'
2023-12-26 09:00:03 -08:00
Cody Boone Ferguson a673c74b92 Restore optimiser in 2001/anonymous 2023-12-19 09:16:56 -08:00
Landon Curt Noll 1e1f962c30 add to make clobber, removal of *.dSYM 2023-12-05 02:22:49 -08:00
Cody Boone Ferguson 30c59761df Mass fix Makefiles: $(MAKE) -> ${MAKE} 2023-11-19 06:31:28 -08:00
Cody Boone Ferguson bc35c37748 Improve how gcc/clang is detected in Makefiles
Rather than check if $(CC) IS gcc or IS clang check for $(CC) containing
gcc or clang. This is because in some systems or conditions the compiler
might not be called JUST gcc or JUST clang. For instance gcc in MacPorts
is called gcc-mp-13 (for example) but without this change one would have
to symlink gcc to gcc-mp-13 or copy it to gcc.

The FAQ has been updated to address this.
2023-11-18 06:10:02 -08:00
Cody Boone Ferguson 6aae9da0d2 Format/typo check 2001/anonymous
README.md file format/typo checked.

Updated warnings in Makefile as well.

I believe this completes the review of 2001/anonymous.
2023-11-16 10:58:54 -08:00
Cody Boone Ferguson 5041a0d592 Typo fix in all entry Makefiles
Change the comment

    # Special flags for this entry

to

    # Special Makefile variables for this entry

because these are actually variables and not flags.
2023-11-01 03:36:29 -07:00
Landon Curt Noll 00c9d60266 improve diff files
We now have 6 diff rules:

    diff_orig_prog
    diff_prog_orig
    diff_alt_prog
    diff_prog_alt
    diff_orig_alt
    diff_alt_orig

The FAQ for these diffs needs to be updated
as we have 6 types of diffs now.
2023-10-23 10:18:20 -07:00
Landon Curt Noll 71f1463547 Rename diff Makefile commands
Renamed these Makefile rules:

    orig_prog_diff ==> diff_orig_prog
    alt_prog_diff ==> diff_alt_prog

Updated thanks-for-fixes.md and faq.md accordingly.
2023-10-22 17:26:22 -07:00
Landon Curt Noll 8471e805ed add orig_prog_diff and alt_prog_diff rules to Makefiles 2023-10-18 17:00:02 -07:00
Cody Boone Ferguson 0942f4e6b2 Mass typo fix in Makefiles
There was a comment in the form of:

    ... the liked/allowed ...

which should instead be:

    ... liked/allowed ...

and this was fixed with my sgit tool like:

    sgit -e 's,the \(liked/allowed or compile\),\1,g' '*Makefile'
2023-10-16 10:35:34 -07:00
Cody Boone Ferguson ffdf581218 Mass typo fix in Makefiles
With the make indent rule there was a typo for indent as 'intent'. This
was fixed with my sgit tool like:

    sgit -e 's/no intent\( tool found\)/no indent\1/g' '*Makefile'
2023-10-15 12:18:34 -07:00
Cody Boone Ferguson bbb3d42bc2 Fixes and updates to 2001/anonymous
The alt target list now includes the supplementary program I added.

There were some problems fixed in the README.md file that occurred when
the (far superior) thanks-for-fixes.md file was introduced.

The thanks file was updated as well.
2023-10-12 08:48:47 -07:00
Cody Boone Ferguson ef456bfb1e Mass typo fixes
This is a HUGE commit:

    417 files changed, 874 insertions(+), 874 deletions(-)

As the IOCCC website now is https enabled I have updated the
'http://www.ioccc' to 'https://www.ioccc'.

There was also a typo in Makefiles where it said 'for VERY WELCOME' when
it should be 'are VERY WELCOME'.

Finally slashdot.org is also https enabled so references to
'http://slashdot' were changed to 'https://slashdot'.

This was done by my sgit tool (see https://github.com/xexyl/sgit)
like:

    sgit -e 's,http://www.ioccc,https://www.ioccc,g' -e 's/for VERY WELCOME/are VERY WELCOME/g' -e  .

but because I didn't have a list of files that should be modified I had
to be careful which files to commit as I had files that were changed but
not ready to be committed. Since I did it in steps, finding typos as I
went along, I actually ran sgit three times but to simplify the above
(and to show that it's possible to do more than one sed command) I made
it all as one. Since I did not have a list of files ahead of time I had
to determine what files to commit, first going through them like:

    for j in $(for i in $(git status|grep modified|cut -d: -f2); do \
	git grep 'https://www.ioccc' "$i"; done|cut -d: -f1|sort|uniq); \
	do git diff "$j"; done|less -r

(I had to pipe through less because of a strange problem with the git
diff which appears to be because of a terminal problem maybe due to the
command above but it was all I could come up with in a very tired head.)

The above and

    git status | grep modified:

showed that some C files had been modified which obviously should not be
done so I had to do:

    git co '*c'

to undo those changes.

Finally to commit the correct files I did:

    for i in $(git status|grep modified|cut -d: -f2); do \
	git grep -E 'https://www.ioccc|https://slashdot|are VERY WELCOME' "$i"; \
	done |cut -d: -f1|sort|uniq|xargs git commit -v

or so (with any formatting issues or typos here due to typos in the log
due to the terminal (in)sanity issue described).
2023-10-07 04:35:47 -07:00
Cody Boone Ferguson 1d86daf19a Change LIBS to LDFLAGS in Makefiles
This is to make it more standard which further allows one to run make on
some other source code, say because they want to try and fix an entry
but forget to update the Makefile. Or if they're the author they can not
worry about it in some cases. But since LDFLAGS is the standard way it
seems better to have the LIBS variable in the Makefile be LDFLAGS.

Maybe there is a reason to not have this and I'm happy to close this in
that case but it does seem better this way so I'm doing this commit.
2023-07-10 03:33:53 -07:00
Cody Boone Ferguson b6330673cc Restore silencing warnings in macOS
As besides the entries that are not supposed to compile/cannot compile
due to architectural limitations all the entries can compile in macOS
(though some do not work - yet(? I have plans to work on more later)) it
was not necessary to not silence the warnings after all as the entries
that don't work will be easy to identify ('they don't work' :-) ) so I
can just do make CSILENCE= all in the directory of those entries which
solves the problem I had originally thought of.

Some of the Makefiles have retained other changes I had to make
yesterday to get the entries to work with clang in linux but most of
them were either not changed or were made better with the rollback of
the commit that originally silenced warnings.

Now work on silencing warnings for linux can be done.
2023-07-08 05:05:50 -07:00
Landon Curt Noll 2aa99f0644 revert commit d8425bb767 2023-07-07 05:36:08 -07:00
Landon Curt Noll d8425bb767 silence warnings under macOS for cc, clang and gcc
Used the following script to check for warnings
not silenced via ${CSILENCE}:

```sh
find ???? -mindepth 1 -maxdepth 1 -type d | while read dir; do
(cd "$dir"; echo =-=-= "$dir" =-=-= ; csilence -v 1 clobber all ; echo ; csilence -v 1 clobber alt)
done 2>&1 | less
```
2023-07-07 01:11:22 -07:00
Cody Boone Ferguson 93684cfc19 Add another program for 2001/anonymous
This sings a different counting song, Ten in the Bed. It uses another C
feature (a char *[]) that the Ten Green Bottles does not use. This is
for fun as well as to show another program (with a different C feature)
that the program works on, again assuming -m32 is allowed.

Instead of using numbers it uses strings (as expected with a char *[])
in the singing.

This was for fun (and to see if the program would work on arrays) after
I remembered the song in a comment on GitHub - about the Ten Green
Bottles song.
2023-05-21 09:09:54 -07:00
Cody Boone Ferguson d47b9d50ef Add alt supplementary program to 2001/anonymous
Running make alt will compile the anonymous.ten.c without specifying
-m32: whether it'll end up being 64-bit or not would depend on the
system but it'll be saved as anonymous.ten.64 anyway.

The try.me.sh script will run this program directly, skipping the entry
itself, if the anonymous.ten.c cannot be compiled as a 32-bit binary.

Updated .gitignore.
2023-05-21 04:17:30 -07:00
Cody Boone Ferguson 107982e8c3 Remove cpp from 2001/anonymous/Makefile TARGET
This is important so that make does not fail. Apparently I had a copy of
cpp.c still in my directory so this was not detected.
2023-05-19 12:14:45 -07:00
Cody Boone Ferguson 2159caec46 Actually fix 2001/anonymous to run target program
I can now report happily that the program works as it was thought to -
both modify the binary and run it. A problem was that it used to call
main() infinitely (seemingly) call main() recursively but this was
causing a problem. It had to be (as I did some while back) moved to a
new function which is not recursive. My guess is that in the past it was
okay due to exit() but I don't know if this is true or not. So what
could be done?

We have to make sure we have BOTH the file descriptor AND the mmap()d
memory close()d and munmap()d as otherwise we would get a text file busy
error. Then we simply call execv() again. I didn't change it so that the
earlier call to execv() is no longer called because I didn't want to
break anything even though at that point M is actually empty.

The astute programmer would observe that the execv() call is slightly
different: don't use M as the path but rather k[1]. Why? Because
initially M is empty but after the function is called it ends up being
something like '.anonymous.ten134517173' but this file never exists. If
you observe even no file is created (or so it seems) as only cpp is
used, not cc (I'm not actually clear what the purpose of that is). The
mmap() call is important of course as is the open() call as one of the
parameters of mmap().

Is this a workaround? Perhaps in a way but it's the only way it'll work
that I can think of as munmap() and close() must be called lest we get a
text file busy error and only then can we call execv().

Removed cpp.c and cpp make rule.
2023-05-19 07:07:44 -07:00
Cody Boone Ferguson 31fef7fa43 Update 2001/anonymous - cpp, 32-bit ELF ten.c etc.
Add back cpp.c which is a C pre-processed version of anonymous.c. Added
comments and tried to format it some. Perhaps I should use a formatted /
de-obfuscator from some years ago in the IOCCC (by Dave Burton) but I
didn't think of that until much later on: I'll consider it another time.

The Makefile builds cpp by default. Works as well as anonymous.c: will
modify 32-bit ELF binaries in the right systems (it won't touch them in
macOS - I pre-compiled anonymous.ten.c as 32-bit ELF in linux and added
it to the repo as anonymous.ten.32 mostly for those who might be able to
run 32-bit ELF binaries but have no way to compile them though maybe no
system has that but it also allows for partly 'testing' the program in
macOS).

Change main target to compile to anonymous and not anonymous_tmp. This
is because otherwise running make would repeatedly try and build it. I
did try changing the target but that didn't want to work possibly due to
the cp updating the timestamp though that's a quick thought in the head
of someone who's been awake too long at the hour.

Instead anonymous.sh is the script to run to 'emulate' the running of
the target program (again assuming that's correct which does seem likely
but is still unconfirmed).

The anonymous.sh script now checks for compiling anonymous.ten.c but
uses anonymous.ten.32 as a backup if it exists.

Update bugs.md and README.md.

Anything else I'm afraid I've forgotten.
2023-05-19 04:12:33 -07:00
Cody Boone Ferguson 23143234a6 Add temporary workaround to 2001/anonymous
Using a script running ./anonymous will run the program after modifying
it. This is a temporary workaround and it's not certain when this will
be changed back or fixed if it even can be. I am aware of some things
that might make it work IF it actually IS supposed to run the program
that it's run on (an additional reading of README.md suggests this might
indeed be the case). In any event the entry DOES modify 32-bit binaries
(bit twiddling) and then running the script (made a copy of
anonymous.sh where anonymous.c is compiled to anonymous_tmp) it will run
the program after doing this, assuming that the program to modify
actually exists.

It should be noted that because things have changed so much it is hard
to know if the modifications to 32-bit ELF binaries are correct but if
nothing else the binary will not crash on 32-bit ELF binaries and it
will modify it but still let it run (though from the author's comments
this might not be possible; this cannot yet be confirmed). Leo it
appears wrote the judges' comments so I will try and get more
information from him later on.
2023-05-18 04:38:47 -07:00
Cody Boone Ferguson 0e3acd6739 sgit -e 's/[[:space:]]$//g' '*Makefile'
At the request of Landon all Makefiles have had trailing spaces removed.
The request also included README.md files but this is more complicated
as some lines have to end in spaces in order to force line breaks. For
Makefiles it's fine though. Tested the Makefiles by doing 'make clobber
all everything' from the root directory and all appears to be fine. This
testing is important because depending on how this process (removal of
trailing spaces) was done it could break the Makefiles; for instance
trying something like:

    sgit -e 's/\s.*$//g' '*Makefile'

would rather break the Makefiles. This makes sense to anyone who knows
my script (and obviously sed :-) ) as long as they're not also tired but
I AM tired and so it was the first thing I tried (without thinking of
course ... though I had first thought of the correct way :-) ).

But what happens to the universes (yes I at least want to believe in the
multiverse theory and I hope it's true :-) ) when trailing spaces are
removed? :-)

As it turns out the only Makefiles touched were:

	modified:   1987/wall/Makefile
	modified:   1992/adrian/Makefile
	modified:   1994/ldb/Makefile
	modified:   2000/anderson/Makefile
	modified:   2001/anonymous/Makefile
	modified:   2001/bellard/Makefile
	modified:   2004/kopczynski/Makefile
	modified:   2015/howe/spoiler/Makefile
	modified:   2019/karns/Makefile

and most of them were my fault.
2023-05-11 02:28:26 -07:00
Cody Boone Ferguson 9990fe2abd Track down required changes in 2001/anonymous
In order to know what had to change exactly I tested this out (though
it's possible I forgot to initially document changes and so I did not
test everything) and I have documented it in the README.md. The required
changes:

- remove infinite recursion from main(): move the body of main() to
another function.

- add #include <sys/mman.h> for mmap().

Without either this did not work. I also changed (in case of
non-standardised constants) '3' in the call to mmap() to be
PROT_READ|PROT_WRITE but this appears to not be strictly required.

I added the script try.me.sh which has more commands than the previous
try section to show how it works and what changes etc.

Updated .gitignore as the above script creates some.

Make make all attempt to compile anonymous.ten.c: it's an important part
of the program though it can work on other 32-bit ELF binaries.

Update bugs.md explaining why this won't work with macOS.
2023-05-02 03:11:18 -07:00
Cody Boone Ferguson efdee208a2 Fix 2001/anonymous - it now works!
This was a fun one to figure out. There were a few steps. Amongst them
was adding the include for mmap(). Another part that might or might not
be relevant was having main() call a new function rather than main()
itself. This seemingly solved an infinite recursion call to main()
(according to gcc).

I changed the third arg in the call to mmap() to be
PROT_READ|PROT_WRITE. This might not have been necessary as it might
evaluate to 3 which is what it was.

I regret that some macros were removed and some formatting was changed.
This was not intentional but I want to get the fix in and then I can fix
the formatting and macros (or try to - some of it might or might not
cause a problem).

Note that it will crash on any binary that's not 32-bit/x86. In other
words this won't work in macOS unless you have an old enough Mac that
supports 32-bit binaries. With gcc (which is clang in macOS so that
won't work either) one can do -m32 and that's what is done for
anonymous.ten. It probably should be built by default but it's currently
not.
2023-04-21 08:36:21 -07:00
Cody Boone Ferguson bb7736cb2b Update 2001/anonymous/Makefile - add cpp rule
This compiles the C pre-processed version as it seems like this will be
useful to any person crazy (by which I mean bold) enough to try and fix
it (and I give much respect to them!).

It is compiled by make all: maybe this is a mistake but it seems like
it's going to be useful if anyone is to fix it. This part can be undone
of course.
2023-04-21 05:58:13 -07:00
Cody Boone Ferguson 56a0711630 2001/anonymous updates
Format fix in README.md.

Add cpp.c which is the C pre-processed version cleaned up and somewhat
commented as it heavily (ab)uses the ternary operator and recursion.
Probably futile but it gave me something to do even if it was a waste of
time (could have worked on other README.md files or a host of other
things). This did indeed take a long time and a lot of effort!

Updated bugs.md with more hints about this entry. I explained here how I
came up with the C pre-processed version as it involves something of a
hack because of the complicated build instructions.

Updated anonymous.ten.c: #include <stdio.h>

Added anonymous.ten rule to Makefile.

Also disabled optimising level as the author stated that this makes it
slower.

I observed that the author is anonymous and yet the author information
shows the country. I'm not sure if this is intended or not.
2023-04-21 05:46:10 -07:00
Cody Boone Ferguson e09f677b37 Mass typo fix (all README.md and Makefiles)
As in

    sgit -e 's/the terms this license/the terms of this license/g' '*/Makefile' '*/README.md'
2023-04-02 09:27:13 -07:00
Landon Curt Noll 350da723cc improve architecture and Optimization comments in Makefiles 2023-03-26 22:13:13 -07:00
Landon Curt Noll 1c35dc3b47 make everything true :-)
Add @${TRUE} as an action for the everything rule in Makefiles.
2023-03-26 20:47:04 -07:00
Landon Curt Noll e42d7484cd trim comments and update 133t hacker rulz in Makefiles 2023-03-26 20:24:16 -07:00
Landon Curt Noll 8cd2aa85c1 clean up and improve end of Makefile rules 2023-03-26 02:02:31 -07:00
Landon Curt Noll d04e6d8f03 remove X11_LIBDIR and X11_INCDIR setting from Makefiles
The X11_LIBDIR and X11_INCDIR values are now set in the
top level `var.mk` file.
2023-03-26 00:50:47 -07:00
Landon Curt Noll bbd18a20df improve Makefile headers
Simply the Makefile header.

Refer to the //www.ioccc.org/bugs.md URL (that will eventually exist).

Now using CC BY-SA 4.0 License to how you may share and adapt the
Makefile.
2023-03-25 23:51:14 -07:00
Cody Boone Ferguson c486290171 Fixes to 2001/anonymous
This unfortunately does not include making this work in modern systems.
I have used the cpp and I have had some ideas but I don't have a system
where I can test any fixes so it's probably not going to be done by me.

Nevertheless I have fixed the formatting of README.md, noted that it
doesn't seem to work (Yusuke Endoh came to the same conclusion) and also
fixed a typo in anonymous.ten.c (which 'sings' the wonderful English
counting song Ten Green Bottles .. or at least the theory is it's
English).

This entry has been added to the bugs.md file and I have provided a
number of hints that might (or then again might not) help for anyone who
is brave enough to try fixing it.

As far as the change to anonymous.c itself: I simply added some #includes
for functions that are used.
2023-03-22 11:24:04 -07:00
Landon Curt Noll 93aa8d79f2 fix Makefile and README.md for 2001/anonymous
Attempt to address the problem of main type and args.
2023-03-17 14:36:23 -07:00
Landon Curt Noll f615bba21e undo intermediate Makefile changes of 1996 to 2020
The commit 00ae59cd47 had a
mistake that introduces changes to Makefiles for 1996 thru 2020
that should not have been included.

This change reverses these intermediate changes until
the given year's Makefiles are ready.
2023-02-26 23:31:00 -08:00
Landon Curt Noll 00ae59cd47 fix 1995 Makefile comment line 2023-02-26 21:52:15 -08:00