Makefile.am 6.78 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


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

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

Yann Diorcet's avatar
Yann Diorcet committed
27
SDK_ZIPFILE=$(abs_top_builddir)/lib$(PACKAGE)-win32-$(VERSION).zip
28
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.24.8.filelist
Yann Diorcet's avatar
Yann Diorcet committed
41
GTK_FILELIST_PATH=$(abs_top_srcdir)/$(GTK_FILELIST)
simorl's avatar
simorl committed
42
LINPHONEDEPS_FILELIST=linphone-deps.filelist
Yann Diorcet's avatar
Yann Diorcet committed
43
WINBINDIST_FILES=`cat $(abs_top_srcdir)/$(LINPHONEDEPS_FILELIST)`
simorl's avatar
simorl committed
44
ISS_SCRIPT=linphone.iss
Yann Diorcet's avatar
Yann Diorcet committed
45
ISS_SCRIPT_PATH=$(abs_top_srcdir)/$(ISS_SCRIPT)
simorl's avatar
simorl committed
46
#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

51 52 53 54 55 56 57 58 59 60 61
EXTRA_DIST =		BUGS  \
			README.arm \
			README.mingw \
			README.macos \
			autogen.sh \
			linphone.spec \
			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
other-cherrypick:
	cd $(GTK_PREFIX) && \
	for file in $(WINBINDIST_FILES) ; do \
104
		if test -d $(prefix)/$$file; then \
Yann Diorcet's avatar
Yann Diorcet committed
105
			$(MKDIR_P) $(INSTALLDIR_WITH_PREFIX)/$$file ;\
simorl's avatar
simorl committed
106
		else \
107
			cp $(prefix)/$$file $(INSTALLDIR_WITH_PREFIX)/$$file ;\
simorl's avatar
simorl committed
108
		fi \
109
	done
110 111 112 113 114 115
	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 \
116
			$(INSTALLDIR_WITH_PREFIX)/bin/. ;\
117
	fi
118

119

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

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

147 148 149
sdk:
	rm -f $(SDK_ZIPFILE)
	rm -rf $(INSTALLDIR)
Yann Diorcet's avatar
Yann Diorcet committed
150
	$(MKDIR_P) $(INSTALLDIR)
151 152 153 154 155 156 157 158
	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) *

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

169 170 171

### WINDOWS

172
setup.exe: filelist
simorl's avatar
simorl committed
173 174 175 176 177 178 179 180
	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)

181 182
###

183
newdate:
184
	cd gtk && $(MAKE) newdate
185

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

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

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

200 201 202

### MAC

203
MACAPPNAME=Linphone.app
204
MACAPPZIP=$(PACKAGE)-$(VERSION).app.zip
205 206
BUNDLEPREFIX=./
BUNDLEDIR=$(BUNDLEPREFIX)$(MACAPPNAME)
207 208


209
bundle:
210
	rm -rf $(INSTALLDIR)
Yann Diorcet's avatar
Yann Diorcet committed
211
	$(MKDIR_P) $(INSTALLDIR)
212
	make install DESTDIR=$(INSTALLDIR)
213
	BUNDLE_PREFIX=$(BUNDLEPREFIX) \
214 215
	LINPHONE_INSTALL_PREFIX=$(INSTALLDIR_WITH_PREFIX) \
	LIBLINPHONE_INSTALL_PREFIX=$(INSTALLDIR_WITH_PREFIX) \
216
	MS2_PLUGINS_INSTALL_PREFIX=$(prefix) \
217
	gtk-mac-bundler $(PACKAGE_BUNDLE_FILE)
Simon Morlat's avatar
Simon Morlat committed
218
	printf "[Pango]\nModuleFiles=./etc/pango/pango.modules\n" \
Simon Morlat's avatar
Simon Morlat committed
219 220
	> $(BUNDLEDIR)/Contents/Resources/etc/pango/pangorc
	cp -f $(BUNDLEDIR)/Contents/Resources/etc/pango/pango.modules $(BUNDLEDIR)/Contents/Resources/etc/pango/pango.modules.orig
221
	sed -e 's:@executable_path.*/::g' $(BUNDLEDIR)/Contents/Resources/etc/pango/pango.modules.orig  > $(BUNDLEDIR)/Contents/Resources/etc/pango/pango.modules
222
	cd $(BUNDLEDIR)/.. && rm -f $(MACAPPZIP) && zip -r $(MACAPPZIP) $(MACAPPNAME) && cd -
223

224 225
###
### CLEAN
226

227 228
clean-local:
	rm -rf $(BUNDLEDIR)
jehan's avatar
jehan committed
229
discovery:
230
	touch specs.c
jehan's avatar
jehan committed
231
	$(CC) --include $(top_builddir)/config.h \
232
          $(TUNNEL_CFLAGS) $(CFLAGS) $(MEDIASTREAMER2_CFLAGS) $(ORTP_CFLAGS)  $(SIPSTACK_CFLAGS) $(CUNIT_CFLAGS) -E -P -v -dD specs.c