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