forked from aissat/gBuilder
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
58 lines (43 loc) · 1.41 KB
/
Makefile
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
47
48
49
50
51
52
53
54
55
56
57
58
#export
export LD_LIBRARY_PATH =.
# commands
VC = valac
GIR = g-ir-compiler
# file names
SRC = src/*.vala
TEST_SRC = tests/*.vala
TEST_OUT = debug/libjaa_test
NAMESPACE = Jaa
LIBNAME = libjaa
LIBFILE = $(LIBNAME).so
HFILE = $(LIBNAME).h
VAPIFILE= $(LIBNAME).vapi
VERSION = 0.1
#valac --library=libjaa -H libjaa.h src/*.vala -X -fPIC -X -shared -o libjaa.so --thread --pkg libsoup-2.4 --pkg json-glib-1.0 --pkg gee-0.8 --gir=Jaa-0.1.gir
#g-ir-compiler --shared-library=libjaa.so --output=Jaa-0.1.typelib Jaa-0.1.gir
#valac libjaa.vapi -X libjaa.so --thread --pkg libsoup-2.4 --pkg json-glib-1.0 --pkg gee-0.8 -X -I. -o demo demo.vala
GIRFILE = $(NAMESPACE)-$(VERSION).gir
TYPEFILE = $(NAMESPACE)-$(VERSION).typelib
# paths
LIBFLAGS = --thread --pkg libsoup-2.4 --pkg json-glib-1.0 --pkg gee-1.0 --pkg posix
VFLAGS = --library=$(LIBNAME) -H $(HFILE) $(SRC) -X -fPIC -X -shared -o $(LIBFILE) $(LIBFLAGS) --gir=$(GIRFILE)
DFLAGS = $(VAPIFILE) -X $(LIBFILE) $(LIBFLAGS) -X -I. -o demo
GIRFLAGS = --shared-library=$(LIBFILE) --output=$(TYPEFILE) $(GIRFILE)
DEBUG_FLAGS = $(LIBFLAGS) -g --save-temps -X -w $(SRC) $(TEST_SRC) -o $(TEST_OUT)
all: demo libjaa.so $(TYPEFILE)
demo: libjaa.so
$(VC) $(DFLAGS) demo.vala
libjaa.so:
$(VC) $(VFLAGS)
$(TYPEFILE):
$(GIR) $(GIRFLAGS)
run:
./demo
debug:
mkdir debug
$(VC) $(DEBUG_FLAGS)
mv src/*.c debug/
mv tests/*.c debug/
clean:
rm -fr $(shell cat .gitignore)
rm -fr demo