From faebe3def07e7b3eb432687b794d0ae486a12e39 Mon Sep 17 00:00:00 2001 From: Liam Waldron Date: Thu, 4 May 2023 11:34:37 -0400 Subject: [PATCH] add README --- README | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 README diff --git a/README b/README new file mode 100644 index 0000000..1f8e312 --- /dev/null +++ b/README @@ -0,0 +1,46 @@ ++ emk + +A build system, including a fast embedded scripting language. + ++ Installation + +Run 'make', followed by 'make install' + ++ How it works + +The first task to run is parsing and preprocessing, where emk will parse an emkfile +in the current working directory, include config.emk, and store variables in memory. + +emk will then run the modified emkfile through the interpreter. + ++ How to write an emkfile + +emk has a small collection of reserved words: +- include: instruct the preprocessor to include a file +- declare: declare a variable +- function: define a function (eg. build, install, etc) +- if, then, else, while, for, do +- echo: write to stdout + +An example of a good emkfile is shown below: + + include ./config.emk; + + declare PROGVER = "1.0"; + + function build { + echo "this function builds the program\n"; + } + + function install { + echo "this function installs the program\n"; + } + +Lines must end with either semicolons (;) or braces ({}) +Variables can be called by prefixing '$' to the variable name. Ex: + + declare MSG = "hi\n"; + + function build { + echo "$MSG"; + }