Bake

NOTE: Click the weird, feather-thingy, coloured-orange, on the top-left of the page to go back.

An alternative to Makefile.

Usage

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:

!main{>echo 'hi';}
Will not execute.

But,

!main{
    >echo 'hi';
}
Will execute.

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:

@echo off
For Batch is useless, as it runs the commands live.

Variables

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:

MyStr: [a string];
MyVar: [69];
Cool, right? The value inside the squared braces is the variable.

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.