Implement gnome keyring data store.
[moonshot-ui.git] / Makefile.am
1 ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
2  
3 SUBDIRS = po
4
5
6 lib_LTLIBRARIES = libmoonshot/libmoonshot.la
7
8 bin_PROGRAMS = \
9          src/moonshot \
10          src/moonshot-webp
11 pkglibexec_SCRIPTS = moonshot-dbus-launch
12
13 AM_CFLAGS = -g -O0 -Wall
14
15 AM_CPPFLAGS =  \
16         -include config.h \
17         -DLOCALEDIR=\""$(localedir)"\" \
18         -DMOONSHOT_LAUNCH_SCRIPT='"$(pkglibexecdir)/moonshot-dbus-launch"' \
19         -I$(top_srcdir)/libmoonshot \
20         -I$(top_builddir)/libmoonshot
21
22 AM_VALAFLAGS = -g \
23         config.vapi \
24         --vapidir=$(top_srcdir)/vapi \
25         --pkg gio-2.0
26
27
28 libmoonshot_libmoonshot_la_CPPFLAGS = \
29         $(libmoonshot_CFLAGS) \
30         $(AM_CPPFLAGS) 
31
32 libmoonshot_libmoonshot_la_SOURCES = libmoonshot/libmoonshot-common.c
33
34 libmoonshot_libmoonshot_la_LIBADD = $(libmoonshot_LIBS)
35
36 include_HEADERS = libmoonshot/libmoonshot.h
37 noinst_HEADERS = libmoonshot/libmoonshot-common.h
38
39 src_moonshot_SOURCES = \
40         src/moonshot-identity-manager-app.vala \
41         src/moonshot-identity-management-view.vala \
42         src/moonshot-local-flat-file-store.vala \
43         src/moonshot-keyring-store.vala \
44         src/moonshot-idcard-store.vala \
45         src/moonshot-id.vala \
46         src/moonshot-add-dialog.vala \
47         src/moonshot-idcard-widget.vala \
48         src/moonshot-custom-vbox.vala \
49         src/moonshot-identities-manager.vala \
50         src/moonshot-identity-request.vala \
51         src/moonshot-server.vala \
52         src/moonshot-password-dialog.vala \
53         src/moonshot-provisioning-common.vala \
54         src/moonshot-utils.vala
55
56 src_moonshot_webp_SOURCES = \
57         src/moonshot-webp-parser.vala \
58         src/moonshot-provisioning-common.vala \
59         src/moonshot-id.vala
60
61 src_moonshot_VALAFLAGS = --pkg gdk-2.0 --pkg gtk+-2.0 --pkg gee-1.0 $(AM_VALAFLAGS)
62 src_moonshot_CPPFLAGS = $(moonshot_CFLAGS) $(AM_CPPFLAGS)  
63 src_moonshot_LDADD = $(moonshot_LIBS) 
64 src_moonshot_LDFLAGS = -g -O0
65
66 src_moonshot_webp_VALAFLAGS = --vapidir=$(top_srcdir)/libmoonshot  --pkg gtk+-2.0 --pkg gdk-2.0 --pkg libmoonshot $(AM_VALAFLAGS)
67 src_moonshot_webp_CPPFLAGS = $(moonshot_CFLAGS) $(AM_CPPFLAGS)
68 src_moonshot_webp_LDADD = $(moonshot_LIBS) ${top_builddir}/libmoonshot/libmoonshot.la
69
70 if OS_WIN32
71
72 libmoonshot_libmoonshot_la_LDFLAGS = -no-undefined
73
74 src_moonshot_CFLAGS = -mwindows
75 src_moonshot_webp_CFLAGS = -mwindows
76     
77 AM_CPPFLAGS += -DOS_WIN32
78 AM_VALAFLAGS += --define=OS_WIN32
79
80 noinst_DATA = libmoonshot/libmoonshot.lib
81
82 # Build the MSVC lib. The sed hack fixes execution in the case that
83 # the MSVC toolchain isn't in the PATH.
84 libmoonshot/libmoonshot.lib: libmoonshot/libmoonshot.def
85         PATH="$(shell echo "${MSVC_LIB}" | sed -e s,/VC/bin/lib,/Common7/IDE,)":$$PATH "${MSVC_LIB}" -def:$< -out:$@ -machine:x86
86
87 endif
88
89 if  OS_MACOS
90
91 AM_CPPFLAGS += -DOS_MACOS $(MAC_CFLAGS)
92 AM_VALAFLAGS += --define=OS_MACOS --pkg gtk-mac-integration
93 moonshot_LIBS += $(MAC_LIBS)
94 src_moonshot_LDADD += $(MAC_LIBS)
95 endif
96
97 if OS_LINUX
98
99 AM_CPPFLAGS += -I/usr/include/gnome-keyring-1
100 AM_VALAFLAGS += --pkg moonshot-gnome-keyring --define=GNOME_KEYRING
101 src_moonshot_LDFLAGS += -lgnome-keyring
102
103 ## Installing mime type data
104 mimedir = $(datadir)/mime/packages
105 mime_DATA = webprovisioning/moonshot.xml
106
107 ## Installing
108 dotdesktopdir = $(datadir)/applications
109 dotdesktop_DATA = moonshot.desktop moonshot-webp.desktop
110
111 endif
112
113 if IPC_MSRPC
114
115 AM_CPPFLAGS += -Isrc
116
117 AM_VALAFLAGS += \
118         --pkg moonshot-msrpc --pkg msrpc-1.0 \
119         --define=IPC_MSRPC
120
121 BUILT_SOURCES = libmoonshot/moonshot-msrpc.h \
122                 libmoonshot/moonshot-msrpc_s.c \
123                 libmoonshot/moonshot-msrpc_c.c
124
125 DISTCLEANFILES = ${BUILT_SOURCES}
126
127 libmoonshot/moonshot-msrpc.h: libmoonshot/moonshot-msrpc.idl libmoonshot/moonshot-msrpc.acf
128         ${AM_V_GEN} ${MIDL_WRAPPER} -o libmoonshot -m "${MIDL}" $^
129
130 libmoonshot/moonshot-msrpc_s.c: libmoonshot/moonshot-msrpc.h
131 libmoonshot/moonshot-msrpc_c.c: libmoonshot/moonshot-msrpc.h
132
133 libmoonshot_libmoonshot_la_SOURCES += \
134         libmoonshot/libmoonshot-msrpc.c
135
136
137 nodist_src_moonshot_SOURCES = \
138         libmoonshot/moonshot-msrpc_s.c
139
140 nodist_libmoonshot_libmoonshot_la_SOURCES = \
141         libmoonshot/moonshot-msrpc_c.c
142
143 endif
144
145 if IPC_DBUS
146
147 # DBus service file
148 dbusservicedir = $(datadir)/dbus-1/services
149 if  OS_MACOS
150 dbusservice_in_files = org.janet.Moonshot.service.mac
151 dbusservice_DATA = $(dbusservice_in_files:.service.mac=.service)
152 else
153 dbusservice_in_files = org.janet.Moonshot.service.in
154 dbusservice_DATA = $(dbusservice_in_files:.service.in=.service)
155 endif 
156
157 # Rule to make the service file with bindir expanded
158 $(dbusservice_DATA): $(dbusservice_in_files) Makefile
159         @sed -e "s|\@bindir\@|$(bindir)|" $< > $@
160
161 libmoonshot_libmoonshot_la_SOURCES += libmoonshot/libmoonshot-dbus.c
162
163 CLEANFILES = $(dbusservice_DATA)
164
165 if IPC_DBUS_GLIB
166 AM_VALAFLAGS += \
167         --pkg dbus-glib-1 \
168         --define=IPC_DBUS_GLIB \
169         --define=IPC_DBUS
170 else
171 AM_VALAFLAGS += \
172         --pkg gio-2.0 \
173         --define=IPC_GDBUS \
174         --define=IPC_DBUS
175 endif
176 endif
177
178 EXTRA_DIST = webprovisioning/moonshot.xml $(dbusservice_in_files) \
179         moonshot-dbus-launch \
180         moonshot-ui.spec
181
182 noinst_PROGRAMS = \
183         examples/client \
184         examples/service-selection \
185         tests/basic
186
187 examples_service_selection_SOURCES = examples/service-selection.c
188 examples_service_selection_CPPFLAGS = $(moonshot_CFLAGS) $(AM_CPPFLAGS)
189 examples_service_selection_LDADD = ${top_builddir}/libmoonshot/libmoonshot.la $(moonshot_LIBS)
190
191 examples_client_SOURCES = examples/client.c
192 examples_client_CPPFLAGS = $(libmoonshot_CFLAGS) $(AM_CPPFLAGS)
193 examples_client_LDADD = ${top_builddir}/libmoonshot/libmoonshot.la
194
195 tests_basic_SOURCES = tests/basic.c
196 tests_basic_CPPFLAGS = $(moonshot_CFLAGS) $(AM_CPPFLAGS)
197 tests_basic_LDADD = ${top_builddir}/libmoonshot/libmoonshot.la $(moonshot_LIBS)
198
199 ##if OS_LINUX
200 ##install-data-hook:
201 ##      "${UPDATE_MIME_DATABASE}" $(datadir)/mime
202 ##      "${UPDATE_DESKTOP_DATABASE}" $(datadir)/applications
203 ##uninstall-hook:
204 ##      "${UPDATE_MIME_DATABASE}" $(datadir)/mime
205 ##      "${UPDATE_DESKTOP_DATABASE}" $(datadir)/applications
206 ##endif
207
208 if OS_WIN32
209
210 ## A couple of Windows-specific targets:
211
212 ## 1. Icons. You must have gnome-icon-theme and gnome-icon-theme-symbolic installed
213 ##    in the install prefix; and ImageMagick installed in c:/tools/ImageMagick. This
214 ##    pulls in the icons required by moonshot and converts svg's to png's (we have
215 ##    no svg support built in to Windows Gtk+ right now).
216
217 icons:
218         mkdir -p share/icons
219         cp ${prefix}/share/icons/gnome/48x48/status/avatar-default.png share/icons
220         "${IMAGEMAGICK_CONVERT}" -background none ${prefix}/share/icons/gnome/scalable/actions/edit-clear-symbolic.svg -size 13x13 share/icons/edit-clear-symbolic.png
221         "${IMAGEMAGICK_CONVERT}" -background none ${prefix}/share/icons/gnome/scalable/actions/edit-find-symbolic.svg -size 13x13 share/icons/edit-find-symbolic.png
222
223
224 ## 2. Installer. You must have the Windows Installer XML toolkit version 3.5
225 ##    installed in its default path. Note that this requires at least .NET
226 ##    runtime with service packs 1 and 2. The installer picks up files from
227 ##    the build prefix and mingw dir; you must change these if you have them
228 ##    in different locations I'm afraid.
229
230 installer: moonshot.msi
231
232 moonshot.msi: windows/app.wxs windows/config.wxi $(bin_PROGRAMS)
233         "${WIX_CANDLE}" $<
234         "${WIX_LIGHT}" -b ${prefix} -b ${prefix}/mingw -o moonshot.msi app.wixobj
235
236 endif
237
238 if  OS_MACOS
239 ## Mac-specific targets
240
241 ## 1. Icons. 
242
243 icons:
244         mkdir -p share/icons
245         cp mac/icons/process-stop.png share/icons
246         cp mac/icons/edit-find.png share/icons
247         cp mac/icons/avatar-default.png share/icons
248
249 ## 2. App bundle
250 ## gtk-app-bundler must be installed
251 ## moonshot-ui.app will be built in moonshot/mac-client-installer/moonshot-ui/
252 app-bundle:
253         gtk-mac-bundler ./mac/moonshot-ui.bundle
254
255 ## 3: Installer Package
256
257 installerdir = $(HOME)/moonshot/mac-client-installer
258
259 endif