Makefile 4.38 KB
Newer Older
1 2 3
# ***************************************************************************
# Makefile : Build vlc-contrib files
# ***************************************************************************
4
# Copyright (C) 2003-2009 the VideoLAN team
5
# $Id$
6 7
# 
# Authors: Christophe Massiot <massiot@via.ecp.fr>
8
#          Derk-Jan Hartman <hartman at videolan dot org>
9
#          Christophe Mutricy <xtophe at videolan dot org>
10 11
#          Felix Paul Kühne <fkuehne at videolan dot org>
#
12 13 14 15 16 17 18 19 20 21 22 23
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or    
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
Antoine Cellerier's avatar
Antoine Cellerier committed
24
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
25 26 27 28
# ***************************************************************************

include ./config.mak

Pierre d'Herbemont's avatar
Pierre d'Herbemont committed
29
BUILDDIRS = hosts build
30

31
ifdef HAVE_DARWIN_OS
32
TARGETALL=using-bin
33 34 35 36 37 38 39
else
TARGETALL=using-src
endif

all: $(TARGETALL)

using-src:
40
	$(MAKE) -C src
41
ifdef HAVE_DARWIN_10
42
	(cd $(PREFIX)/lib && sed -e 's%/usr/lib/libiconv.la%$(PREFIX)/lib/libiconv.la%g' -i.orig *.la && rm -f *.la.orig)
43
endif
44

45 46 47
# shortcut
src: using-src

48 49
ifdef HAVE_DARWIN_OS

50
CONTRIBREV=25
51

52
contrib-macosx-$(ARCH)-$(CONTRIBREV).tar.bz2:
53
	$(WGET) http://downloads.videolan.org/pub/videolan/testing/contrib/$@
54

55
hosts/$(HOST)/.$(CONTRIBREV): contrib-macosx-$(ARCH)-$(CONTRIBREV).tar.bz2
56 57 58 59 60
	@if test -d tmp; then \
		echo "Move away ./tmp, it's in the way" ; \
		exit 1 ; \
	fi
	mkdir tmp
61
	mkdir -p $(PREFIX)
62
	(cd tmp && tar jxvf ../$<)
63
	./change_prefix.sh tmp @@CONTRIB_PREFIX@@  $(PREFIX)
64 65
	(cd tmp && find . -type d) | while read dir; do mkdir -p -- "$(PREFIX)/$$dir"; done
	(cd tmp && find . -not -type d) | while read i; do mv -f -- tmp/"$$i" "$(PREFIX)/$$i"; done
66
	rm -rf tmp
67 68 69
    # libiconv.la is no longer present on Snow Leopard, so fix possible references to it, which would
    # result in linking issues
ifdef HAVE_DARWIN_10
70
	(cd $(PREFIX)/lib && sed -e 's%/usr/lib/libiconv.la%$(PREFIX)/lib/libiconv.la%g' -i.orig *.la && rm -f *.la.orig)
71
	(cd src && rm -f .iconv && $(MAKE) .iconv)
72
endif
73
	touch hosts/$(HOST)/.$(CONTRIBREV)
74 75 76

using-bin: hosts/$(HOST)/.$(CONTRIBREV) 

77
endif
Christophe Massiot's avatar
Christophe Massiot committed
78

79
clean:
80
	rm -rf $(BUILDDIRS)
81
	$(MAKE) -C src clean
82

83
clean-bin:
84 85 86
	rm -rf $(BUILDDIRS)
	$(MAKE) -C src clean-dots

87 88 89
distclean:
	$(MAKE) clean
	$(MAKE) -C src clean-src
Christophe Mutricy's avatar
Christophe Mutricy committed
90
	rm -rf config.mak distro.mak
91

92 93
bin: using-bin

94
package-macosx:
95 96 97 98 99
	@if test -d tmp; then \
		echo "Move away ./tmp, it's in the way" ; \
		exit 1 ; \
	fi
	mkdir tmp
100
	(cd $(PREFIX); tar cf - *) | (cd tmp; tar xf -)
101
	./change_prefix.sh tmp $(PREFIX) @@CONTRIB_PREFIX@@
102
	(cd tmp; tar cf - .) | bzip2 -c > contrib-macosx.tar.bz2
103
	rm -rf tmp
104 105
	rm -f contrib-macosx-$(ARCH)-$(CONTRIBREV).tar.bz2
	mv contrib-macosx.tar.bz2 contrib-macosx-$(ARCH)-$(CONTRIBREV).tar.bz2
106

Pierre Ynard's avatar
Pierre Ynard committed
107
DISTDIR = usr/win$*
108

Pierre Ynard's avatar
Pierre Ynard committed
109
package-win%:
110 111 112 113
	@if test -d tmp; then \
		echo "Move away ./tmp, it's in the way" ; \
		exit 1 ; \
	fi
114
	mkdir -p tmp/$(DISTDIR)
115
	(cd $(PREFIX); tar cf - --dereference bin sbin include lib share/aclocal*\
116
		share/autoconf* share/qt4* \
117
		share/automake* share/gettext* gecko-sdk)\
118
		| (cd tmp/$(DISTDIR); tar xpf -)
119
#kludge for live.com
120
	mkdir -p tmp/$(DISTDIR)/live.com
121
	for i in groupsock liveMedia UsageEnvironment BasicUsageEnvironment; do \
122 123 124
		mkdir -p  tmp/$(DISTDIR)/live.com/$$i/include; \
		cp -r src/live/$$i/include tmp/$(DISTDIR)/live.com/$$i; \
		cp src/live/$$i/lib$${i}.a  tmp/$(DISTDIR)/live.com/$$i; \
125
	done;
126
# Change Prefix.
127
	./change_prefix.sh tmp $(PREFIX) $(DISTDIR)
Pierre Ynard's avatar
Pierre Ynard committed
128 129
# Remove unused and potentially harmful files (but skip qt4 executables)
	(cd tmp/$(DISTDIR)/bin && rm -fv `find . -name 'uic.exe' -o -name 'rcc.exe' -o -name 'moc.exe' -o -name '*.exe' -printf '%p '` && chmod a+x * || true)
130
# Tar it.
Pierre Ynard's avatar
Pierre Ynard committed
131
	(cd tmp; tar cf - $(DISTDIR)) | bzip2 -c > contrib-`date +%Y%m%d`-win$*-bin-gcc-`$(CC) --version|head -n 1|cut -f 3 -d ' '`-runtime-`/bin/echo -e "#include <_mingw.h>\n__MINGW32_VERSION"|$(CC) -E -|grep -v ^#|grep -v ' '`-only.tar.bz2
132
	rm -rf tmp
Rafaël Carré's avatar
Rafaël Carré committed
133

Pierre Ynard's avatar
Pierre Ynard committed
134
.PHONY: all clean-src clean-bin clean package-macosx