Makefile.am 5.53 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 7 8 9 10 11
if EXTERNAL_MEDIASTREAMER
MS2_DIR=
else
MS2_DIR=mediastreamer2
endif

aymeric's avatar
aymeric committed
12
if EXTERNAL_ORTP
13
ORTP_DIR=
aymeric's avatar
aymeric committed
14
else
15
ORTP_DIR=oRTP
aymeric's avatar
aymeric committed
16 17
endif

18

19
SUBDIRS = build m4 pixmaps po $(ORTP_DIR) $(MS2_DIR) \
20
		coreapi console gtk share scripts
aymeric's avatar
aymeric committed
21 22


simorl's avatar
simorl committed
23 24 25

ACLOCAL_FLAGS=-I$(top_srcdir)/m4

26
OPTIONAL_SOUNDS=\
simorl's avatar
simorl committed
27 28
		share/sounds/linphone/rings/synth.wav \
		share/sounds/linphone/rings/tapping.wav \
29 30 31
		share/sounds/linphone/rings/orig.wav \
		share/sounds/linphone/rings/sweet.wav \
		share/sounds/linphone/rings/rock.wav
simorl's avatar
simorl committed
32

33

34 35 36 37 38 39 40 41
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= \
42
	bin/linphone.exe \
43 44 45 46 47 48 49 50
	lib/*.la \
	share/linphone \
	share/pixmaps \
	share/locale \
	share/gnome \
	$(OPTIONAL_SOUNDS)


Simon Morlat's avatar
Simon Morlat committed
51
GTK_PREFIX=/
Simon Morlat's avatar
Simon Morlat committed
52
GTK_THEME=Outcrop
53
GTK_FILELIST=gtk+-2.22.1.filelist
simorl's avatar
simorl committed
54 55 56 57 58 59
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
60
ISCC=ISCC.exe
simorl's avatar
simorl committed
61
PACKAGE_WIN32_FILELIST=$(PACKAGE)-win32.filelist
62
PACKAGE_BUNDLE_FILE=$(top_srcdir)/build/macos/$(PACKAGE).bundle
simorl's avatar
simorl committed
63

smorlat's avatar
smorlat committed
64
EXTRA_DIST = config.rpath  BUGS linphone.kdevelop  \
aymeric's avatar
aymeric committed
65
				README.arm \
simorl's avatar
cleanup  
simorl committed
66
				README.mingw \
67
				README.macos \
aymeric's avatar
aymeric committed
68
				autogen.sh \
simorl's avatar
simorl committed
69 70 71 72 73
				linphone.spec.in \
				$(GTK_FILELIST) \
				gen-gtkfilelist.sh \
				$(LINPHONEDEPS_FILELIST) \
				$(ISS_SCRIPT).in
aymeric's avatar
aymeric committed
74

75
DISTCLEANFILES= $(ISS_SCRIPT) $(PACKAGE_WIN32_FILELIST)
76

77
CLEANFILES=Portfile Portfile-devel
smorlat's avatar
smorlat committed
78

aymeric's avatar
aymeric committed
79 80
# `make rpm'

smorlat's avatar
smorlat committed
81
all-local: linphone.spec linphone.iss
82

aymeric's avatar
aymeric committed
83 84 85 86 87
linphone.spec: linphone.spec.in

.phony: rpm
rpm:
	$(MAKE) dist
88 89
	cd oRTP && $(MAKE) dist && mv -f ortp*.tar.gz ../
	cd mediastreamer2 && $(MAKE) dist && mv -f mediastreamer*.tar.gz ../
aymeric's avatar
aymeric committed
90 91 92 93 94 95 96 97
# Create "Specfile" at the same level as the tarball content
	-rm -f $(PACKAGE)-$(VERSION).tar
	gunzip $(PACKAGE)-$(VERSION).tar.gz
	cp $(PACKAGE).spec Specfile
	tar --append --file=$(PACKAGE)-$(VERSION).tar Specfile
	gzip $(PACKAGE)-$(VERSION).tar
# <https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=2068410>
	TAR_OPTIONS=--wildcards rpmbuild -ta --clean --rmsource --rmspec $(PACKAGE)-$(VERSION).tar.gz
98 99 100

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

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
Simon Morlat's avatar
Simon Morlat committed
110 111 112 113 114
	cp /mingw/bin/libgcc_s*.dll \
		/mingw/bin/libstdc++-6.dll \
		/mingw/bin/libintl-8.dll \
		/mingw/bin/libiconv-2.dll \
		$(INSTALLDIR_WITH_PREFIX)/bin/.
115

116

simorl's avatar
simorl committed
117 118 119 120 121 122 123 124 125
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
126 127
	mkdir -p  $(INSTALLDIR_WITH_PREFIX)/share/themes && \
	cp -rf share/themes/$(GTK_THEME) $(INSTALLDIR_WITH_PREFIX)/share/themes/.
128 129 130 131 132 133

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

144 145 146 147 148 149 150 151 152 153 154 155
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) *

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

setup.exe: filelist
simorl's avatar
simorl committed
167 168 169 170 171 172 173 174
	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)

175
newdate:
176
	cd gtk && $(MAKE) newdate
177

178

smorlat's avatar
smorlat committed
179
Portfile:	$(top_srcdir)/scripts/Portfile.tmpl dist
smorlat's avatar
smorlat committed
180
	sed -e 's/\@VERSION\@/$(LINPHONE_VERSION)/g' \
smorlat's avatar
smorlat committed
181
	  -e 's/\@LINPHONE_MD5\@/$(shell md5sum linphone-$(VERSION).tar.gz | awk {'print $$1'})/' < $< > $@
smorlat's avatar
smorlat committed
182

smorlat's avatar
smorlat committed
183 184 185
Portfile-devel:	$(top_srcdir)/scripts/Portfile-devel.tmpl dist
	sed -e 's/\@VERSION\@/$(LINPHONE_VERSION)/g' \
	  -e 's/\@LINPHONE_MD5\@/$(shell md5sum linphone-$(VERSION).tar.gz | awk {'print $$1'})/' < $< > $@
smorlat's avatar
smorlat committed
186

187 188 189 190 191 192 193
bundle:
	rm -rf $(INSTALLDIR)
	mkdir -p $(INSTALLDIR)
	make install DESTDIR=$(INSTALLDIR)
	LINPHONE_INSTALL_PREFIX=$(INSTALLDIR_WITH_PREFIX) \
	LIBLINPHONE_INSTALL_PREFIX=$(INSTALLDIR_WITH_PREFIX) \
	ige-mac-bundler $(PACKAGE_BUNDLE_FILE)
Simon Morlat's avatar
Simon Morlat committed
194
	cd $$HOME/Desktop && zip -r Linphone-$(VERSION).app.zip Linphone.app
195 196 197