First cookbook example for the docs: Hello World in C.

This commit is contained in:
Avery Pennarun 2018-11-24 14:36:02 -05:00
commit d663c9b67d
10 changed files with 216 additions and 2 deletions

View file

@ -0,0 +1,16 @@
# If hello.c changes, this script needs to be
# re-run.
redo-ifchange hello.c
# Compile hello.c into the 'hello' binary.
#
# $3 is the redo variable that represents the
# output filename. We want to build a file
# called "hello", but if we write that directly,
# then an interruption could result in a
# partially-written file. Instead, write it to
# $3, and redo will move our output into its
# final location, only if this script completes
# successfully.
#
cc -o $3 hello.c -Wall