summaryrefslogtreecommitdiffstats
path: root/Makefile.am
blob: a1f7e886836b3a64e77a97ef34343890fc28757d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
bin_PROGRAMS = 
CLEANFILES =


# Everything that goes into the tarball but is not a source of a program or an
# installed data file. The packaging directories are listed file by file on
# purpose: naming the directory itself makes automake copy whatever happens to
# be in it at "make dist" time, which for windows/ would mean the multi-gigabyte
# mxe/ build tree, and for the others the generated files (configure output,
# build leftovers). The lists below are the files under version control, so a
# tarball built from a dirty work tree is the same as one built from a fresh
# checkout. Files generated by configure - windows/*.exe.manifest and the
# windows/installer*.nsi - are deliberately absent; their *.in templates are
# here instead.
EXTRA_DIST = 	iniparser/LICENSE \
			COPYING \
			README \
			debian/changelog \
			debian/control \
			debian/copyright \
			debian/docs \
			debian/pica-client.install \
			debian/pica-client.menu \
			debian/pica-client.postinst \
			debian/pica-client.postrm \
			debian/pica-client.preinst \
			debian/pica-client.prerm \
			debian/pica-node.default \
			debian/pica-node.dirs \
			debian/pica-node.init \
			debian/pica-node.install \
			debian/pica-node.postinst \
			debian/pica-node.postrm \
			debian/pica-node.preinst \
			debian/pica-node.prerm \
			debian/rules \
			debian/source/format \
			gentoo/gentoo_initscript \
			gentoo/pica-pica-9999.ebuild \
			windows/cross_build_mxe.sh \
			windows/installer32.nsi.in \
			windows/installer64.nsi.in \
			windows/mxe_ffmpeg_strip_excess_deps.patch \
			windows/mxe_qtbase_strip_excess_deps.patch \
			windows/pica-client.exe.manifest.in \
			windows/pica-client.nsi \
			windows/pica-client.rc \
			windows/pica-node.exe.manifest.in \
			windows/pica-node.nsi \
			windows/pica-node.rc \
			windows/picapica.ico \
			apple/Info.plist \
			apple/picapica.icns \
			pica-client/icons/icon_16x16.png \
			pica-client/icons/icon_32x32.png \
			pica-client/icons/icon_48x48.png

#####################################
# Windows resources. Each program gets the program icon and the application
# manifest compiled into a linkable object by windres, which is then added to
# its LDADD below. Only the Windows build has a use for these, but the suffix
# itself is declared unconditionally so that make knows .rc is a source suffix
# and not the name of a file.
SUFFIXES = .rc

if TARGET_WINDOWS

# The icon lives in the source directory while the manifest is generated by
# configure into the build directory, so both have to be on the include path
# windres resolves the file names in the resource script against. The version
# is handed to the VERSIONINFO resource on the command line instead of the
# resource script being generated, in the two spellings the numeric and the
# string fields need. The quotes around the string one are escaped twice on
# purpose: windres passes its own command line to the preprocessor through a
# shell, so one round of quoting is eaten there and one here.
.rc.o:
	$(WINDRES) -I $(srcdir)/windows -I windows \
		-DPICA_WINDOWS_VERSION_COMMAS=$(PICA_WINDOWS_VERSION_COMMAS) \
		-DPICA_WINDOWS_VERSION_STRING=\\\"$(VERSION)\\\" \
		-i $< -o $@

windows/pica-node.o: windows/pica-node.rc windows/picapica.ico \
		windows/pica-node.exe.manifest

windows/pica-client.o: windows/pica-client.rc windows/picapica.ico \
		windows/pica-client.exe.manifest

CLEANFILES += windows/pica-node.o windows/pica-client.o

endif
#####################################
if PICA_NODE

bin_PROGRAMS += pica-node

