Merge branch 'cb/render'
[plumiferos.git] / release / Makefile
blobb59c8a1c0a8e21c4984cab047cacbf854ad6e2d9
2 # $Id: Makefile 10681 2007-05-07 21:11:21Z sirdude $
4 # ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
6 # This program is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU General Public License
8 # as published by the Free Software Foundation; either version 2
9 # of the License, or (at your option) any later version. The Blender
10 # Foundation also sells licenses for use in proprietary software under
11 # the Blender License. See http://www.blender.org/BL/ for information
12 # about this.
14 # This program is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU General Public License for more details.
19 # You should have received a copy of the GNU General Public License
20 # along with this program; if not, write to the Free Software Foundation,
21 # Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23 # The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
24 # All rights reserved.
26 # The Original Code is: all of this file.
28 # Contributor(s): none yet.
30 # ***** END GPL/BL DUAL LICENSE BLOCK *****
32 include nan_definitions.mk
34 export VERSION := $(shell cat VERSION)
36 BLENDNAME=blender-$(VERSION)-$(CONFIG_GUESS)$(TYPE)
37 export DISTDIR=$(NAN_OBJDIR)/$(BLENDNAME)
38 export CONFDIR=$(DISTDIR)/.blender
40 ifeq ($(OS),beos)
41 TAR="zip"
42 TARFLAGS="-ry9"
43 EXT0=""
44 EXT1=".zip"
45 COMPRESS=""
46 EXT2=""
47 NOPLUGINS="true"
48 endif
50 ifeq ($(OS),$(findstring $(OS), "freebsd irix linux openbsd solaris"))
51 TAR="tar"
52 TARFLAGS="cf"
53 EXT0=""
54 EXT1=".tar"
55 COMPRESS="bzip2"
56 COMPRESSFLAGS="-f"
57 EXT2=".bz2"
58 endif
60 ifeq ($(OS),windows)
61 TAR="zip"
62 TARFLAGS="-r9"
63 EXT0=".exe"
64 EXT1=".zip"
65 NOPLUGINS="true"
66 NOSTRIP="true"
67 endif
69 ifeq ($(OS),darwin)
70 TAR="tar"
71 TARFLAGS="cf"
72 EXT0=".app"
73 EXT1=".tar"
74 COMPRESS="bzip2"
75 COMPRESSFLAGS="-f"
76 EXT2=".bz2"
77 endif
79 release: all
81 all:
82 @$(MAKE) pkg TYPE=""
83 ifeq ($(WITH_BF_STATICOPENGL), true)
84 @$(MAKE) pkg TYPE="-static"
85 endif
87 # OS independent targets below:
89 dist: all
91 package: version makedirs
93 install: package
94 @#echo "****> Install text"
95 @cp text/blender.html $(DISTDIR)
96 @cp text/*.txt $(DISTDIR)
97 @cp text/*.pdf $(DISTDIR)
98 ifeq ($(FREEDESKTOP), true)
99 @#echo "****> Install freedesktop icons"
100 @mkdir $(DISTDIR)/icons
101 @mkdir $(DISTDIR)/icons/16x16
102 @cp freedesktop/icons/16x16/blender.png $(DISTDIR)/icons/16x16
103 @mkdir $(DISTDIR)/icons/22x22
104 @cp freedesktop/icons/22x22/blender.png $(DISTDIR)/icons/22x22
105 @mkdir $(DISTDIR)/icons/32x32
106 @cp freedesktop/icons/32x32/blender.png $(DISTDIR)/icons/32x32
107 @mkdir $(DISTDIR)/icons/scalable
108 @cp freedesktop/icons/scalable/blender.svg $(DISTDIR)/icons/scalable
109 endif
110 @echo "----> Make Config dir .blender"
111 @mkdir -p $(CONFDIR)
112 @# possible overruling .txt text documents
113 @[ ! -d $(CONFIG_GUESS)/text ] || \
114 cp -f $(CONFIG_GUESS)/text/*.txt $(DISTDIR)
115 #on OS X the contents of the .blender dir is already inside the bundle
116 ifneq ($(OS), darwin)
117 @[ ! -d $(OCGDIR)/bin/.blender ] || \
118 cp -r $(OCGDIR)/bin/.blender $(DISTDIR)
119 cp $(NANBLENDERHOME)/bin/.blender/.Blanguages $(CONFDIR)
120 cp $(NANBLENDERHOME)/bin/.blender/.bfont.ttf $(CONFDIR)
121 endif
122 @echo "----> Copy blender$(EXT0) executable"
123 ifeq ($(TYPE),-static)
124 @cp $(OCGDIR)/bin/blenderstatic$(EXT0) $(DISTDIR)/blender$(EXT0)
125 else
126 ifeq ($(OS),darwin)
127 @cp -r $(OCGDIR)/bin/blender$(EXT0) $(DISTDIR)/Blender$(EXT0)
128 else
129 @cp $(OCGDIR)/bin/blender$(EXT0) $(DISTDIR)/blender$(EXT0)
130 endif
131 @if [ -f $(OCGDIR)/bin/blenderplayer$(EXTO) ]; then \
132 cp $(OCGDIR)/bin/blenderplayer$(EXTO) \
133 $(DISTDIR)/blenderplayer$(EXTO) ; \
135 endif
137 ifneq ($(NOPLUGINS),true)
138 @echo "----> Copy and compile plugins"
139 @cp -r plugins $(DISTDIR)/plugins
140 @mkdir -p $(DISTDIR)/plugins/include
141 @cp ../source/blender/blenpluginapi/*.h $(DISTDIR)/plugins/include/
142 @chmod 755 $(DISTDIR)/plugins/bmake
143 @$(MAKE) -C $(DISTDIR)/plugins all > /dev/null || exit 1;
144 @rm -fr $(DISTDIR)/plugins/CVS $(DISTDIR)/plugins/*/CVS \
145 $(DISTDIR)/plugins/*/*.o
147 #on OS X the plugins move to the installation directory
148 ifneq ($(OS),darwin)
149 @mkdir -p $(CONFDIR)/plugins/sequence
150 @mkdir -p $(CONFDIR)/plugins/texture
151 @mv $(DISTDIR)/plugins/sequence/*.so $(CONFDIR)/plugins/sequence
152 @mv $(DISTDIR)/plugins/texture/*.so $(CONFDIR)/plugins/texture
153 endif
154 endif
156 @echo "----> Copy python infrastructure"
157 @[ ! -d scripts ] || cp -r scripts $(CONFDIR)/scripts
158 @[ ! -d $(CONFDIR)/scripts ] || rm -fr $(CONFDIR)/scripts/CVS
160 ifeq ($(OS),darwin)
161 @echo "----> Move .blender to .app/Contents/MacOS/"
162 @rm -fr $(DISTDIR)/blender$(EXT0)/Contents/MacOS/.blender
163 @mv $(DISTDIR)/.blender $(DISTDIR)/blender$(EXT0)/Contents/MacOS/
164 endif
166 ifneq ($(NOSTRIP),true)
167 @echo "----> Strip blender executable"
168 ifeq ($(OS),darwin)
169 @strip -x $(DISTDIR)/blender$(EXT0)/Contents/MacOS/blender
170 else
171 @strip -x $(DISTDIR)/blender$(EXT0)
172 @if [ -f $(DISTDIR)/blenderplayer$(EXTO) ]; then \
173 strip -x $(DISTDIR)/blender$(EXT0) ; \
175 endif
176 endif
177 @[ ! -x $(CONFIG_GUESS)/specific.sh ] || (\
178 echo "**--> Execute specific.sh in $(CONFIG_GUESS)/" && \
179 cd $(CONFIG_GUESS) && ./specific.sh )
181 pkg: install
182 @echo "----> Create distribution file $(BLENDNAME)$(EXT1)"
183 @#enable the next sleep if you get 'tar file changed while reading'
184 @#sleep 10
185 rm -f $(NAN_OBJDIR)/$(VERSION)/$(BLENDNAME)$(EXT1)*
186 @cd $(NAN_OBJDIR) && $(TAR) $(TARFLAGS) $(VERSION)/$(BLENDNAME)$(EXT1) $(BLENDNAME)
187 ifdef COMPRESS
188 @echo "----> Compressing distribution to $(BLENDNAME)$(EXT1)$(EXT2)"
189 @$(COMPRESS) $(COMPRESSFLAGS) $(NAN_OBJDIR)/$(VERSION)/$(BLENDNAME)$(EXT1)
190 endif
191 @#echo "****> Clean up temporary distribution directory"
192 @rm -fr $(DISTDIR)
193 @echo "****> $(NAN_OBJDIR)/$(VERSION)/$(BLENDNAME)$(EXT1)$(EXT2) is ready"
195 version: FORCE
196 @echo "*---> Create $(BLENDNAME) package"
198 makedirs: FORCE
199 @#echo "****> Create package directory $(VERSION) if necessary"
200 @[ -d $(NAN_OBJDIR)/$(VERSION) ] || mkdir $(NAN_OBJDIR)/$(VERSION)
201 @#echo "****> Prepare temporary distribution directory"
202 @rm -fr $(DISTDIR)
203 @mkdir $(DISTDIR)
205 FORCE: