0ab9090baea26478a2d7e9045eb42f03261472ae
[tilda-gobject.git] / Makefile
1 GCC=gcc
2
3 # Normal CFLAGS
4 CFLAGS=-ggdb -O1 -pipe -Wall -DDEBUG=1
5 LDFLAGS=-Wl,-O1 -Wl,--sort-common -Wl,--as-needed
6 #CFLAGS=-ggdb -O1 -pipe -DDEBUG=1 -ffunction-sections -fdata-sections
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-controller.o tilda-window.o tilda-terminal.o tomboykeybinder.o tomboyutil.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-controller.o: tilda-controller.c tilda-controller.h tilda-controller.xml
25         dbus-binding-tool --mode=glib-server --prefix=tilda_controller tilda-controller.xml > tilda-controller-dbus-glue.h
26         $(GCC) $(CFLAGS) -c -o $@ $< $(ALL_CFLAGS)
27
28 tilda-window.o: tilda-window.c tilda-window.h tilda-window.xml
29         dbus-binding-tool --mode=glib-server --prefix=tilda_window tilda-window.xml > tilda-window-dbus-glue.h
30         $(GCC) $(CFLAGS) -c -o $@ $< $(ALL_CFLAGS)
31
32 tilda-terminal.o: tilda-terminal.c tilda-terminal.h tilda-terminal.xml
33         dbus-binding-tool --mode=glib-server --prefix=tilda_terminal tilda-terminal.xml > tilda-terminal-dbus-glue.h
34         $(GCC) $(CFLAGS) -c -o $@ $< $(ALL_CFLAGS)
35
36 tomboykeybinder.o: tomboykeybinder.c tomboykeybinder.h
37         $(GCC) $(CFLAGS) -c -o $@ $< $(ALL_CFLAGS)
38
39 tomboyutil.o: tomboyutil.c tomboyutil.h
40         $(GCC) $(CFLAGS) -c -o $@ $< $(ALL_CFLAGS)
41
42 eggaccelerators.o: eggaccelerators.c eggaccelerators.h
43         $(GCC) $(CFLAGS) -c -o $@ $< $(ALL_CFLAGS)
44
45 memcheck: tilda
46         # Variables to make GLib work MUCH better in valgrind
47         export G_DEBUG=gc-friendly
48         export G_SLICE=always-malloc
49         valgrind --suppressions=tilda.suppressions --tool=memcheck --leak-check=full ./tilda
50
51 clean:
52         rm -f *.o
53         rm -f tilda-window
54         rm -f tilda-terminal
55         rm -f tilda
56         rm -f tilda-controller-dbus-glue.h
57         rm -f tilda-window-dbus-glue.h
58         rm -f tilda-terminal-dbus-glue.h
59
60 boost-font:
61         @echo "Only run this when tilda is running, it attempts to send a message"
62         @echo "to the running tilda process to boost the font size"
63         dbus-send --print-reply \
64                   --dest=net.sourceforge.Tilda /net/sourceforge/Tilda/Window0/Terminal0 \
65                   org.freedesktop.DBus.Properties.Set \
66                   string:'' \
67                   string:font \
68                   variant:string:'Bitstream Vera Sans Mono 14'
69
70 shrink-font:
71         @echo "Only run this when tilda is running, it attempts to send a message"
72         @echo "to the running tilda process to shrink the font size"
73         dbus-send --print-reply \
74                   --dest=net.sourceforge.Tilda /net/sourceforge/Tilda/Window0/Terminal0 \
75                   org.freedesktop.DBus.Properties.Set \
76                   string:'' \
77                   string:font \
78                   variant:string:'Bitstream Vera Sans Mono 10'