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