4 # ***** BEGIN GPL 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.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software Foundation,
18 # Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 # The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
21 # All rights reserved.
23 # The Original Code is: all of this file.
25 # Contributor(s): none yet.
27 # ***** END GPL LICENSE BLOCK *****
29 include nan_definitions.mk
31 export VERSION := $(shell ./getversion.py)
33 BLENDNAME=blender-$(VERSION)-$(CONFIG_GUESS)-py$(NAN_PYTHON_VERSION)$(TYPE)
34 export DISTDIR=$(NAN_OBJDIR)/$(BLENDNAME)
35 export CONFDIR=$(DISTDIR)/.blender
47 ifeq ($(OS),$(findstring $(OS), "freebsd irix linux openbsd solaris"))
60 # don"t build plugins on irix if using gcc
62 ifeq ($(IRIX_USE_GCC), true)
91 ifeq ($(WITH_BF_STATICOPENGL), true)
92 @$(MAKE) pkg TYPE="-static"
95 # OS independent targets below:
99 package: version makedirs
102 @#echo "****> Install text"
103 @cp text/blender.html $(DISTDIR)
104 @cp text/*.txt $(DISTDIR)
105 @cp text/*.pdf $(DISTDIR)
106 ifeq ($(FREEDESKTOP), true)
107 @#echo "****> Install freedesktop icons"
108 @mkdir $(DISTDIR)/icons
109 @mkdir $(DISTDIR)/icons/16x16
110 @cp freedesktop/icons/16x16/blender.png $(DISTDIR)/icons/16x16
111 @mkdir $(DISTDIR)/icons/22x22
112 @cp freedesktop/icons/22x22/blender.png $(DISTDIR)/icons/22x22
113 @mkdir $(DISTDIR)/icons/32x32
114 @cp freedesktop/icons/32x32/blender.png $(DISTDIR)/icons/32x32
115 @mkdir $(DISTDIR)/icons/scalable
116 @cp freedesktop/icons/scalable/blender.svg $(DISTDIR)/icons/scalable
118 @echo "----> Make Config dir .blender"
120 @# possible overruling .txt text documents
121 @[ ! -d $(CONFIG_GUESS)/text ] || \
122 cp -f $(CONFIG_GUESS)/text/*.txt $(DISTDIR)
123 #on OS X the contents of the .blender dir is already inside the bundle
124 ifneq ($(OS), darwin)
125 @[ ! -d $(OCGDIR)/bin/.blender ] || \
126 cp -r $(OCGDIR)/bin/.blender $(DISTDIR)
127 @cp $(NANBLENDERHOME)/bin/.blender/.Blanguages $(CONFDIR)
128 @cp $(NANBLENDERHOME)/bin/.blender/.bfont.ttf $(CONFDIR)
130 @echo "----> Copy blender$(EXT0) executable"
131 ifeq ($(TYPE),-static)
132 @cp $(OCGDIR)/bin/blenderstatic$(EXT0) $(DISTDIR)/blender$(EXT0)
135 @cp -r $(OCGDIR)/bin/blender$(EXT0) $(DISTDIR)/Blender$(EXT0)
137 @cp $(OCGDIR)/bin/blender$(EXT0) $(DISTDIR)/blender$(EXT0)
139 @if [ -f $(OCGDIR)/bin/blenderplayer$(EXTO) ]; then \
140 cp $(OCGDIR)/bin/blenderplayer$(EXTO) \
141 $(DISTDIR)/blenderplayer$(EXTO) ; \
145 ifneq ($(NOPLUGINS),true)
146 @echo "----> Copy and compile plugins"
147 @cp -r plugins $(DISTDIR)/plugins
148 @mkdir -p $(DISTDIR)/plugins/include
149 @cp ../source/blender/blenpluginapi/*.h $(DISTDIR)/plugins/include/
150 @chmod 755 $(DISTDIR)/plugins/bmake
151 @$(MAKE) -C $(DISTDIR)/plugins all > /dev/null || exit 1;
152 @rm -f $(DISTDIR)/plugins/*/*.o
154 #on OS X the plugins move to the installation directory
156 @mkdir -p $(CONFDIR)/plugins/sequence
157 @mkdir -p $(CONFDIR)/plugins/texture
158 @mv $(DISTDIR)/plugins/sequence/*.so $(CONFDIR)/plugins/sequence
159 @mv $(DISTDIR)/plugins/texture/*.so $(CONFDIR)/plugins/texture
163 @echo "----> Copy python infrastructure"
164 @[ ! -d scripts ] || cp -r scripts $(CONFDIR)/scripts
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)/blender$(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 "****> Prepare temporary distribution directory"