]> git.sesse.net Git - vlc/blob - extras/contrib/Makefile
contrib: Add using-bin target.
[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 vlc-lib tmp gecko-sdk
29
30 all:
31         $(MAKE) -C src
32
33 ifdef HAVE_DARWIN_OS
34
35 CONTRIBREV=20080922
36 contrib-macosx-$(ARCH)-$(CONTRIBREV).tar.bz2:
37         $(WGET) ftp://ftp.videolan.org/pub/videolan/testing/contrib/contrib-macosx-$(ARCH)-$(CONTRIBREV).tar.bz2
38
39 using-bin: contrib-macosx-$(ARCH)-$(CONTRIBREV).tar.bz2
40         @if test -d tmp; then \
41                 echo "Move away ./tmp, it's in the way" ; \
42                 exit 1 ; \
43         fi
44         mkdir tmp
45         (cd tmp && tar jxvf ../contrib-macosx.tar.bz2)
46         ./change_prefix.sh tmp @@CONTRIB_PREFIX@@  $(PREFIX)
47         for dir in `(cd tmp && find . -type d)`; do mkdir -p -- $$dir; done
48         for i in `(cd tmp && find . -not -type d)`; do mv -f tmp/$$i $$i; done
49         rm -rf tmp
50 endif
51
52 clean-src:
53         rm -rf $(BUILDDIRS)
54         $(MAKE) -C src clean-src
55
56 clean-bin:
57         rm -rf $(BUILDDIRS)
58         $(MAKE) -C src clean-dots
59
60 clean:
61         $(MAKE) clean-src
62         rm -rf config.mak distro.mak
63
64 bin: using-bin
65
66 package-macosx:
67         @if test -d tmp; then \
68                 echo "Move away ./tmp, it's in the way" ; \
69                 exit 1 ; \
70         fi
71         mkdir tmp
72         tar cf - bin sbin include lib vlc-lib share/aclocal* share/autoconf* \
73                 share/automake* share/gettext* \
74                 | (cd tmp; tar xf -)
75         ./change_prefix.sh tmp $(PREFIX) @@CONTRIB_PREFIX@@
76         rm -rf tmp
77
78 DISTDIR = usr/win32
79
80 package-win32:
81         @if test -d tmp; then \
82                 echo "Move away ./tmp, it's in the way" ; \
83                 exit 1 ; \
84         fi
85         mkdir -p tmp/$(DISTDIR)
86         tar cf - --dereference bin sbin include lib share/aclocal*\
87                 share/autoconf* share/qt4* \
88                 share/automake* share/gettext* gecko-sdk\
89                 | (cd tmp/$(DISTDIR); tar xpf -)
90 #kludge for live.com
91         mkdir -p tmp/$(DISTDIR)/live.com
92         for i in groupsock liveMedia UsageEnvironment BasicUsageEnvironment; do \
93                 mkdir -p  tmp/$(DISTDIR)/live.com/$$i/include; \
94                 cp -r src/live/$$i/include tmp/$(DISTDIR)/live.com/$$i; \
95                 cp src/live/$$i/lib$${i}.a  tmp/$(DISTDIR)/live.com/$$i; \
96         done;
97 # Change Prefix.
98         ./change_prefix.sh tmp $(PREFIX) $(DISTDIR)
99 # Hack for qt4
100         (cd tmp/$(DISTDIR)/bin; mv uic.exe uic.ex; mv rcc.exe rcc.ex; mv moc.exe moc.ex)
101 #       Remove unused and potentially harmful files     
102         (cd tmp/$(DISTDIR)/bin; rm -rfv *.exe; chmod a+x *)
103 # Hack for qt4
104         (cd tmp/$(DISTDIR)/bin; mv uic.ex uic.exe; mv rcc.ex rcc.exe; mv moc.ex moc.exe)
105 # Tar it.
106         (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
107         rm -rf tmp
108
109 .PHONY: all clean-src clean-bin clean package-macosx package-win32