aboutsummaryrefslogtreecommitdiff
path: root/build.sh
blob: 39849a54661952b0c2944c1f24eedddd277b60c4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/sh
cd ${0%/*} # go to project root
set -xe

FLAGS="-Wall -Wextra -g"
SRCD="src"
ODIR="obj"
BIN="bin"

mkdir -p $ODIR
mkdir -p $BIN


gcc -c $SRCD/gen_tiles.c -o $ODIR/gen_tiles.o $FLAGS
gcc -c $SRCD/ppm.c       -o $ODIR/ppm.o       $FLAGS
gcc -c $SRCD/tiles.c     -o $ODIR/tiles.o      $FLAGS
gcc -c $SRCD/main.c      -o $ODIR/main.o       $FLAGS
gcc -o $BIN/wfc $ODIR/main.o $ODIR/ppm.o $ODIR/tiles.o $FLAGS

gcc -o $BIN/gen_tiles $ODIR/gen_tiles.o $ODIR/ppm.o $FLAGS

$BIN/gen_tiles
$BIN/wfc