Makefile.am 8.42 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@ \
jehan's avatar
jehan committed
7
		coreapi console gtk share scripts tools tester include
aymeric's avatar
aymeric committed
8 9


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

simorl's avatar
simorl committed
12 13 14

ACLOCAL_FLAGS=-I$(top_srcdir)/m4

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

22

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

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


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

53 54 55
EXTRA_DIST =		BUGS  \
			README.arm \
			README.mingw \
56
			README.macos.md \
57 58 59 60 61 62 63
			autogen.sh \
			linphone.spec \
			linphone.spec.in \
			$(GTK_FILELIST) \
			gen-gtkfilelist.sh \
			$(LINPHONEDEPS_FILELIST) \
			$(ISS_SCRIPT).in
aymeric's avatar
aymeric committed
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
EXTRA_DIST += CMakelists.txt \
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

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

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

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

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

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

jehan's avatar
jehan committed
99 100
.phony: rpm rpm-novideo rpm-base
rpm-base:
aymeric's avatar
aymeric committed
101 102 103
	$(MAKE) dist
	-rm -f $(PACKAGE)-$(VERSION).tar
	gunzip $(PACKAGE)-$(VERSION).tar.gz
jehan's avatar
jehan committed
104 105 106
#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
107
	gzip $(PACKAGE)-$(VERSION).tar
jehan's avatar
jehan committed
108 109

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

jehan's avatar
jehan committed
113 114 115 116
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

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

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

simorl's avatar
simorl committed
123 124 125
other-cherrypick:
	cd $(GTK_PREFIX) && \
	for file in $(WINBINDIST_FILES) ; do \
126
		if test -d $(prefix)/$$file; then \
Yann Diorcet's avatar
Yann Diorcet committed
127
			$(MKDIR_P) $(INSTALLDIR_WITH_PREFIX)/$$file ;\
simorl's avatar
simorl committed
128
		else \
129
			cp $(prefix)/$$file $(INSTALLDIR_WITH_PREFIX)/$$file ;\
simorl's avatar
simorl committed
130
		fi \
131
	done
132 133 134 135 136 137
	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 \
138
			$(INSTALLDIR_WITH_PREFIX)/bin/. ;\
139
	fi
140

141

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

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

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

181
filelist: zip
simorl's avatar
simorl committed
182 183 184 185 186 187 188 189
	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
190

191 192 193 194 195 196
### LOCALIZATION

pull-transifex:
	tx pull -af

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

200 201 202

### WINDOWS

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

212 213
###

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

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

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

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

231 232 233

### MAC

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

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

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

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

pkg: $(MACAPPNAME)
265 266 267
	rm -rf ./packaging
	mkdir -p ./packaging
	cp ${srcdir}/COPYING ./packaging
268
	cp ${srcdir}/pixmaps/linphone.png ./packaging
269 270
	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)
271

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

277

278 279
###
### CLEAN
280

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

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