1 # -*- mode: gnumakefile; tab-width: 8; indent-tabs-mode: t; -*-
5 # ***** BEGIN GPL LICENSE BLOCK *****
7 # This program is free software; you can redistribute it and/or
8 # modify it under the terms of the GNU General Public License
9 # as published by the Free Software Foundation; either version 2
10 # of the License, or (at your option) any later version.
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with this program; if not, write to the Free Software Foundation,
19 # Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 # The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
22 # All rights reserved.
24 # The Original Code is: all of this file.
26 # Contributor(s): none yet.
28 # ***** END GPL LICENSE BLOCK *****
30 include nan_definitions.mk
32 export VERSION := $(shell ./getversion.py)
34 BLENDNAME=blender-$(VERSION)-$(CONFIG_GUESS)-py$(NAN_PYTHON_VERSION)$(TYPE)
35 export DISTDIR=$(NAN_OBJDIR)/$(BLENDNAME)
36 export CONFDIR=$(DISTDIR)/.blender
38 ifeq ($(OS),$(findstring $(OS), "freebsd irix linux openbsd solaris"))
51 # don"t build plugins on irix if using gcc
53 ifeq ($(IRIX_USE_GCC), true)
82 ifeq ($(WITH_BF_STATICOPENGL), true)
83 @$(MAKE) pkg TYPE="-static"
86 # OS independent targets below:
90 package: version makedirs
93 @#echo "****> Install text"
94 @cp text/blender.html $(DISTDIR)
95 @cp text/*.txt $(DISTDIR)
96 @cp text/*.pdf $(DISTDIR)
97 ifeq ($(FREEDESKTOP), true)
98 @#echo "****> Install freedesktop icons"
99 @mkdir $(DISTDIR)/icons
100 @mkdir $(DISTDIR)/icons/16x16
101 @cp freedesktop/icons/16x16/blender.png $(DISTDIR)/icons/16x16
102 @mkdir $(DISTDIR)/icons/22x22
103 @cp freedesktop/icons/22x22/blender.png $(DISTDIR)/icons/22x22
104 @mkdir $(DISTDIR)/icons/32x32
105 @cp freedesktop/icons/32x32/blender.png $(DISTDIR)/icons/32x32
106 @mkdir $(DISTDIR)/icons/scalable
107 @cp freedesktop/icons/scalable/blender.svg $(DISTDIR)/icons/scalable
109 @echo "----> Make Config dir .blender"
111 @# possible overruling .txt text documents
112 @[ ! -d $(CONFIG_GUESS)/text ] || \
113 cp -f $(CONFIG_GUESS)/text/*.txt $(DISTDIR)
114 #on OS X the contents of the .blender dir is already inside the bundle
115 ifneq ($(OS), darwin)
116 @[ ! -d $(OCGDIR)/bin/.blender ] || \
117 cp -r $(OCGDIR)/bin/.blender $(DISTDIR)
118 @cp $(NANBLENDERHOME)/bin/.blender/.Blanguages $(CONFDIR)
119 @cp $(NANBLENDERHOME)/bin/.blender/.bfont.ttf $(CONFDIR)
121 @echo "----> Copy blender$(EXT0) executable"
122 ifeq ($(TYPE),-static)
123 @cp $(OCGDIR)/bin/blenderstatic$(EXT0) $(DISTDIR)/blender$(EXT0)
126 @cp -r $(OCGDIR)/bin/blender$(EXT0) $(DISTDIR)/Blender$(EXT0)
128 @cp $(OCGDIR)/bin/blender$(EXT0) $(DISTDIR)/blender$(EXT0)
130 @if [ -f $(OCGDIR)/bin/blenderplayer$(EXTO) ]; then \
131 cp $(OCGDIR)/bin/blenderplayer$(EXTO) \
132 $(DISTDIR)/blenderplayer$(EXTO) ; \
136 ifneq ($(NOPLUGINS),true)
137 @echo "----> Copy and compile plugins"
138 @cp -r plugins $(DISTDIR)/plugins
139 @mkdir -p $(DISTDIR)/plugins/include
140 @cp ../source/blender/blenpluginapi/*.h $(DISTDIR)/plugins/include/
141 @chmod 755 $(DISTDIR)/plugins/bmake
142 @$(MAKE) -C $(DISTDIR)/plugins all > /dev/null || exit 1;
143 @rm -f $(DISTDIR)/plugins/*/*.o
145 #on OS X the plugins move to the installation directory
147 @mkdir -p $(CONFDIR)/plugins/sequence
148 @mkdir -p $(CONFDIR)/plugins/texture
149 @mv $(DISTDIR)/plugins/sequence/*.so $(CONFDIR)/plugins/sequence
150 @mv $(DISTDIR)/plugins/texture/*.so $(CONFDIR)/plugins/texture
154 @echo "----> Copy python infrastructure"
155 @[ ! -d scripts ] || cp -r scripts $(CONFDIR)/scripts
157 @echo "----> Copy python UI files"
158 @[ ! -d ui ] || cp -r ui $(CONFDIR)/ui
161 @echo "----> Copy python modules"
162 @mkdir $(CONFDIR)/python/
163 @unzip -q $(LCGDIR)/release/python.zip -d $(CONFDIR)/python/
167 @echo "----> Move .blender to .app/Contents/MacOS/"
168 @rm -fr $(DISTDIR)/blender$(EXT0)/Contents/MacOS/.blender
169 @mv $(DISTDIR)/.blender $(DISTDIR)/blender$(EXT0)/Contents/MacOS/
172 ifneq ($(NOSTRIP),true)
173 @echo "----> Strip blender executable"
175 @strip -x $(DISTDIR)/blender$(EXT0)/Contents/MacOS/blender
177 @strip -x $(DISTDIR)/blender$(EXT0)
178 @if [ -f $(DISTDIR)/blenderplayer$(EXTO) ]; then \
179 strip -x $(DISTDIR)/blenderplayer$(EXT0) ; \
183 @[ ! -x $(CONFIG_GUESS)/specific.sh ] || (\
184 echo "**--> Execute specific.sh in $(CONFIG_GUESS)/" && \
185 cd $(CONFIG_GUESS) && ./specific.sh )
186 @echo "----> Cleaning .svn metadata directories"
187 @find $(DISTDIR) -type d -name ".svn" | xargs rm -fr
190 @echo "----> Create distribution file $(BLENDNAME)$(EXT1)"
191 @#enable the next sleep if you get 'tar file changed while reading'
193 rm -f $(NAN_OBJDIR)/$(VERSION)/$(BLENDNAME)$(EXT1)*
194 @cd $(NAN_OBJDIR) && $(TAR) $(TARFLAGS) $(VERSION)/$(BLENDNAME)$(EXT1) $(BLENDNAME)
196 @echo "----> Compressing distribution to $(BLENDNAME)$(EXT1)$(EXT2)"
197 @$(COMPRESS) $(COMPRESSFLAGS) $(NAN_OBJDIR)/$(VERSION)/$(BLENDNAME)$(EXT1)
199 @#echo "****> Clean up temporary distribution directory"
201 @echo "****> $(NAN_OBJDIR)/$(VERSION)/$(BLENDNAME)$(EXT1)$(EXT2) is ready"
204 @echo "*---> Create $(BLENDNAME) package"
207 @echo "****> Create package directory $(VERSION) if necessary"
208 @[ -d $(NAN_OBJDIR)/$(VERSION) ] || mkdir $(NAN_OBJDIR)/$(VERSION)
209 @echo "****> Remove and recreate temporary distribution directory"