NOTE: Click the weird, feather-thingy, coloured-orange, on the top-left of the page to go back.
An alternative to Makefile.
Usage is easy. The syntax of Bake is easy too. Make a file, case-sensitive, titled 'Bakefile' and in it, add two functions:
!main{}
!serve{}
In the Main function, you can define commands like this:
!main{
>echo 'hello world';
}
!serve{
>echo 'goodbye world';
}
Indentation does not matter. Placement of curly braces does. For example:
Will not execute.
!main{>echo 'hi';}
But,
Will execute.
!main{
>echo 'hi';
}
Bake uses your default shell. So you can use any shell commands from your specific shell. Using Fish? Use Fish commands. Using Batch? Go ahead! But remember:
Bake does not execute them as an external script, so:
For Batch is useless, as it runs the commands live.
@echo off
Variables are easy to declare. And string variables also do not need to be declared inside of single/double quotes.
There is no concept of constants, by the way. Anyway, here's how you can declare
variables:
Cool, right? The value inside the squared braces is the variable.
MyStr: [a string];
MyVar: [69];
You can access these variables like this:
src: [src/main.c src/file2.cpp];
cxx: [g++];
out: [output_file];
hello: [hello];
world: [world];
!main{
>[cxx] -o [out] [src];
>echo [hello];
}
!serve{
>echo [world];
}
And the output would be:
hello
world
And the output file will also be generated (if main.c and file2.cpp) contain genuine modules that are executed when the output is run.