Makefile.am 8.43 KB
Newer Older
aymeric's avatar
aymeric committed
1 2 3
## Process this file with automake to produce Makefile.in

# let make re-run automake upon need
smorlat's avatar
smorlat committed
4
ACLOCAL_AMFLAGS = -I m4 $(ACLOCAL_MACOS_FLAGS)
aymeric's avatar
aymeric committed
5

6
SUBDIRS = build m4 pixmaps po @ORTP_DIR@ @MS2_DIR@ \
7
		coreapi console gtk share scripts tools daemon tester include
aymeric's avatar
aymeric committed
8

9 10
GITVERSION=`cd $(top_srcdir) && git describe --always || echo $(VERSION)`

simorl's avatar
simorl committed
11 12 13

ACLOCAL_FLAGS=-I$(top_srcdir)/m4

14
OPTIONAL_SOUNDS=\
simorl's avatar
simorl committed
15 16
		share/sounds/linphone/rings/synth.wav \
		share/sounds/linphone/rings/tapping.wav \
17 18 19
		share/sounds/linphone/rings/orig.wav \
		share/sounds/linphone/rings/sweet.wav \
		share/sounds/linphone/rings/rock.wav
simorl's avatar
simorl committed
20

21

Yann Diorcet's avatar
Yann Diorcet committed
22
INSTALLDIR=$(abs_top_builddir)/linphone-install
23
INSTALLDIR_WITH_PREFIX=$(INSTALLDIR)/$(prefix)
24
ZIPFILE=$(abs_top_builddir)/$(PACKAGE)-win32-$(GITVERSION).zip
25 26 27
ZIP_EXCLUDED=include lib \
		$(OPTIONAL_SOUNDS)

28
SDK_ZIPFILE=$(abs_top_builddir)/lib$(PACKAGE)-win32-sdk-$(GITVERSION).zip
29
SDK_EXCLUDED= \
30
	bin/linphone.exe \
