/+junk/SAPG

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/%2Bjunk/SAPG
1 by Gustav Hartvigsson
* Initial code
1
#!/usr/bin/env bash
2
3
VALAC=valac
4
CC=gcc
5
6
GLIB_LIB=`pkg-config --libs glib-2.0 gio-2.0`
7
GLIB_FlAGS=`pkg-config --cflags glib-2.0 gio-2.0`
8
9
GTK_LIBS=`pkg-config --libs gtk+-3.0`
10
GTK_FlAGS=`pkg-config --cflags gtk+-3.0`
11
12
###################
13
# Build resources #
14
###################
15
./build-resources.sh
16
17
#################
18
# Build program #
19
#################
20
21
# Check if ./bin exists
22
if [ ! -d ./bin/ ]
23
then
24
  mkdir ./bin
25
fi
26
27
# Build the resources.
28
$CC $GLIB_FlAGS -c src/sapg-res.c -o bin/sapg-res.o
29
30
# Build the main program.
31
$VALAC --target-glib=2.38 \
32
       --pkg=Gio-2.0 \
33
       --pkg=gtk+-3.0 \
34
       --gresources=sapg.gresource.xml\
35
       src/main.vala \
36
       -X -DGETTEXT_PACKAGE=\"SAPG\"\
37
       -c -o bin/main.o
38
39
# bug in valac means it does not get compiled to the correct place. >_<
40
mv main.vala.o bin/main.o
41
42
# Link everything.
43
$CC  bin/main.o bin/sapg-res.o $GTK_LIBS $GLIB_LIB -o bin/SAPG
44
45
# clean up.
46
rm bin/main.o bin/sapg-res.o