summaryrefslogtreecommitdiff
path: root/build.sh
blob: 938564fa7eafb6053925cd8ad640209ef237cf9b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/bash

MAKE=make

#
# Ensure that the build environment is sane
#
build_check() {
    if [ -z "${GLOBAL_BUILD_SOURCED}" ]
    then
        echo "fatal: Please run '. dev/build.env'"
        exit 1
    fi
}

#
# Build a directory
#
# $1:  Directory to build
# $2:  Subsystem name
#
build_dir() {
    pushd $1
        echo "[*] Building $2..."
        $MAKE
    popd
}

#
# Kick off the entire build proccess
#
build() {
    mkdir -p artifacts/

    build_dir   \
        boot    \
        "bootloader"
}

build_check
build