pica_node_SOURCES = PICA_node.c PICA_msgproc.c PICA_nodeaddrlist.c \
		PICA_nodewait.c PICA_nodeconfig.c PICA_log.c \
		iniparser/src/dictionary.c iniparser/src/iniparser.c \
		PICA_node.h PICA_msgproc.h PICA_nodeaddrlist.h \
		PICA_nodewait.h PICA_nodeconfig.h PICA_log.h \
		iniparser/src/dictionary.h iniparser/src/iniparser.h \
		PICA_common.h PICA_proto.h PICA_id.h PICA_id.c \
		PICA_netconf.c PICA_netconf.h PICA_security.h \
		PICA_signverify.c PICA_signverify.h
		
dist_man_MANS = pica-node.8 pica-node.conf.5

pica_node_CPPFLAGS = -DPICA_INSTALLPREFIX=\"$(prefix)\" -DPICA_SYSCONFDIR=\"$(sysconfdir)\" -DPICA_LOCALSTATEDIR=\"$(localstatedir)\"
pica_node_LDADD = $(PICA_NODE_LIBS)

if TARGET_WINDOWS
pica_node_LDADD += windows/pica-node.o
endif

pkglocalstatedir = $(localstatedir)/pica-node

dist_pkglocalstate_DATA = nodelist.db
dist_sysconf_DATA = pica-node.conf 

nodelist.db: nodelist_db_create.sql
	echo "Creating and initializing nodelist database..."
	sqlite3 $@  "`cat $<`" 

CLEANFILES += nodelist.db

EXTRA_DIST += nodelist_db_create.sql 

pkgpicanodedir = ${datarootdir}/pica-node

dist_pkgpicanode_DATA = dhparam4096.pem README nodelist_db_create.sql

endif
#####################################
if PICA_CLIENT
bin_PROGRAMS += pica-client/pica-client

pica_client_pica_client_SOURCES = \
pica-client/accounts.cpp \
pica-client/accounts.h \
pica-client/accountswindow.cpp \
pica-client/accountswindow.h \
pica-client/askpassword.cpp \
pica-client/askpassword.h \
pica-client/chatwindow.cpp \
pica-client/chatwindow.h \
pica-client/callwindow.cpp \
pica-client/callwindow.h \
pica-client/audiovideocallcontroller.cpp \
pica-client/audiovideocallcontroller.h \
pica-client/contactlistwidget.cpp \
pica-client/contactlistwidget.h \
pica-client/contacts.cpp \
pica-client/contacts.h \
pica-client/globals.h \
pica-client/main.cpp \
pica-client/mainwindow.cpp \
pica-client/mainwindow.h \
pica-client/mainwindow.ui \
pica-client/msguirouter.cpp \
pica-client/msguirouter.h \
pica-client/nodes.cpp \
pica-client/nodes.h \
pica-client/openssllib.cpp \
pica-client/openssllib.h \
pica-client/picaactioncenter.cpp \
pica-client/picaactioncenter.h \
pica-client/pica-client.pro \
pica-client/picasystray.cpp \
pica-client/picasystray.h \
pica-client/skynet.cpp \
pica-client/skynet.h \
pica-client/history.h \
pica-client/history.cpp \
pica-client/dhparam.h \
pica-client/dhparam.cpp \
pica-client/filetransfercontroller.cpp \
pica-client/filetransfercontroller.h \
pica-client/sound.cpp \
pica-client/sound.h \
pica-client/toneplayer/toneplayer.cpp \
pica-client/toneplayer/toneplayer.h \
pica-client/settings.cpp \
pica-client/settings.h \
pica-client/callsettings.cpp \
pica-client/callsettings.h \
pica-client/mediadevice.cpp \
pica-client/mediadevice.h \
pica-client/audiodevice.cpp \
pica-client/audiodevice.h \
pica-client/audioring.h \
pica-client/echocanceller.cpp \
pica-client/echocanceller.h \
pica-client/nativeaudio.cpp \
pica-client/nativeaudio.h \
pica-client/nativeaudio_wasapi.cpp \
pica-client/nativeaudio_coreaudio.cpp \
pica-client/videodevice.cpp \
pica-client/videodevice.h \
pica-client/videodshow.cpp \
 \
