[Config] Add type-safe configuration parsing
[tilda-gobject.git] / Makefile
1 GCC=gcc
2
3 # Normal CFLAGS
4 CFLAGS=-ggdb -O1 -pipe -Wshadow -Wall -DDEBUG=1
5 LDFLAGS=-Wl,-O1 -Wl,--sort-common -Wl,--as-needed
6 #CFLAGS=-ggdb -O1 -pipe -ffunction-sections -fdata-sections -DDEBUG=1
7 #LDFLAGS=-Wl,--gc-sections -Wl,--print-gc-sections
8 GOBJ_CFLAGS=`pkg-config --cflags gobject-2.0`
9 GOBJ_LIBS=`pkg-config --libs gobject-2.0`
10
11 ALL_CFLAGS=`pkg-config --cflags gtk+-2.0 vte dbus-glib-1`
12 ALL_LIBS=`pkg-config --libs gtk+-2.0 vte dbus-glib-1`
13
14 .PHONY: all memcheck clean
15
16 all: tilda
17
18 tilda: tilda.o tilda-types.o tilda-config.o tilda-controller.o tilda-window.o tilda-terminal.o tomboykeybinder.o eggaccelerators.o
19         $(GCC) $(CFLAGS) $(LDFLAGS) $^ -o $@ $(ALL_LIBS)
20
21 tilda.o: tilda.c tilda.h
22         $(GCC) $(CFLAGS) -c -o $@ $< $(ALL_CFLAGS)
23
24 tilda-types.o: tilda-types.c tilda-types.h
25         $(GCC) $(CFLAGS) -c -o $@ $< $(ALL_CFLAGS)
26
27 tilda-config.o: tilda-config.c tilda-config.h
28         $(GCC) $(CFLAGS) -c -o $@ $< $(ALL_CFLAGS)
29
30 tilda-controller.o: tilda-controller.c tilda-controller.h tilda-controller.xml
31         dbus-binding-tool --mode=glib-server --prefix=tilda_controller tilda-controller.xml > tilda-controller-dbus-glue.h
32         $(GCC) $(CFLAGS) -c -o $@ $< $(ALL_CFLAGS)
33
34 tilda-window.o: tilda-window.c tilda-window.h tilda-window.xml
35         dbus-binding-tool --mode=glib-server --prefix=tilda_window tilda-window.xml > tilda-window-dbus-glue.h
36         $(GCC) $(CFLAGS) -c -o $@ $< $(ALL_CFLAGS)
37
38 tilda-terminal.o: tilda-terminal.c tilda-terminal.h tilda-terminal.xml
39         dbus-binding-tool --mode=glib-server --prefix=tilda_terminal tilda-terminal.xml > tilda-terminal-dbus-glue.h
40         $(GCC) $(CFLAGS) -c -o $@ $< $(ALL_CFLAGS)
41
42 tomboykeybinder.o: tomboykeybinder.c tomboykeybinder.h
43         $(GCC) $(CFLAGS) -c -o $@ $< $(ALL_CFLAGS)
44
45 eggaccelerators.o: eggaccelerators.c eggaccelerators.h
46         $(GCC) $(CFLAGS) -c -o $@ $< $(ALL_CFLAGS)
47
48 memcheck: tilda
49         # Variables to make GLib work MUCH better in valgrind
50         export G_DEBUG=gc-friendly
51         export G_SLICE=always-malloc
52         valgrind --suppressions=tilda.suppressions --tool=memcheck --leak-check=full ./tilda
53
54 clean:
55         rm -f *.o
56         rm -f tilda-window
57         rm -f tilda-terminal
58         rm -f tilda
59         rm -f tilda-controller-dbus-glue.h
60         rm -f tilda-window-dbus-glue.h
61         rm -f tilda-terminal-dbus-glue.h
62
63 boost-font:
64         @echo "Only run this when tilda is running, it attempts to send a message"
65         @echo "to the running tilda process to boost the font size"
66         dbus-send --print-reply \
67                   --dest=net.sourceforge.Tilda /net/sourceforge/Tilda/Window0/Terminal0 \
68                   org.freedesktop.DBus.Properties.Set \
69                   string:'' \
70                   string:font \
71                   variant:string:'Bitstream Vera Sans Mono 14'
72
73 shrink-font:
74         @echo "Only run this when tilda is running, it attempts to send a message"
75         @echo "to the running tilda process to shrink the font size"
76         dbus-send --print-reply \
77                   --dest=net.sourceforge.Tilda /net/sourceforge/Tilda/Window0/Terminal0 \
78                   org.freedesktop.DBus.Properties.Set \
79                   string:'' \
80                   string:font \
81                   variant:string:'Bitstream Vera Sans Mono 10'