Registered MIME type and application
[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 = src/moonshot
9
10
11
12 AM_CFLAGS =
13
14 AM_CPPFLAGS = \
15         -include config.h \
16         -DLOCALEDIR=\""$(localedir)"\" \
17         -I$(top_srcdir)/libmoonshot
18
19 AM_VALAFLAGS = \
20         config.vapi \
21         --pkg gtk+-2.0
22
23
24 libmoonshot_libmoonshot_la_CPPFLAGS = \
25         $(libmoonshot_CFLAGS) \
26         $(AM_CPPFLAGS)
27
28 libmoonshot_libmoonshot_la_SOURCES = libmoonshot/libmoonshot-common.c
29
30 libmoonshot_libmoonshot_la_LIBADD = $(libmoonshot_LIBS)
31
32 include_HEADERS = libmoonshot/libmoonshot.h
33 noinst_HEADERS = libmoonshot/libmoonshot-common.h
34
35 src_moonshot_SOURCES = \
36         src/moonshot-id.vala \
37         src/moonshot-add-dialog.vala \
38         src/moonshot-idcard-widget.vala \
39         src/moonshot-custom-vbox.vala \
40         src/moonshot-identities-manager.vala \
41         src/moonshot-identity-request.vala \
42         src/moonshot-server.vala \
43         src/moonshot-window.vala \
44         src/moonshot-password-dialog.vala \
45         src/moonshot-utils.vala \
46         src/moonshot-webp-dialog.vala
47
48 src_moonshot_LDADD = \
49         $(moonshot_LIBS)
50
51 src_moonshot_CPPFLAGS = \
52         $(moonshot_CFLAGS) \
53         $(AM_CPPFLAGS)
54
55 if OS_WIN32
56
57 libmoonshot_libmoonshot_la_LDFLAGS = -no-undefined
58
59 src_moonshot_CFLAGS = -mwindows
60
61 AM_CPPFLAGS += -DOS_WIN32
62 AM_VALAFLAGS += --define=OS_WIN32
63
64 noinst_DATA = libmoonshot/libmoonshot.lib
65
66 libmoonshot/libmoonshot.lib: libmoonshot/libmoonshot.def
67         "${MSVC_LIB}" -def:$< -out:$@ -machine:x86
68
69 endif
70
71 if OS_LINUX
72 ## Installing mime type data
73 mime_DATA = webprovisioning/moonshot.xml
74 mimedir = $(datadir)/mime/packages
75
76 ## Installing
77 dotdesktop_DATA = moonshot.desktop moonshot-webp.desktop
78 dotdesktopdir = $(datadir)/applications
79 endif
80
81 if IPC_MSRPC
82
83 AM_CPPFLAGS += -Isrc
84
85 AM_VALAFLAGS += \
86         --pkg msrpc-1.0 \
87         --define=IPC_MSRPC
88
89 BUILT_SOURCES = libmoonshot/moonshot-msrpc.h \
90                 libmoonshot/moonshot-msrpc_s.c \
91                 libmoonshot/moonshot-msrpc_c.c
92
93 DISTCLEANFILES = ${BUILT_SOURCES}
94
95 libmoonshot/moonshot-msrpc.h: libmoonshot/moonshot-msrpc.idl libmoonshot/moonshot-msrpc.acf
96         ${AM_V_GEN} ${MIDL_WRAPPER} -o libmoonshot -m "${MIDL}" $^
97
98 libmoonshot/moonshot-msrpc_s.c: libmoonshot/moonshot-msrpc.h
99 libmoonshot/moonshot-msrpc_c.c: libmoonshot/moonshot-msrpc.h
100
101 libmoonshot_libmoonshot_la_SOURCES += \
102         libmoonshot/libmoonshot-msrpc.c
103
104 src_moonshot_SOURCES += \
105         src/moonshot-msrpc.vapi
106
107 nodist_src_moonshot_SOURCES = \
108         libmoonshot/moonshot-msrpc_s.c
109
110 nodist_libmoonshot_libmoonshot_la_SOURCES = \
111         libmoonshot/moonshot-msrpc_c.c
112
113 endif
114
115 if IPC_DBUS
116
117 # DBus service file
118 dbusservicedir = $(datadir)/dbus-1/services
119 dbusservice_in_files = org.janet.Moonshot.service.in
120 dbusservice_DATA = $(dbusservice_in_files:.service.in=.service)
121
122 # Rule to make the service file with bindir expanded
123 $(dbusservice_DATA): $(dbusservice_in_files) Makefile
124         @sed -e "s|\@bindir\@|$(bindir)|" $< > $@
125
126 AM_VALAFLAGS += \
127         --pkg dbus-glib-1 \
128         --define=IPC_DBUS
129
130 libmoonshot_libmoonshot_la_SOURCES += libmoonshot/libmoonshot-dbus.c
131
132 CLEANFILES = $(dbusservice_DATA)
133 EXTRA_DIST = $(dbusservice_in_files)
134
135 endif
136
137
138 bin_PROGRAMS += src/moonshot-webp
139
140 src_moonshot_webp_SOURCES = src/moonshot-webp-parser.vala src/moonshot-id.vala
141 src_moonshot_webp_CPPFLAGS = $(moonshot_CFLAGS) $(AM_CPPFLAGS)
142 src_moonshot_webp_LDADD = $(moonshot_LIBS)
143
144 if OS_WIN32
145 moonshot_webp_CFLAGS = -mwindows
146 endif
147
148
149 noinst_PROGRAMS = \
150         examples/client \
151         tests/basic
152
153 examples_client_SOURCES = examples/client.c
154 examples_client_CPPFLAGS = $(libmoonshot_CFLAGS) $(AM_CPPFLAGS)
155 examples_client_LDADD = ${top_builddir}/libmoonshot/libmoonshot.la
156
157 tests_basic_SOURCES = tests/basic.c
158 tests_basic_CPPFLAGS = $(moonshot_CFLAGS) $(AM_CPPFLAGS)
159 tests_basic_LDADD = ${top_builddir}/libmoonshot/libmoonshot.la $(moonshot_LIBS)
160
161 if OS_LINUX
162 install-data-hook:
163         "${UPDATE_MIME_DATABASE}" $(datadir)/mime
164         "${UPDATE_DESKTOP_DATABASE}" $(datadir)/applications
165 endif
166
167 if OS_WIN32
168
169 ## A couple of Windows-specific targets:
170
171 ## 1. Icons. You must have gnome-icon-theme and gnome-icon-theme-symbolic installed
172 ##    in c:/build prefix; and ImageMagick installed in c:/tools/ImageMagick. This
173 ##    pulls in the icons required by moonshot and converts svg's to png's (we have
174 ##    no svg support built in to Windows Gtk+ right now).
175
176 icons:
177         mkdir -p share/icons
178         cp c:/build/share/icons/gnome/48x48/status/avatar-default.png share/icons
179         "${IMAGEMAGICK_CONVERT}" -background none c:/build/share/icons/gnome/scalable/actions/edit-clear-symbolic.svg -size 13x13 share/icons/edit-clear-symbolic.png
180         "${IMAGEMAGICK_CONVERT}" -background none c:/build/share/icons/gnome/scalable/actions/edit-find-symbolic.svg -size 13x13 share/icons/edit-find-symbolic.png
181
182
183 ## 2. Installer. You must have the Windows Installer XML toolkit version 3.5
184 ##    installed in its default path. Note that this requires at least .NET
185 ##    runtime with service packs 1 and 2. The installer picks up files from
186 ##    the build prefix and mingw dir; you must change these if you have them
187 ##    in different locations I'm afraid.
188
189 installer: moonshot.msi
190
191 moonshot.msi: windows/app.wxs
192         "${WIX_CANDLE}" $<
193         "${WIX_LIGHT}" -b c:/build -b c:/tools/mingw -o moonshot.msi app.wixobj
194
195 endif