pica-client/dialogs/addaccountdialog.cpp \
pica-client/dialogs/addaccountdialog.h \
pica-client/dialogs/forgedcertdialog.cpp \
pica-client/dialogs/forgedcertdialog.h \
pica-client/dialogs/registeraccountdialog.cpp \
pica-client/dialogs/registeraccountdialog.h \
pica-client/dialogs/viewcertdialog.cpp \
pica-client/dialogs/viewcertdialog.h \
pica-client/dialogs/showpicaiddialog.cpp \
pica-client/dialogs/showpicaiddialog.h \
pica-client/dialogs/filetransferdialog.cpp \
pica-client/dialogs/filetransferdialog.h \
pica-client/dialogs/settingsdialog.cpp \
pica-client/dialogs/settingsdialog.h \
pica-client/dialogs/nodesdialog.cpp \
pica-client/dialogs/nodesdialog.h \
PICA_client.c \
PICA_media.c \
PICA_client.h \
PICA_media.h \
PICA_msgproc.c \
PICA_msgproc.h \
PICA_common.h PICA_proto.h \
PICA_id.c PICA_id.h \
PICA_netconf.c PICA_netconf.h \
PICA_signverify.c PICA_signverify.h \
PICA_security.h

nodist_pica_client_pica_client_SOURCES  = \
moc_accountswindow.cpp \
moc_addaccountdialog.cpp \
moc_askpassword.cpp \
moc_chatwindow.cpp \
moc_callwindow.cpp \
moc_contactlistwidget.cpp \
moc_forgedcertdialog.cpp \
moc_mainwindow.cpp \
moc_msguirouter.cpp \
moc_openssllib.cpp \
moc_picaactioncenter.cpp \
moc_picasystray.cpp \
moc_registeraccountdialog.cpp \
moc_filetransferdialog.cpp \
moc_audiovideocallcontroller.cpp \
moc_skynet.cpp \
moc_settingsdialog.cpp \
moc_viewcertdialog.cpp \
moc_showpicaiddialog.cpp \
moc_dhparam.cpp \
moc_filetransfercontroller.cpp \
moc_nodesdialog.cpp \
moc_toneplayer.cpp \
moc_audiodevice.cpp \
moc_videodevice.cpp \
ui_mainwindow.h

# moc runs its own preprocessor and sees none of the compiler's defines, so
# any define that a header's signals or slots are conditional on has to be
# repeated here - otherwise moc skips those declarations and the signals end
# up declared but never generated, failing at link time.
MOCFLAGS =

moc_%.cpp: pica-client/%.h
	$(MOC) $(MOCFLAGS) $< -o $@

moc_%.cpp: pica-client/dialogs/%.h
	$(MOC) $(MOCFLAGS) $< -o $@

moc_%.cpp: pica-client/toneplayer/%.h
	$(MOC) $(MOCFLAGS) $< -o $@

pica-client/mainwindow.cpp: ui_mainwindow.h

#ui_mainwindow.h: pica-client/mainwindow.ui
#	uic $(CPPFLAGS) $< -o $@

ui_%.h: pica-client/%.ui
	$(UIC)  $< -o $@


pica_client_pica_client_CPPFLAGS = -DPICA_INSTALLPREFIX=\"$(prefix)\" $(QT_DEPENDENCIES_CFLAGS) $(FFMPEG_CFLAGS) $(PLATFORM_DEPS_CFLAGS) $(WEBRTC_AUDIO_PROCESSING_CFLAGS)
pica_client_pica_client_LDADD = $(QT_DEPENDENCIES_LIBS) $(FFMPEG_LIBS) $(PLATFORM_DEPS_LIBS) $(WEBRTC_AUDIO_PROCESSING_LIBS)

