Fix non-ASCII comment
[vlc/asuraparaju-public.git] / extras / contrib / Makefile
blobcd331af28b282eaa02b995f9602abd4e81330a5f
1 # ***************************************************************************
2 # Makefile : Build vlc-contrib files
3 # ***************************************************************************
4 # Copyright (C) 2003-2010 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 # Felix Paul Kühne <fkuehne at videolan dot org>
12 # This program is free software; you can redistribute it and/or modify
13 # it under the terms of the GNU General Public License as published by
14 # the Free Software Foundation; either version 2 of the License, or
15 # (at your option) any later version.
17 # This program is distributed in the hope that it will be useful,
18 # but WITHOUT ANY WARRANTY; without even the implied warranty of
19 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 # GNU General Public License for more details.
22 # You should have received a copy of the GNU General Public License
23 # along with this program; if not, write to the Free Software
24 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
25 # ***************************************************************************
27 include ./config.mak
29 BUILDDIRS = hosts build
31 ifdef HAVE_DARWIN_OS
32 TARGETALL=using-bin
33 else
34 TARGETALL=using-src
35 endif
37 all: $(TARGETALL)
39 using-src:
40 $(MAKE) -C src
41 #Copy aclocal files
42 # This is necessary for --missing aclocal to succeed after a
43 # configure.ac/Makefile.am change in the vlc root dir
44 cp -R $(PREFIX)/share/aclocal/* ../../m4/
46 ifdef HAVE_DARWIN_10
47 (cd $(PREFIX)/lib && sed -e 's%/usr/lib/libiconv.la%$(PREFIX)/lib/libiconv.la%g' -i.orig *.la && rm -f *.la.orig)
48 endif
50 # shortcut
51 src: using-src
53 ifdef HAVE_DARWIN_OS
55 CONTRIBREV=34
57 contrib-macosx-$(ARCH)-$(CONTRIBREV).tar.bz2:
58 $(WGET) http://downloads.videolan.org/pub/videolan/testing/contrib/$@
60 hosts/$(HOST)/.$(CONTRIBREV): contrib-macosx-$(ARCH)-$(CONTRIBREV).tar.bz2
61 @if test -d tmp; then \
62 echo "Move away ./tmp, it's in the way" ; \
63 exit 1 ; \
65 mkdir tmp
66 mkdir -p $(PREFIX)
67 (cd tmp && tar jxvf ../$<)
68 ./change_prefix.sh tmp @@CONTRIB_PREFIX@@ $(PREFIX)
69 (cd tmp && find . -type d) | while read dir; do mkdir -p -- "$(PREFIX)/$$dir"; done
70 (cd tmp && find . -not -type d) | while read i; do mv -f -- tmp/"$$i" "$(PREFIX)/$$i"; done
71 rm -rf tmp
72 # install the gecko-sdk, which isn't part of the package for size and speed reasons
73 (cd src && rm -rf *gecko* && $(MAKE) .gecko)
74 # libiconv.la is no longer present on Snow Leopard, so fix possible references to it, which would
75 # result in linking issues
76 ifdef HAVE_DARWIN_10
77 (cd $(PREFIX)/lib && sed -e 's%/usr/lib/libiconv.la%$(PREFIX)/lib/libiconv.la%g' -i.orig *.la && rm -f *.la.orig)
78 (cd src && rm -f .iconv && $(MAKE) .iconv)
79 endif
80 touch hosts/$(HOST)/.$(CONTRIBREV)
82 using-bin: hosts/$(HOST)/.$(CONTRIBREV)
84 endif
86 clean:
87 rm -rf $(BUILDDIRS)
88 $(MAKE) -C src clean
90 clean-bin:
91 rm -rf $(BUILDDIRS)
92 $(MAKE) -C src clean-dots
94 distclean:
95 $(MAKE) clean
96 $(MAKE) -C src clean-src
97 rm -rf config.mak distro.mak
99 bin: using-bin
101 package-macosx:
102 @if test -d tmp; then \
103 echo "Move away ./tmp, it's in the way" ; \
104 exit 1 ; \
106 mkdir tmp
107 (cd $(PREFIX); tar cf - Sparkle bin sbin include lib share/aclocal* share/autoconf* \
108 share/automake* share/gettext* share/libtool*) | (cd tmp; tar xf -)
109 ./change_prefix.sh tmp $(PREFIX) @@CONTRIB_PREFIX@@
110 (cd tmp; tar cf - .) | bzip2 -c > contrib-macosx.tar.bz2
111 rm -rf tmp
112 rm -f contrib-macosx-$(ARCH)-$(CONTRIBREV).tar.bz2
113 mv contrib-macosx.tar.bz2 contrib-macosx-$(ARCH)-$(CONTRIBREV).tar.bz2
115 DISTDIR = usr/win$*
117 package-win%:
118 @if test -d tmp; then \
119 echo "Move away ./tmp, it's in the way" ; \
120 exit 1 ; \
122 mkdir -p tmp/$(DISTDIR)
123 (cd $(PREFIX); tar cf - --dereference bin sbin include lib share/aclocal*\
124 share/autoconf* share/qt4* \
125 share/automake* share/gettext* gecko-sdk)\
126 | (cd tmp/$(DISTDIR); tar xpf -)
127 #kludge for live.com
128 mkdir -p tmp/$(DISTDIR)/live.com
129 for i in groupsock liveMedia UsageEnvironment BasicUsageEnvironment; do \
130 mkdir -p tmp/$(DISTDIR)/live.com/$$i/include; \
131 cp -r src/live/$$i/include tmp/$(DISTDIR)/live.com/$$i; \
132 cp src/live/$$i/lib$${i}.a tmp/$(DISTDIR)/live.com/$$i; \
133 done;
134 # Change Prefix.
135 ./change_prefix.sh tmp $(PREFIX) $(DISTDIR)
136 # Remove unused and potentially harmful files (but skip qt4 executables)
137 (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)
138 # Tar it.
139 (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#define CONCAT2(a,b) a##b\n#define CONCAT(a,b) CONCAT2(a,b)\n#ifdef __MINGW64_VERSION_MAJOR\nCONCAT(CONCAT(__MINGW64_VERSION_MAJOR,.),__MINGW64_VERSION_MINOR)\n#else\n__MINGW32_VERSION\n#endif"|$(CC) -E -|tail -1`-only.tar.bz2
140 rm -rf tmp
142 .PHONY: all clean-src clean-bin clean package-macosx