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