]> git.sesse.net Git - vlc/blob - extras/contrib/Makefile
contribs: updated binary package for Mac OS X (i686 and x86_64 only for now)
[vlc] / extras / contrib / Makefile
1 # ***************************************************************************
2 # Makefile : Build vlc-contrib files
3 # ***************************************************************************
4 # Copyright (C) 2003-2006 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 # This program is free software; you can redistribute it and/or modify
12 # it under the terms of the GNU General Public License as published by
13 # the Free Software Foundation; either version 2 of the License, or    
14 # (at your option) any later version.
15 #
16 # This program is distributed in the hope that it will be useful,
17 # but WITHOUT ANY WARRANTY; without even the implied warranty of
18 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19 # GNU General Public License for more details.
20 #
21 # You should have received a copy of the GNU General Public License
22 # along with this program; if not, write to the Free Software
23 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
24 # ***************************************************************************
25
26 include ./config.mak
27
28 BUILDDIRS = bin doc etc include info lib man sbin share tmp gecko-sdk
29
30 ifdef HAVE_DARWIN_OS
31 TARGETALL=using-bin
32 else
33 TARGETALL=using-src
34 endif
35
36 all: $(TARGETALL)
37
38 using-src:
39         $(MAKE) -C src
40
41 # shortcut
42 src: using-src
43
44 ifdef HAVE_DARWIN_OS
45
46 ifdef HAVE_DARWIN_OS_ON_INTEL
47 CONTRIBREV=6
48 else
49 CONTRIBREV=5
50 endif
51 contrib-macosx-$(ARCH)-$(CONTRIBREV).tar.bz2:
52         $(WGET) ftp://ftp.videolan.org/pub/videolan/testing/contrib/$@
53
54 using-bin: contrib-macosx-$(ARCH)-$(CONTRIBREV).tar.bz2
55         @if test -d tmp; then \
56                 echo "Move away ./tmp, it's in the way" ; \
57                 exit 1 ; \
58         fi
59         mkdir tmp
60         (cd tmp && tar jxvf ../$<)
61         ./change_prefix.sh tmp @@CONTRIB_PREFIX@@  $(PREFIX)
62         for dir in `(cd tmp && find . -type d)`; do mkdir -p -- $$dir; done
63         for i in `(cd tmp && find . -not -type d)`; do mv -f tmp/$$i $$i; done
64         rm -rf tmp
65 endif
66
67 clean-src:
68         rm -rf $(BUILDDIRS)
69         $(MAKE) -C src clean-src
70
71 clean-bin:
72         rm -rf $(BUILDDIRS)
73         $(MAKE) -C src clean-dots
74
75 clean:
76         $(MAKE) clean-src
77         rm -rf config.mak distro.mak
78
79 bin: using-bin
80
81 package-macosx:
82         @if test -d tmp; then \
83                 echo "Move away ./tmp, it's in the way" ; \
84                 exit 1 ; \
85         fi
86         mkdir tmp
87         tar cf - bin sbin include lib share/aclocal* share/autoconf* \
88                 share/automake* share/gettext* share/libtool* gecko-sdk \
89                 | (cd tmp; tar xf -)
90         ./change_prefix.sh tmp $(PREFIX) @@CONTRIB_PREFIX@@
91         (cd tmp; tar cf - .) | bzip2 -c > contrib-macosx.tar.bz2
92         rm -rf tmp
93
94 DISTDIR = usr/win32
95
96 package-win32:
97         @if test -d tmp; then \
98                 echo "Move away ./tmp, it's in the way" ; \
99                 exit 1 ; \
100         fi
101         mkdir -p tmp/$(DISTDIR)
102         tar cf - --dereference bin sbin include lib share/aclocal*\
103                 share/autoconf* share/qt4* \
104                 share/automake* share/gettext* gecko-sdk\
105                 | (cd tmp/$(DISTDIR); tar xpf -)
106 #kludge for live.com
107         mkdir -p tmp/$(DISTDIR)/live.com
108         for i in groupsock liveMedia UsageEnvironment BasicUsageEnvironment; do \
109                 mkdir -p  tmp/$(DISTDIR)/live.com/$$i/include; \
110                 cp -r src/live/$$i/include tmp/$(DISTDIR)/live.com/$$i; \
111                 cp src/live/$$i/lib$${i}.a  tmp/$(DISTDIR)/live.com/$$i; \
112         done;
113 # Change Prefix.
114         ./change_prefix.sh tmp $(PREFIX) $(DISTDIR)
115 # Hack for qt4
116         (cd tmp/$(DISTDIR)/bin; mv uic.exe uic.ex; mv rcc.exe rcc.ex; mv moc.exe moc.ex)
117 #       Remove unused and potentially harmful files     
118         (cd tmp/$(DISTDIR)/bin; rm -rfv *.exe; chmod a+x *)
119 # Hack for qt4
120         (cd tmp/$(DISTDIR)/bin; mv uic.ex uic.exe; mv rcc.ex rcc.exe; mv moc.ex moc.exe)
121 # Tar it.
122         (cd tmp; tar cf - $(DISTDIR)) | bzip2 -c > contrib-`date +%Y%m%d`-win32-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
123         rm -rf tmp
124
125 .PHONY: all clean-src clean-bin clean package-macosx package-win32