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
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)-py$(NAN_PYTHON_VERSION)$(TYPE)
37 export DISTDIR=$(NAN_OBJDIR)/$(BLENDNAME)
38 export CONFDIR=$(DISTDIR)/.blender
50 ifeq ($(OS),$(findstring $(OS), "freebsd irix linux openbsd solaris"))
88 ifeq ($(WITH_BF_STATICOPENGL), true)
89 @$(MAKE) pkg TYPE="-static"
92 # OS independent targets below:
96 package: version makedirs
99 @#echo "****> Install text"
100 @cp text/blender.html $(DISTDIR)
101 @cp text/*.txt $(DISTDIR)
102 @cp text/*.pdf $(DISTDIR)
103 ifeq ($(FREEDESKTOP), true)
104 @#echo "****> Install freedesktop icons"
105 @mkdir $(DISTDIR)/icons
106 @mkdir $(DISTDIR)/icons/16x16
107 @cp freedesktop/icons/16x16/blender.png $(DISTDIR)/icons/16x16
108 @mkdir $(DISTDIR)/icons/22x22
109 @cp freedesktop/icons/22x22/blender.png $(DISTDIR)/icons/22x22
110 @mkdir $(DISTDIR)/icons/32x32
111 @cp freedesktop/icons/32x32/blender.png $(DISTDIR)/icons/32x32
112 @mkdir $(DISTDIR)/icons/scalable
113 @cp freedesktop/icons/scalable/blender.svg $(DISTDIR)/icons/scalable
115 @echo "----> Make Config dir .blender"
117 @# possible overruling .txt text documents
118 @[ ! -d $(CONFIG_GUESS)/text ] || \
119 cp -f $(CONFIG_GUESS)/text/*.txt $(DISTDIR)
120 #on OS X the contents of the .blender dir is already inside the bundle
121 ifneq ($(OS), darwin)
122 @[ ! -d $(OCGDIR)/bin/.blender ] || \
123 cp -r $(OCGDIR)/bin/.blender $(DISTDIR)
124 @rm -rf $(DISTDIR)/.svn $(DISTDIR)/*/.svn $(DISTDIR)/*/*/.svn
125 @cp $(NANBLENDERHOME)/bin/.blender/.Blanguages $(CONFDIR)
126 @cp $(NANBLENDERHOME)/bin/.blender/.bfont.ttf $(CONFDIR)
128 @echo "----> Copy blender$(EXT0) executable"
129 ifeq ($(TYPE),-static)
130 @cp $(OCGDIR)/bin/blenderstatic$(EXT0) $(DISTDIR)/blender$(EXT0)
133 @cp -r $(OCGDIR)/bin/blender$(EXT0) $(DISTDIR)/Blender$(EXT0)
135 @cp $(OCGDIR)/bin/blender$(EXT0) $(DISTDIR)/blender$(EXT0)
137 @if [ -f $(OCGDIR)/bin/blenderplayer$(EXTO) ]; then \
138 cp $(OCGDIR)/bin/blenderplayer$(EXTO) \
139 $(DISTDIR)/blenderplayer$(EXTO) ; \
143 ifneq ($(NOPLUGINS),true)
144 @echo "----> Copy and compile plugins"
145 @cp -r plugins $(DISTDIR)/plugins
146 @mkdir -p $(DISTDIR)/plugins/include
147 @cp ../source/blender/blenpluginapi/*.h $(DISTDIR)/plugins/include/
148 @chmod 755 $(DISTDIR)/plugins/bmake
149 @$(MAKE) -C $(DISTDIR)/plugins all > /dev/null || exit 1;
150 @rm -fr $(DISTDIR)/plugins/.svn $(DISTDIR)/plugins/*/.svn \
151 $(DISTDIR)/plugins/*/*.o
153 #on OS X the plugins move to the installation directory
155 @mkdir -p $(CONFDIR)/plugins/sequence
156 @mkdir -p $(CONFDIR)/plugins/texture
157 @mv $(DISTDIR)/plugins/sequence/*.so $(CONFDIR)/plugins/sequence
158 @mv $(DISTDIR)/plugins/texture/*.so $(CONFDIR)/plugins/texture
162 @echo "----> Copy python infrastructure"
163 @[ ! -d scripts ] || cp -r scripts $(CONFDIR)/scripts
164 @[ ! -d $(CONFDIR)/scripts ] || rm -fr $(CONFDIR)/scripts/.svn $(CONFDIR)/scripts/*/.svn $(CONFDIR)/scripts/*/*/.svn
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 )
188 @echo "----> Create distribution file $(BLENDNAME)$(EXT1)"
189 @#enable the next sleep if you get 'tar file changed while reading'
191 rm -f $(NAN_OBJDIR)/$(VERSION)/$(BLENDNAME)$(EXT1)*
192 @cd $(NAN_OBJDIR) && $(TAR) $(TARFLAGS) $(VERSION)/$(BLENDNAME)$(EXT1) $(BLENDNAME)
194 @echo "----> Compressing distribution to $(BLENDNAME)$(EXT1)$(EXT2)"
195 @$(COMPRESS) $(COMPRESSFLAGS) $(NAN_OBJDIR)/$(VERSION)/$(BLENDNAME)$(EXT1)
197 @#echo "****> Clean up temporary distribution directory"
199 @echo "****> $(NAN_OBJDIR)/$(VERSION)/$(BLENDNAME)$(EXT1)$(EXT2) is ready"
202 @echo "*---> Create $(BLENDNAME) package"
205 @#echo "****> Create package directory $(VERSION) if necessary"
206 @[ -d $(NAN_OBJDIR)/$(VERSION) ] || mkdir $(NAN_OBJDIR)/$(VERSION)
207 @#echo "****> Prepare temporary distribution directory"