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