Add 1988/spinellis/spinellis.alt.c for clang
This was fun to do even though it's also a very simple one liner plus
special handling in the Makefile (the latter part is so you can use it
the exact same way as the original). The original code just #included
/dev/tty. This does something just as magical! It can be used like:
make alt
# some C code
^D
./spinellis
For instance:
make alt
#include <stdio.h>
int main() { puts("hello world"); }
^D
./spinellis
Now those with clang can enjoy the entry without any functional
difference.
I have a very twisted point to make about the original version and this
version too: with a very slight change one can actually make a C++
version. Ick! :-)
This commit is contained in:
1 parent
ee249da4ea
commit
6e206fc25a
4 files changed
+36
-14
No files matched your search
@@ -111,8 +111,8 @@ OBJ= ${PROG}.o
|
||||
DATA= spinellis.data
|
||||
TARGET= ${PROG}
|
||||
#
|
||||
ALT_OBJ=
|
||||
ALT_TARGET=
|
||||
ALT_OBJ= ${PROG}.alt.o
|
||||
ALT_TARGET= ${PROG}.alt
|
||||
|
||||
|
||||
#################
|
||||
@@ -135,6 +135,10 @@ ${PROG}: ${PROG}.c
|
||||
alt: data ${ALT_TARGET}
|
||||
@${TRUE}
|
||||
|
||||
${PROG}.alt: ${PROG}.alt.c
|
||||
${CC} ${CFLAGS} -Wno-implicit-function-declaration $< -o $@ ${LIBS}
|
||||
@while read -r r; do echo $$r ; done | ./${PROG}.alt
|
||||
|
||||
# data files
|
||||
#
|
||||
data: ${DATA}
|
||||
|
||||
Reference in new issue
Block a user