Merge branch 'master' of gitorious.codethink.co.uk:moonshot-ui/moonshot-ui
[moonshot-ui.git] / Makefile.am
1 ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
2
3 SUBDIRS = po
4
5 bin_PROGRAMS = src/moonshot
6
7 AM_CFLAGS =
8
9 AM_CPPFLAGS = \
10         -include config.h \
11         -DLOCALEDIR=\""$(localedir)"\" \
12         $(moonshot_CFLAGS)
13
14 AM_VALAFLAGS = \
15         config.vapi \
16         --pkg gtk+-2.0
17
18 src_moonshot_SOURCES = \
19         src/moonshot-id.vala \
20         src/moonshot-add-dialog.vala \
21         src/moonshot-idcard-widget.vala \
22         src/moonshot-custom-vbox.vala \
23         src/moonshot-identities-manager.vala \
24         src/moonshot-identity-request.vala \
25         src/moonshot-window.vala \
26         src/moonshot-password-dialog.vala \
27         src/moonshot-utils.vala
28
29 src_moonshot_LDADD = \
30         $(moonshot_LIBS)
31
32 if OS_WIN32
33 src_moonshot_CFLAGS = -mwindows
34 AM_VALAFLAGS += --define=OS_WIN32
35 endif
36
37 if IPC_MSRPC
38
39 AM_CPPFLAGS += -Isrc
40
41 AM_VALAFLAGS += \
42         --pkg msrpc-1.0 \
43         --define=IPC_MSRPC
44
45 noinst_HEADERS = src/moonshot-msrpc.h
46
47 src_moonshot_SOURCES += \
48         src/moonshot-msrpc-server.vala \
49         src/moonshot-msrpc_s.c \
50         src/moonshot-msrpc.vapi
51
52 bin_PROGRAMS += src/msrpc-client
53
54 src_msrpc_client_SOURCES = \
55         src/msrpc-client.vala \
56         src/moonshot-msrpc_c.c \
57         src/moonshot-msrpc.vapi
58
59 src_msrpc_client_LDADD = \
60         $(moonshot_LIBS)
61
62 BUILT_SOURCES = src/moonshot-msrpc.h src/moonshot-msrpc_s.c src/moonshot-msrpc_c.c
63
64 DISTCLEANFILES = ${BUILT_SOURCES}
65
66 src/moonshot-msrpc.h: src/moonshot-msrpc.idl src/moonshot-msrpc.acf
67         ${AM_V_GEN} ${MIDL_WRAPPER} -o src -m "${MIDL}" $^
68
69 src/moonshot-msrpc_s.c: src/moonshot-msrpc.h
70
71 else
72
73 # IPC_DBUS
74
75 # DBus service file
76 dbusservicedir = $(datadir)/dbus-1/services
77 dbusservice_in_files = org.janet.Moonshot.service.in
78 dbusservice_DATA = $(dbusservice_in_files:.service.in=.service)
79
80 # Rule to make the service file with bindir expanded
81 $(dbusservice_DATA): $(dbusservice_in_files) Makefile
82         @sed -e "s|\@bindir\@|$(bindir)|" $< > $@
83
84 AM_VALAFLAGS += \
85         --pkg dbus-glib-1 \
86         --define=IPC_DBUS
87
88 src_moonshot_SOURCES += src/moonshot-dbus-server.vala
89
90 bin_PROGRAMS += src/dbus-client
91
92 src_dbus_client_SOURCES = \
93         src/dbus-client.vala
94
95 src_dbus_client_LDADD = \
96         $(moonshot_LIBS)
97
98 CLEANFILES = $(dbusservice_DATA)
99 EXTRA_DIST = $(dbusservice_in_files)
100
101 endif
102
103
104 if OS_WIN32
105
106 ## A couple of Windows-specific targets:
107
108 ## 1. Icons. You must have gnome-icon-theme and gnome-icon-theme-symbolic installed
109 ##    in c:/build prefix; and ImageMagick installed in c:/tools/ImageMagick. This
110 ##    pulls in the icons required by moonshot and converts svg's to png's (we have
111 ##    no svg support built in to Windows Gtk+ right now).
112
113 icons:
114         mkdir -p share/icons
115         cp c:/build/share/icons/gnome/48x48/status/avatar-default.png share/icons
116         "${IMAGEMAGICK_CONVERT}" -background none c:/build/share/icons/gnome/scalable/actions/edit-clear-symbolic.svg -size 13x13 share/icons/edit-clear-symbolic.png
117         "${IMAGEMAGICK_CONVERT}" -background none c:/build/share/icons/gnome/scalable/actions/edit-find-symbolic.svg -size 13x13 share/icons/edit-find-symbolic.png
118
119
120 ## 2. Installer. You must have the Windows Installer XML toolkit version 3.5
121 ##    installed in its default path. Note that this requires at least .NET
122 ##    runtime with service packs 1 and 2. The installer picks up files from
123 ##    the build prefix and mingw dir; you must change these if you have them
124 ##    in different locations I'm afraid.
125
126 installer: moonshot.msi
127
128 moonshot.msi: windows/app.wxs
129         "${WIX_CANDLE}" $<
130         "${WIX_LIGHT}" -b c:/build -b c:/tools/mingw -o moonshot.msi app.wixobj
131
132 endif