Makefile.am 6.59 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
aymeric's avatar
aymeric committed
8 9


simorl's avatar
simorl committed
10 11 12

ACLOCAL_FLAGS=-I$(top_srcdir)/m4

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

20

21 22 23 24 25 26 27 28
INSTALLDIR=$(shell cd $(top_builddir) && pwd)/linphone-install
INSTALLDIR_WITH_PREFIX=$(INSTALLDIR)/$(prefix)
ZIPFILE=$(shell cd $(top_builddir) && pwd)/$(PACKAGE)-win32-$(VERSION).zip
ZIP_EXCLUDED=include lib \
		$(OPTIONAL_SOUNDS)

SDK_ZIPFILE=$(shell cd $(top_builddir) && pwd)/lib$(PACKAGE)-win32-$(VERSION).zip
SDK_EXCLUDED= \
29
	bin/linphone.exe \
30 31 32 33 34 35 36 37
	lib/*.la \
	share/linphone \
	share/pixmaps \
	share/locale \
	share/gnome \
	$(OPTIONAL_SOUNDS)


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

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

63
DISTCLEANFILES= $(ISS_SCRIPT) $(PACKAGE_WIN32_FILELIST)
64

65
CLEANFILES=Portfile Portfile-devel
smorlat's avatar
smorlat committed
66

aymeric's avatar
aymeric committed
67 68
# `make rpm'

69
all-local: linphone.spec linphone.iss
70

aymeric's avatar
aymeric committed
71 72
linphone.spec: linphone.spec.in

jehan's avatar
jehan committed
73 74
.phony: rpm rpm-novideo rpm-base
rpm-base:
aymeric's avatar
aymeric committed
75 76 77
	$(MAKE) dist
	-rm -f $(PACKAGE)-$(VERSION).tar
	gunzip $(PACKAGE)-$(VERSION).tar.gz
jehan's avatar
jehan committed
78 79 80
#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
81
	gzip $(PACKAGE)-$(VERSION).tar
jehan's avatar
jehan committed
82 83

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

jehan's avatar
jehan committed
87 88 89 90
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

91 92
#a zip containing win32 binaries, suitable to generate an installer

Simon Morlat's avatar
Simon Morlat committed
93 94 95 96
if BUILD_ZRTP
WINBINDIST_FILES+=./bin/libzrtpcpp.dll ./bin/msys-1.0.dll ./bin/msys-crypto-1.0.0.dll
endif

Simon Morlat's avatar
Simon Morlat committed
97 98 99 100
if BUILD_TUNNEL
WINBINDIST_FILES+=./bin/libtunnel-0.dll
endif

simorl's avatar
simorl committed
101 102 103 104 105 106 107 108
other-cherrypick:
	cd $(GTK_PREFIX) && \
	for file in $(WINBINDIST_FILES) ; do \
		if test -d $$file; then \
			mkdir -p $(INSTALLDIR_WITH_PREFIX)/$$file ;\
		else \
			cp $$file $(INSTALLDIR_WITH_PREFIX)/$$file ;\
		fi \
109
	done
110 111 112 113
	cp /mingw/bin/libgcc_s*.dll \
		/mingw/bin/libstdc++-6.dll \
		/mingw/bin/libintl-8.dll \
		/mingw/bin/libiconv-2.dll \
114
		/mingw/bin/pthreadGC2.dll \
115
		$(INSTALLDIR_WITH_PREFIX)/bin/.
116

117

simorl's avatar
simorl committed
118 119 120 121 122 123 124 125 126
gtk-cherrypick:
	cd $(GTK_PREFIX) && \
	for file in `cat $(GTK_FILELIST_PATH)` ; do \
		if test -d $$file; then \
			mkdir -p $(INSTALLDIR_WITH_PREFIX)/$$file ;\
		else \
			cp $$file $(INSTALLDIR_WITH_PREFIX)/$$file ;\
		fi \
	done && \
Simon Morlat's avatar
Simon Morlat committed
127 128
	mkdir -p  $(INSTALLDIR_WITH_PREFIX)/share/themes && \
	cp -rf share/themes/$(GTK_THEME) $(INSTALLDIR_WITH_PREFIX)/share/themes/.
129 130 131 132 133 134

zip:
	rm -f $(ZIPFILE)
	rm -rf $(INSTALLDIR)
	mkdir -p $(INSTALLDIR)
	make install DESTDIR=$(INSTALLDIR)
simorl's avatar
simorl committed
135 136 137 138 139
#remove unwanted linphone stuff
	cd $(INSTALLDIR_WITH_PREFIX) && rm -rf $(ZIP_EXCLUDED)
#add gtk dlls and files
	make gtk-cherrypick
	make other-cherrypick
140
	cp -f $(top_srcdir)/gtk/gtkrc $(INSTALLDIR_WITH_PREFIX)/.
simorl's avatar
simorl committed
141 142 143 144
	cp -f $(top_srcdir)/README $(INSTALLDIR_WITH_PREFIX)/.
	cp -f $(top_srcdir)/COPYING $(INSTALLDIR_WITH_PREFIX)/.
	cd $(INSTALLDIR_WITH_PREFIX) && zip -r $(ZIPFILE) *

145 146 147 148 149 150 151 152 153 154 155 156
sdk:
	rm -f $(SDK_ZIPFILE)
	rm -rf $(INSTALLDIR)
	mkdir -p $(INSTALLDIR)
	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) *

157
filelist: zip
simorl's avatar
simorl committed
158 159 160 161 162 163 164 165
	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
166

167 168 169

### WINDOWS

170
setup.exe: filelist
simorl's avatar
simorl committed
171 172 173 174 175 176 177 178
	cp $(ISS_SCRIPT) $(INSTALLDIR_WITH_PREFIX)/.
	cd $(INSTALLDIR_WITH_PREFIX) && \
	$(ISCC) $(ISS_SCRIPT) 
	mv $(INSTALLDIR_WITH_PREFIX)/Output/setup.exe $(PACKAGE)-$(VERSION)-setup.exe
	rm -rf $(INSTALLDIR_WITH_PREFIX)/Output
	rm -f $(INSTALLDIR_WITH_PREFIX)/$(PACKAGE_WIN32_FILELIST)
	rm -f $(INSTALLDIR_WITH_PREFIX)/$(ISS_SCRIPT)

179 180
###

181
newdate:
182
	cd gtk && $(MAKE) newdate
183

Simon Morlat's avatar
Simon Morlat committed
184 185 186 187 188
if HAVE_MD5SUM
GEN_MD5=$(shell $(MD5SUM) linphone-$(VERSION).tar.gz | awk {'print $$4'})
else
GEN_MD5=$(shell $(MD5SUM) linphone-$(VERSION).tar.gz | awk {'print $$1'})
endif
189

smorlat's avatar
smorlat committed
190
Portfile:	$(top_srcdir)/scripts/Portfile.tmpl dist
smorlat's avatar
smorlat committed
191
	sed -e 's/\@VERSION\@/$(LINPHONE_VERSION)/g' \
Simon Morlat's avatar
Simon Morlat committed
192
	  -e 's/\@LINPHONE_MD5\@/$(GEN_MD5)/' < $< > $@
smorlat's avatar
smorlat committed
193

smorlat's avatar
smorlat committed
194 195
Portfile-devel:	$(top_srcdir)/scripts/Portfile-devel.tmpl dist
	sed -e 's/\@VERSION\@/$(LINPHONE_VERSION)/g' \
Simon Morlat's avatar
Simon Morlat committed
196
	  -e 's/\@LINPHONE_MD5\@/$(GEN_MD5)/' < $< > $@
smorlat's avatar
smorlat committed
197

198 199 200

### MAC

201
MACAPPNAME=Linphone.app
202
MACAPPZIP=$(PACKAGE)-$(VERSION).app.zip
203 204
BUNDLEPREFIX=./
BUNDLEDIR=$(BUNDLEPREFIX)$(MACAPPNAME)
205 206 207 208 209 210 211
LIBICONV_HACK=$(top_builddir)/build/macos/libiconv.2.dylib

$(LIBICONV_HACK):
	cd $(top_builddir)/build/macos && \
	wget http://download-mirror.savannah.gnu.org/releases/linphone/misc/libiconv.2.dylib

bundle: $(LIBICONV_HACK)
212 213 214
	rm -rf $(INSTALLDIR)
	mkdir -p $(INSTALLDIR)
	make install DESTDIR=$(INSTALLDIR)
215
	BUNDLE_PREFIX=$(BUNDLEPREFIX) \
216 217
	LINPHONE_INSTALL_PREFIX=$(INSTALLDIR_WITH_PREFIX) \
	LIBLINPHONE_INSTALL_PREFIX=$(INSTALLDIR_WITH_PREFIX) \
218
	MS2_PLUGINS_INSTALL_PREFIX=$(prefix) \
219
	gtk-mac-bundler $(PACKAGE_BUNDLE_FILE)
Simon Morlat's avatar
Simon Morlat committed
220
	printf "[Pango]\nModuleFiles=./etc/pango/pango.modules\n" \
221 222
	> $(BUNDLEDIR)/Contents/Resources/etc/pango/pangorc 
	cp -f $(LIBICONV_HACK) $(BUNDLEDIR)/Contents/Resources/lib/.
223
	cd $(BUNDLEDIR)/.. && rm -f $(MACAPPZIP) && zip -r $(MACAPPZIP) $(MACAPPNAME) && cd -
224

225 226
###
### CLEAN
227

228 229
clean-local:
	rm -rf $(BUNDLEDIR)