-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
54 lines (38 loc) · 1.03 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
#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
GIRFILE = $(NAMESPACE)-$(VERSION).gir
TYPEFILE = $(NAMESPACE)-$(VERSION).typelib
# paths
LIBFLAGS = --thread --pkg libsoup-2.4 --pkg json-glib-1.0 --pkg gee-0.8
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)
debug:
mkdir debug
$(VC) $(DEBUG_FLAGS)
mv src/*.c debug/
mv tests/*.c debug/
clean:
rm -fr $(shell cat .gitignore)
rm -fr debug