31 32 33 34 35 36 37 38
	lib/*.la \
	share/linphone \
	share/pixmaps \
	share/locale \
	share/gnome \
	$(OPTIONAL_SOUNDS)


39
GTK_PREFIX=/
Simon Morlat's avatar
Simon Morlat committed
40
GTK_THEME=Outcrop
41
GTK_FILELIST=gtk+-2.24.8.filelist
Yann Diorcet's avatar
Yann Diorcet committed
42
GTK_FILELIST_PATH=$(abs_top_srcdir)/$(GTK_FILELIST)
simorl's avatar
simorl committed
43
LINPHONEDEPS_FILELIST=linphone-deps.filelist
Yann Diorcet's avatar
Yann Diorcet committed
44
WINBINDIST_FILES=`cat $(abs_top_srcdir)/$(LINPHONEDEPS_FILELIST)`
simorl's avatar
simorl committed
45
ISS_SCRIPT=linphone.iss
Yann Diorcet's avatar
Yann Diorcet committed
46
ISS_SCRIPT_PATH=$(abs_top_srcdir)/$(ISS_SCRIPT)
simorl's avatar
simorl committed
47
#path to Inno Setup 5 compiler
48
ISCC=ISCC.exe
simorl's avatar
simorl committed
49
PACKAGE_WIN32_FILELIST=$(PACKAGE)-win32.filelist
50
PACKAGE_BUNDLE_FILE=$(top_srcdir)/build/macos/$(PACKAGE).bundle
simorl's avatar
simorl committed
51

52 53 54
EXTRA_DIST =		BUGS  \
			README.arm \
			README.mingw \
55
			README.macos.md \
56 57 58 59 60 61 62
			autogen.sh \
			linphone.spec \
			linphone.spec.in \
			$(GTK_FILELIST) \
			gen-gtkfilelist.sh \
			$(LINPHONEDEPS_FILELIST) \
			$(ISS_SCRIPT).in
aymeric's avatar
aymeric committed
63

Ghislain MARY's avatar
Ghislain MARY committed
64
EXTRA_DIST += CMakeLists.txt \
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87
cmake/FindGtkMacIntegration.cmake \
cmake/FindIconv.cmake \
cmake/FindIntl.cmake \
cmake/FindNotify.cmake \
cmake/FindSqlite3.cmake \
cmake/FindXML2.cmake \
cmake/FindZlib.cmake \
cmake/LinphoneConfig.cmake.in \
config.h.cmake \
console/CMakeLists.txt \
coreapi/CMakeLists.txt \
coreapi/gitversion.cmake \
coreapi/help/CMakeLists.txt \
gtk/CMakeLists.txt \
java/CMakeLists.txt \
pixmaps/CMakeLists.txt \
po/CMakeLists.txt \
share/CMakeLists.txt \
share/rings/CMakeLists.txt \
share/rootca.cmake \
tester/CMakeLists.txt \
tools/CMakeLists.txt

88
DISTCLEANFILES= $(ISS_SCRIPT) $(PACKAGE_WIN32_FILELIST)
89

90
CLEANFILES=Portfile Portfile-devel
smorlat's avatar
smorlat committed
91

aymeric's avatar
aymeric committed
92 93
# `make rpm'

94
all-local: linphone.spec linphone.iss
95

aymeric's avatar
aymeric committed
96 97
linphone.spec: linphone.spec.in

jehan's avatar
jehan committed
98 99
.phony: rpm rpm-novideo rpm-base
rpm-base:
aymeric's avatar
aymeric committed
100 101 102
	$(MAKE) dist
	-rm -f $(PACKAGE)-$(VERSION).tar
	gunzip $(PACKAGE)-$(VERSION).tar.gz
jehan's avatar
jehan committed
103 104 105
#remove ms2 and ortp spec file to make sure linphone spec file is used bu rpmbuild
	tar --delete --file=$(PACKAGE)-$(VERSION).tar $(PACKAGE)-$(VERSION)/mediastreamer2/mediastreamer2.spec
	tar --delete --file=$(PACKAGE)-$(VERSION).tar $(PACKAGE)-$(VERSION)/oRTP/ortp.spec
aymeric's avatar
aymeric committed
106
	gzip $(PACKAGE)-$(VERSION).tar
jehan's avatar
jehan committed
107 108

rpm: rpm-base
aymeric's avatar
aymeric committed
109 110
# <https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=2068410>
	TAR_OPTIONS=--wildcards rpmbuild -ta --clean --rmsource --rmspec $(PACKAGE)-$(VERSION).tar.gz
111

jehan's avatar
jehan committed
112 113 114 115
rpm-novideo: rpm-base
# <https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=2068410>
	TAR_OPTIONS=--wildcards rpmbuild -ta --clean --rmsource --rmspec $(PACKAGE)-$(VERSION).tar.gz --without video

116 117
#a zip containing win32 binaries, suitable to generate an installer

Simon Morlat's avatar
Simon Morlat committed
118 119 120 121
if BUILD_TUNNEL
WINBINDIST_FILES+=./bin/libtunnel-0.dll
endif

simorl's avatar
simorl committed
122 123 124
other-cherrypick:
	cd $(GTK_PREFIX) && \
	for file in $(WINBINDIST_FILES) ; do \
125
		if test -d $(prefix)/$$file; then \
Yann Diorcet's avatar
Yann Diorcet committed
126
			$(MKDIR_P) $(INSTALLDIR_WITH_PREFIX)/$$file ;\
simorl's avatar
simorl committed
127
		else \
128
			cp $(prefix)/$$file $(INSTALLDIR_WITH_PREFIX)/$$file ;\
simorl's avatar
simorl committed
129
		fi \
130
	done
131 132 133 134 135 136
	if test -d /mingw/bin ; then \
		cp /mingw/bin/libgcc_s*.dll \
			/mingw/bin/libstdc++-6.dll \
			/mingw/bin/libintl-8.dll \
			/mingw/bin/libiconv-2.dll \
			/mingw/bin/pthreadGC2.dll \
137
			$(INSTALLDIR_WITH_PREFIX)/bin/. ;\
138
	fi
139

140

simorl's avatar
simorl committed
141 142 143
gtk-cherrypick:
	cd $(GTK_PREFIX) && \
	for file in `cat $(GTK_FILELIST_PATH)` ; do \
144
		if test -d $(prefix)/$$file; then \
Yann Diorcet's avatar
Yann Diorcet committed
145
			$(MKDIR_P) $(INSTALLDIR_WITH_PREFIX)/$$file ;\
simorl's avatar
simorl committed
146
		else \
147
			cp $(prefix)/$$file $(INSTALLDIR_WITH_PREFIX)/$$file ;\
simorl's avatar
simorl committed
148 149
		fi \
	done && \
Yann Diorcet's avatar
Yann Diorcet committed
150
	$(MKDIR_P) $(INSTALLDIR_WITH_PREFIX)/share/themes && \
151
	cp -rf $(prefix)/share/themes/$(GTK_THEME) $(INSTALLDIR_WITH_PREFIX)/share/themes/.
152 153 154 155

zip:
	rm -f $(ZIPFILE)
	rm -rf $(INSTALLDIR)
Yann Diorcet's avatar
Yann Diorcet committed
156
	$(MKDIR_P) $(INSTALLDIR)
157
	make install DESTDIR=$(INSTALLDIR)
simorl's avatar
simorl committed
158 159 160 161 162
#remove unwanted linphone stuff
	cd $(INSTALLDIR_WITH_PREFIX) && rm -rf $(ZIP_EXCLUDED)
#add gtk dlls and files
	make gtk-cherrypick
	make other-cherrypick
163
	cp -f $(top_srcdir)/gtk/gtkrc $(INSTALLDIR_WITH_PREFIX)/.
164
	cp -f $(top_srcdir)/README $(INSTALLDIR_WITH_PREFIX)/.
simorl's avatar
simorl committed
165 166 167
	cp -f $(top_srcdir)/COPYING $(INSTALLDIR_WITH_PREFIX)/.
	cd $(INSTALLDIR_WITH_PREFIX) && zip -r $(ZIPFILE) *

168 169 170
sdk:
	rm -f $(SDK_ZIPFILE)
	rm -rf $(INSTALLDIR)
Yann Diorcet's avatar
Yann Diorcet committed
171
	$(MKDIR_P) $(INSTALLDIR)
172 173 174 175
	make install DESTDIR=$(INSTALLDIR)
# remove unwanted stuff (gtk interface)
	cd $(INSTALLDIR_WITH_PREFIX) && rm -rf $(SDK_EXCLUDED)
	make other-cherrypick
176
	cp -f $(top_srcdir)/README $(INSTALLDIR_WITH_PREFIX)/.
177 178 179
	cp -f $(top_srcdir)/COPYING $(INSTALLDIR_WITH_PREFIX)/.
	cd $(INSTALLDIR_WITH_PREFIX) && zip -r $(SDK_ZIPFILE) *

180
filelist: zip
simorl's avatar
simorl committed
181 182 183 184 185 186 187 188
	cd $(INSTALLDIR_WITH_PREFIX) && \
	rm -f $(PACKAGE_WIN32_FILELIST) && \
	for file in `find` ; do \
		if ! test -d $$file ; then \
			echo "Source: $$file; Destdir: {app}\\`dirname $$file`; Flags: ignoreversion" \
			>> $(PACKAGE_WIN32_FILELIST) ;\
		fi \
	done
189

190 191 192 193 194 195
### LOCALIZATION

pull-transifex:
	tx pull -af

push-transifex:
196 197
	$(MAKE) -C po update-po
	tx push -s -f --no-interactive
198

199 200 201

### WINDOWS

202
setup.exe: filelist
simorl's avatar
simorl committed
203 204
	cp $(ISS_SCRIPT) $(INSTALLDIR_WITH_PREFIX)/.
	cd $(INSTALLDIR_WITH_PREFIX) && \
205
	$(ISCC) $(ISS_SCRIPT)
206
	mv $(INSTALLDIR_WITH_PREFIX)/Output/setup.exe $(PACKAGE)-setup-$(GITVERSION).exe
simorl's avatar
simorl committed
207 208 209 210
	rm -rf $(INSTALLDIR_WITH_PREFIX)/Output
	rm -f $(INSTALLDIR_WITH_PREFIX)/$(PACKAGE_WIN32_FILELIST)
	rm -f $(INSTALLDIR_WITH_PREFIX)/$(ISS_SCRIPT)

211 212
###

213
newdate:
214
	cd gtk && $(MAKE) newdate
215

Simon Morlat's avatar
Simon Morlat committed
216
if HAVE_MD5SUM
217
GEN_MD5=`$(MD5SUM) linphone-$(VERSION).tar.gz | awk {'print $$4'}`
Simon Morlat's avatar
Simon Morlat committed
218
else
219
GEN_MD5=`$(MD5SUM) linphone-$(VERSION).tar.gz | awk {'print $$1'}`
Simon Morlat's avatar
Simon Morlat committed
220
endif
221

Yann Diorcet's avatar
Yann Diorcet committed
222
Portfile: $(top_srcdir)/scripts/Portfile.tmpl dist
smorlat's avatar
smorlat committed
223
	sed -e 's/\@VERSION\@/$(LINPHONE_VERSION)/g' \
Simon Morlat's avatar
Simon Morlat committed
224
	  -e 's/\@LINPHONE_MD5\@/$(GEN_MD5)/' < $< > $@
smorlat's avatar
smorlat committed
225

smorlat's avatar
smorlat committed
226 227
Portfile-devel:	$(top_srcdir)/scripts/Portfile-devel.tmpl dist
	sed -e 's/\@VERSION\@/$(LINPHONE_VERSION)/g' \
Simon Morlat's avatar
Simon Morlat committed
228
	  -e 's/\@LINPHONE_MD5\@/$(GEN_MD5)/' < $< > $@
smorlat's avatar
smorlat committed
229

230 231 232

### MAC

233
MACAPPNAME=Linphone.app
234 235
MACAPPZIP=$(PACKAGE)-$(GITVERSION).app.zip
MACAPPDMG=$(PACKAGE)-$(GITVERSION).dmg
236
MACAPPPKG=$(PACKAGE)-$(GITVERSION).pkg
237 238
BUNDLEPREFIX=./
BUNDLEDIR=$(BUNDLEPREFIX)$(MACAPPNAME)
239 240
#a path prefix where additional libs can be cherry-picked by the bundler.
LINPHONE_ADDITIONAL_DEPENDENCIES_PREFIX=/usr/local
241

242
Linphone.app:
243
	rm -rf $(INSTALLDIR)
Yann Diorcet's avatar
Yann Diorcet committed
244
	$(MKDIR_P) $(INSTALLDIR)
245
	make install DESTDIR=$(INSTALLDIR)
246
	BUNDLE_PREFIX=$(BUNDLEPREFIX) \
247 248
	LINPHONE_INSTALL_PREFIX=$(INSTALLDIR_WITH_PREFIX) \
	LIBLINPHONE_INSTALL_PREFIX=$(INSTALLDIR_WITH_PREFIX) \
249
	MS2_PLUGINS_INSTALL_PREFIX=$(prefix) \
250
	LINPHONE_ADDITIONAL_DEPENDENCIES_PREFIX=$(LINPHONE_ADDITIONAL_DEPENDENCIES_PREFIX) \
251
	gtk-mac-bundler $(PACKAGE_BUNDLE_FILE)
252
	patch ${BUNDLEDIR}/Contents/Resources/share/themes/Quartz/gtk-2.0/gtkrc ${srcdir}/build/macos/quartz-theme-gtkrc.patch
253
	rm -f ${BUNDLEDIR}/Contents/Resources/lib/libopenh264*
254

255
bundle: $(MACAPPNAME)
256
	cd $(BUNDLEDIR)/.. && rm -f $(MACAPPZIP) && zip -r $(MACAPPZIP) $(MACAPPNAME) && cd -
Simon Morlat's avatar
Simon Morlat committed
257
	cd $(BUNDLEDIR)/.. && rm -f $(MAXAPPDMG) && hdiutil create $(MACAPPDMG) -srcfolder $(MACAPPNAME) -ov && cd -
258

259
signed-bundle: $(MACAPPNAME)
260
	codesign --deep -s "$(BUNDLE_SIGNING_ID)" $(BUNDLEDIR)
261
	cd $(BUNDLEDIR)/.. && rm -f $(MAXAPPDMG) && hdiutil create $(MACAPPDMG) -srcfolder $(MACAPPNAME) -ov && cd -
262 263

pkg: $(MACAPPNAME)
264 265 266
	rm -rf ./packaging
	mkdir -p ./packaging
	cp ${srcdir}/COPYING ./packaging
267
	cp ${srcdir}/pixmaps/linphone.png ./packaging
268 269
	pkgbuild --install-location /Applications --scripts ${srcdir}/build/macos/pkg-scripts --component $(MACAPPNAME) ./packaging/linphone.pkg
	productbuild --resources . --distribution ${srcdir}/build/macos/pkg-distribution.xml --package-path ./packaging $(MACAPPPKG)
270

271
signed-pkg: pkg
272 273 274
	mv $(MACAPPPKG) $(MACAPPPKG).tmp
	productsign --sign "$(BUNDLE_SIGNING_ID)" $(MACAPPPKG).tmp $(MACAPPPKG)
	rm -f $(MACAPPPKG).tmp
275

276

277 278
###
### CLEAN
279

280 281
clean-local:
	rm -rf $(BUNDLEDIR)
jehan's avatar
jehan committed
282
discovery:
283
	touch specs.c
jehan's avatar
jehan committed
284
	$(CC) --include $(top_builddir)/config.h \
285
        $(TUNNEL_CFLAGS) $(CFLAGS) $(MEDIASTREAMER2_CFLAGS) $(ORTP_CFLAGS)  $(SIPSTACK_CFLAGS) $(BCTOOLBOXTESTER_CFLAGS) -E -P -v -dD specs.c
Simon Morlat's avatar
Simon Morlat committed
286

287
.PHONY: $(MACAPPNAME) pkg
Simon Morlat's avatar
Simon Morlat committed
288 289