[webp] Registering mime type for Linux
[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 mime_DATA = webprovisioning/moonshot.xml
73 mimedir = $(datadir)/mime/packages
74 endif
75
76 if IPC_MSRPC
77
78 AM_CPPFLAGS += -Isrc
79
80 AM_VALAFLAGS += \
81         --pkg msrpc-1.0 \
82         --define=IPC_MSRPC
83
84 BUILT_SOURCES = libmoonshot/moonshot-msrpc.h \
85                 libmoonshot/moonshot-msrpc_s.c \
86                 libmoonshot/moonshot-msrpc_c.c
87
88 DISTCLEANFILES = ${BUILT_SOURCES}
89
90 libmoonshot/moonshot-msrpc.h: libmoonshot/moonshot-msrpc.idl libmoonshot/moonshot-msrpc.acf
91         ${AM_V_GEN} ${MIDL_WRAPPER} -o libmoonshot -m "${MIDL}" $^
92
93 libmoonshot/moonshot-msrpc_s.c: libmoonshot/moonshot-msrpc.h
94 libmoonshot/moonshot-msrpc_c.c: libmoonshot/moonshot-msrpc.h
95
96 libmoonshot_libmoonshot_la_SOURCES += \
97         libmoonshot/libmoonshot-msrpc.c
98
99 src_moonshot_SOURCES += \
100         src/moonshot-msrpc.vapi
101
102 nodist_src_moonshot_SOURCES = \
103         libmoonshot/moonshot-msrpc_s.c
104
105 nodist_libmoonshot_libmoonshot_la_SOURCES = \
106         libmoonshot/moonshot-msrpc_c.c
107
108 endif
109
110 if IPC_DBUS
111
112 # DBus service file
113 dbusservicedir = $(datadir)/dbus-1/services
114 dbusservice_in_files = org.janet.Moonshot.service.in
115 dbusservice_DATA = $(dbusservice_in_files:.service.in=.service)
116
117 # Rule to make the service file with bindir expanded
118 $(dbusservice_DATA): $(dbusservice_in_files) Makefile
119         @sed -e "s|\@bindir\@|$(bindir)|" $< > $@
120
121 AM_VALAFLAGS += \
122         --pkg dbus-glib-1 \
123         --define=IPC_DBUS
124
125 libmoonshot_libmoonshot_la_SOURCES += libmoonshot/libmoonshot-dbus.c
126
127 CLEANFILES = $(dbusservice_DATA)
128 EXTRA_DIST = $(dbusservice_in_files)
129
130 endif
131
132
133 bin_PROGRAMS += src/moonshot-webp
134
135 src_moonshot_webp_SOURCES = src/moonshot-webp-parser.vala src/moonshot-id.vala
136 src_moonshot_webp_CPPFLAGS = $(moonshot_CFLAGS) $(AM_CPPFLAGS)
137 src_moonshot_webp_LDADD = $(moonshot_LIBS)
138
139 if OS_WIN32
140 moonshot_webp_CFLAGS = -mwindows
141 endif
142
143
144 noinst_PROGRAMS = \
145         examples/client \
146         tests/basic
147
148 examples_client_SOURCES = examples/client.c
149 examples_client_CPPFLAGS = $(libmoonshot_CFLAGS) $(AM_CPPFLAGS)
150 examples_client_LDADD = ${top_builddir}/libmoonshot/libmoonshot.la
151
152 tests_basic_SOURCES = tests/basic.c
153 tests_basic_CPPFLAGS = $(moonshot_CFLAGS) $(AM_CPPFLAGS)
154 tests_basic_LDADD = ${top_builddir}/libmoonshot/libmoonshot.la $(moonshot_LIBS)
155
156 if OS_LINUX
157 install-data-hook:
158         "${UPDATE_MIME_DATABASE}" $(datadir)/mime
159 endif
160
161 if OS_WIN32
162
163 ## A couple of Windows-specific targets:
164
165 ## 1. Icons. You must have gnome-icon-theme and gnome-icon-theme-symbolic installed
166 ##    in c:/build prefix; and ImageMagick installed in c:/tools/ImageMagick. This
167 ##    pulls in the icons required by moonshot and converts svg's to png's (we have
168 ##    no svg support built in to Windows Gtk+ right now).
169
170 icons:
171         mkdir -p share/icons
172         cp c:/build/share/icons/gnome/48x48/status/avatar-default.png share/icons
173         "${IMAGEMAGICK_CONVERT}" -background none c:/build/share/icons/gnome/scalable/actions/edit-clear-symbolic.svg -size 13x13 share/icons/edit-clear-symbolic.png
174         "${IMAGEMAGICK_CONVERT}" -background none c:/build/share/icons/gnome/scalable/actions/edit-find-symbolic.svg -size 13x13 share/icons/edit-find-symbolic.png
175
176
177 ## 2. Installer. You must have the Windows Installer XML toolkit version 3.5
178 ##    installed in its default path. Note that this requires at least .NET
179 ##    runtime with service packs 1 and 2. The installer picks up files from
180 ##    the build prefix and mingw dir; you must change these if you have them
181 ##    in different locations I'm afraid.
182
183 installer: moonshot.msi
184
185 moonshot.msi: windows/app.wxs
186         "${WIX_CANDLE}" $<
187         "${WIX_LIGHT}" -b c:/build -b c:/tools/mingw -o moonshot.msi app.wixobj
188
189 endif