fix 1988/spinellis

Prevent the Makefile from hanging on stdin by
providing some sample input files and asking the
user to run the command themselves.
This commit is contained in:
Landon Curt Noll committed 2023-07-02 18:23:59 -07:00
1 parent 6dd2573efd
commit 95e41fa835
5 files changed
+40 -39

No files matched your search

+12 -33
View File
@@ -11,52 +11,31 @@ Mastodon: <https://mstdn.social/@DSpinellis>
make all
```
and then type a C program into followed by EOF (usually `^D`, ctrl-d).
An alternate version (also one-line) that will work with clang has been
provided. See the Alternate code section below for how to use.
## Try:
```sh
make clobber all
main()
{
printf("Hello world\n");
}
^D
./spinellis
make clobber all
int main()
{
int i;
for (i = 0; i < 5; ++i)
printf("%d\n", i);
}
^D
./spinellis
rm -f spinellis ; cc spinellis.c -o spinellis < input.txt && ./spinellis
```
NOTE: you need to make clobber first for this entry to work right.
and try:
```
rm -f spinellis ; cc spinellis.c -o spinellis < input2.txt && ./spinellis
```
## Alternate code:
For clang try the alt code like:
```sh
make clobber alt
#include <stdio.h>
main()
{
puts("Hello world\n");
}
^D
./spinellis
cc spinellis.alt.c -o spinellis.alt < input.txt && ./spinellis.alt
```
NOTE: you need to make clobber first for this entry to work right.
and try:
```
cc spinellis.alt.c -o spinellis.alt < input2.txt && ./spinellis.alt
```
## Judges' remarks: