Make quine-text multiline string (#111)

This commit is contained in:
Casey Rodarmor 2016-11-13 14:33:41 -08:00 committed by GitHub
parent 1690da3e6b
commit de4a299899

View File

@ -92,12 +92,26 @@ quine: create
diff tmp/gen1.c tmp/gen2.c
@echo 'It was a quine!'
quine-text = 'int printf(const char*, ...); int main() { char *s = "int printf(const char*, ...); int main() { char *s = %c%s%c; printf(s, 34, s, 34); return 0; }"; printf(s, 34, s, 34); return 0; }'
quine-text = '
int printf(const char*, ...);
int main() {
char *s =
"int printf(const char*, ...);"
"int main() {"
" char *s = %c%s%c;"
" printf(s, 34, s, 34);"
" return 0;"
"}";
printf(s, 34, s, 34);
return 0;
}
'
# create our quine
create:
mkdir -p tmp
echo '{{quine-text}}' > tmp/gen0.c
@echo '{{quine-text}}' > tmp/gen0.c
# clean up
clean: