]> git.sesse.net Git - vlc/blob - extras/contrib/Makefile
contribs: another contrib package fixing the libiconv issues on Snow Leopard. Intel...
[vlc] / extras / contrib / Makefile
1 # ***************************************************************************
2 # Makefile : Build vlc-contrib files
3 # ***************************************************************************
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 #          Felix Paul Kühne <fkuehne at videolan dot org>
11 #
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.
16 #
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.
21 #
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 # ***************************************************************************
26
27 include ./config.mak
28
29 BUILDDIRS = bin doc etc include info lib man sbin share tmp gecko-sdk Sparkle
30
31 ifdef HAVE_DARWIN_OS
32 TARGETALL=using-bin
33 else
34 TARGETALL=using-src
35 endif
36
37 all: $(TARGETALL)
38
39 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 # shortcut
46 src: using-src
47
48 ifdef HAVE_DARWIN_OS
49
50 ifdef HAVE_DARWIN_OS_ON_INTEL
51 CONTRIBREV=19
52 else
53 CONTRIBREV=18
54 endif
55 contrib-macosx-$(ARCH)-$(CONTRIBREV).tar.bz2:
56         $(WGET) http://downloads.videolan.org/pub/videolan/testing/contrib/$@
57
58 using-bin: contrib-macosx-$(ARCH)-$(CONTRIBREV).tar.bz2
59         @if test -d tmp; then \
60                 echo "Move away ./tmp, it's in the way" ; \
61                 exit 1 ; \
62         fi
63         mkdir tmp
64         (cd tmp && tar jxvf ../$<)
65         ./change_prefix.sh tmp @@CONTRIB_PREFIX@@  $(PREFIX)
66         (cd tmp && find . -type d) | while read dir; do mkdir -p -- "$$dir"; done
67         (cd tmp && find . -not -type d) | while read i; do mv -f -- tmp/"$$i" "$$i"; done
68         rm -rf tmp
69     # libiconv.la is no longer present on Snow Leopard, so fix possible references to it, which would
70     # result in linking issues
71 ifdef HAVE_DARWIN_10
72         (cd $(PREFIX)/lib && sed -e 's%/usr/lib/libiconv.la%$(PREFIX)/lib/libiconv.la%g' -i.orig *.la && rm -f *.la.orig)
73 endif
74 endif
75
76 clean-src:
77         rm -rf $(BUILDDIRS)
78         $(MAKE) -C src clean-src
79
80 clean-bin:
81         rm -rf $(BUILDDIRS)
82         $(MAKE) -C src clean-dots
83
84 clean:
85         $(MAKE) clean-src
86         rm -rf config.mak distro.mak
87
88 bin: using-bin
89
90 package-macosx:
91         @if test -d tmp; then \
92                 echo "Move away ./tmp, it's in the way" ; \
93                 exit 1 ; \
94         fi
95         mkdir tmp
96         tar cf - bin sbin include lib share/aclocal* share/autoconf* \
97                 share/automake* share/gettext* share/libtool* gecko-sdk Sparkle \
98                 | (cd tmp; tar xf -)
99         ./change_prefix.sh tmp $(PREFIX) @@CONTRIB_PREFIX@@
100         (cd tmp; tar cf - .) | bzip2 -c > contrib-macosx.tar.bz2
101         rm -rf tmp
102         rm -f contrib-macosx-$(ARCH)-$(CONTRIBREV).tar.bz2
103         mv contrib-macosx.tar.bz2 contrib-macosx-$(ARCH)-$(CONTRIBREV).tar.bz2
104
105 DISTDIR = usr/win32
106
107 package-win32:
108         @if test -d tmp; then \
109                 echo "Move away ./tmp, it's in the way" ; \
110                 exit 1 ; \
111         fi
112         mkdir -p tmp/$(DISTDIR)
113         tar cf - --dereference bin sbin include lib share/aclocal*\
114                 share/autoconf* share/qt4* \
115                 share/automake* share/gettext* gecko-sdk\
116                 | (cd tmp/$(DISTDIR); tar xpf -)
117 #kludge for live.com
118         mkdir -p tmp/$(DISTDIR)/live.com
119         for i in groupsock liveMedia UsageEnvironment BasicUsageEnvironment; do \
120                 mkdir -p  tmp/$(DISTDIR)/live.com/$$i/include; \
121                 cp -r src/live/$$i/include tmp/$(DISTDIR)/live.com/$$i; \
122                 cp src/live/$$i/lib$${i}.a  tmp/$(DISTDIR)/live.com/$$i; \
123         done;
124 # Change Prefix.
125         ./change_prefix.sh tmp $(PREFIX) $(DISTDIR)
126 # Hack for qt4
127         (cd tmp/$(DISTDIR)/bin; mv uic.exe uic.ex; mv rcc.exe rcc.ex; mv moc.exe moc.ex)
128 #       Remove unused and potentially harmful files     
129         (cd tmp/$(DISTDIR)/bin; rm -rfv *.exe; chmod a+x *)
130 # Hack for qt4
131         (cd tmp/$(DISTDIR)/bin; mv uic.ex uic.exe; mv rcc.ex rcc.exe; mv moc.ex moc.exe)
132 # Tar it.
133         (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
134         rm -rf tmp
135
136 .PHONY: all clean-src clean-bin clean package-macosx package-win32