if TARGET_WINDOWS
pica_client_pica_client_LDADD += windows/pica-client.o
endif

# Listing PulseAudio sources and sinks in the settings dialog. The two
# native backend sources above are compiled unconditionally and are empty
# preprocessor-wise on the platforms they are not for, but libpulse is a
# real dependency and only linked when configure found it.
if PICA_PULSE
pica_client_pica_client_CPPFLAGS += $(PULSE_CFLAGS)
pica_client_pica_client_LDADD += $(PULSE_LIBS)
MOCFLAGS += -DHAVE_LIBPULSE
endif

# VAAPI accelerated encoding, decoding and rendering. Everything below is left
# out of the build entirely when configure did not find libva/EGL or was told
# not to look - the code itself is additionally guarded by #ifdef HAVE_VAAPI.
if PICA_VAAPI
pica_client_pica_client_SOURCES += \
pica-client/vaapi.cpp \
pica-client/vaapi.h \
pica-client/vaapivideowidget.cpp \
pica-client/vaapivideowidget.h

nodist_pica_client_pica_client_SOURCES += moc_vaapivideowidget.cpp

pica_client_pica_client_CPPFLAGS += $(VAAPI_CFLAGS)
pica_client_pica_client_LDADD += $(VAAPI_LIBS) -lGL
MOCFLAGS += -DHAVE_VAAPI
endif

# Drawing a decoded surface in an X11 session, where Qt's OpenGL contexts come
# from GLX and cannot import DMA-BUF handles: the driver draws the surface
# straight onto the widget's X window instead.
if PICA_VAAPI_X11
pica_client_pica_client_SOURCES += \
pica-client/vaapix11widget.cpp \
pica-client/vaapix11widget.h

nodist_pica_client_pica_client_SOURCES += moc_vaapix11widget.cpp

pica_client_pica_client_CPPFLAGS += $(VAAPI_X11_CFLAGS)
pica_client_pica_client_LDADD += $(VAAPI_X11_LIBS)
MOCFLAGS += -DHAVE_VAAPI_X11
endif

pkgpicaclientdir = ${datarootdir}/pica-client
dist_pkgpicaclient_DATA =  \
dhparam4096.pem \
pica-client/picapica-icon-fly.png \
pica-client/picapica-icon-sit.png \
pica-client/picapica-snd-newmessage.wav

#$(filter moc_%.cpp,$(pica_client_SOURCES))
CLEANFILES += moc_*.cpp ui_*.h

EXTRA_DIST += pica-client/pica-client.desktop 


deploy: pica-client/pica-client
	mkdir -p PicaPicaMessenger.app/Contents/Resources
	mkdir -p PicaPicaMessenger.app/Contents/MacOS
	mkdir -p PicaPicaMessenger.app/Contents/PlugIns/sqldrivers
	cp apple/Info.plist PicaPicaMessenger.app/Contents/
	cp apple/picapica.icns PicaPicaMessenger.app/Contents/Resources
	cp pica-client/pica-client PicaPicaMessenger.app/Contents/MacOS/PicaPicaMessenger
	cp pica-client/picapica-icon-fly.png PicaPicaMessenger.app/Contents/Resources
	cp pica-client/picapica-icon-sit.png PicaPicaMessenger.app/Contents/Resources
	cp pica-client/picapica-snd-newmessage.wav PicaPicaMessenger.app/Contents/Resources
	cp dhparam4096.pem PicaPicaMessenger.app/Contents/Resources
	cp ${QTDIR}/plugins/sqldrivers/libqsqlite.dylib PicaPicaMessenger.app/Contents/PlugIns/sqldrivers
	macdeployqt PicaPicaMessenger.app -verbose=3
	macdeployqt PicaPicaMessenger.app -verbose=3
	hdiutil create -srcfolder PicaPicaMessenger.app PicaPicaMessenger.dmg
	hdiutil internet-enable -yes PicaPicaMessenger.dmg

endif
#####################################