aboutsummaryrefslogtreecommitdiff
path: root/builder
blob: 7e3db114ba7a4fe785a395e6173d07bdbddc0b7d (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
#!/bin/bash

PARALLEL=8

set -e

export PATH=`readlink -f ./tools`:$PATH

# required when starting from scratch
mkdir -p generated build

echo "BUILDING (parallel=$PARALLEL)..."

# requirements
make -C tools -j $PARALLEL
make -C lib -j $PARALLEL

# data first so we build the dependencies
make -C data -j $PARALLEL
cd src
rm -f Makefile.deps && touch Makefile.deps
find . -name "*.c" | xargs -n1 sdcc -I../generated -I../lib -MM | sed -r 's/([^:]+):/..\/build\/\1:/' >> Makefile.deps
cd -

# the actual build
make -C src -j $PARALLEL $@