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