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
42
43
44
45
46
|
#!/usr/bin/env bash
VALAC=valac
CC=gcc
GLIB_LIB=`pkg-config --libs glib-2.0 gio-2.0`
GLIB_FlAGS=`pkg-config --cflags glib-2.0 gio-2.0`
GTK_LIBS=`pkg-config --libs gtk+-3.0`
GTK_FlAGS=`pkg-config --cflags gtk+-3.0`
###################
# Build resources #
###################
./build-resources.sh
#################
# Build program #
#################
# Check if ./bin exists
if [ ! -d ./bin/ ]
then
mkdir ./bin
fi
# Build the resources.
$CC $GLIB_FlAGS -c src/sapg-res.c -o bin/sapg-res.o
# Build the main program.
$VALAC --target-glib=2.38 \
--pkg=Gio-2.0 \
--pkg=gtk+-3.0 \
--gresources=sapg.gresource.xml\
src/main.vala \
-X -DGETTEXT_PACKAGE=\"SAPG\"\
-c -o bin/main.o
# bug in valac means it does not get compiled to the correct place. >_<
mv main.vala.o bin/main.o
# Link everything.
$CC bin/main.o bin/sapg-res.o $GTK_LIBS $GLIB_LIB -o bin/SAPG
# clean up.
rm bin/main.o bin/sapg-res.o
|