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
48 ifeq ($(OS),$(findstring $(OS), "freebsd irix linux openbsd solaris"))
61 # don"t build plugins on irix if using gcc
63 ifeq ($(IRIX_USE_GCC), true)
92 ifeq ($(WITH_BF_STATICOPENGL), true)
93 @$(MAKE) pkg TYPE="-static"
96 # OS independent targets below:
100 package: version makedirs
103 @#echo "****> Install text"
104 @cp text/blender.html $(DISTDIR)
105 @cp text/*.txt $(DISTDIR)
106 @cp text/*.pdf $(DISTDIR)
107 ifeq ($(FREEDESKTOP), true)
108 @#echo "****> Install freedesktop icons"
109 @mkdir $(DISTDIR)/icons
110 @mkdir $(DISTDIR)/icons/16x16
111 @cp freedesktop/icons/16x16/blender.png $(DISTDIR)/icons/16x16
112 @mkdir $(DISTDIR)/icons/22x22
113 @cp freedesktop/icons/22x22/blender.png $(DISTDIR)/icons/22x22
114 @mkdir $(DISTDIR)/icons/32x32
115 @cp freedesktop/icons/32x32/blender.png $(DISTDIR)/icons/32x32
116 @mkdir $(DISTDIR)/icons/scalable
117 @cp freedesktop/icons/scalable/blender.svg $(DISTDIR)/icons/scalable
119 @echo "----> Make Config dir .blender"
121 @# possible overruling .txt text documents
122 @[ ! -d $(CONFIG_GUESS)/text ] || \
123 cp -f $(CONFIG_GUESS)/text/*.txt $(DISTDIR)
124 #on OS X the contents of the .blender dir is already inside the bundle
125 ifneq ($(OS), darwin)
126 @[ ! -d $(OCGDIR)/bin/.blender ] || \
127 cp -r $(OCGDIR)/bin/.blender $(DISTDIR)
128 @cp $(NANBLENDERHOME)/bin/.blender/.Blanguages $(CONFDIR)
129 @cp $(NANBLENDERHOME)/bin/.blender/.bfont.ttf $(CONFDIR)
131 @echo "----> Copy blender$(EXT0) executable"
132 ifeq ($(TYPE),-static)
133 @cp $(OCGDIR)/bin/blenderstatic$(EXT0) $(DISTDIR)/blender$(EXT0)
136 @cp -r $(OCGDIR)/bin/blender$(EXT0) $(DISTDIR)/Blender$(EXT0)
138 @cp $(OCGDIR)/bin/blender$(EXT0) $(DISTDIR)/blender$(EXT0)
140 @if [ -f $(OCGDIR)/bin/blenderplayer$(EXTO) ]; then \
141 cp $(OCGDIR)/bin/blenderplayer$(EXTO) \
142 $(DISTDIR)/blenderplayer$(EXTO) ; \
146 ifneq ($(NOPLUGINS),true)
147 @echo "----> Copy and compile plugins"
148 @cp -r plugins $(DISTDIR)/plugins
149 @mkdir -p $(DISTDIR)/plugins/include
150 @cp ../source/blender/blenpluginapi/*.h $(DISTDIR)/plugins/include/
151 @chmod 755 $(DISTDIR)/plugins/bmake
152 @$(MAKE) -C $(DISTDIR)/plugins all > /dev/null || exit 1;
153 @rm -f $(DISTDIR)/plugins/*/*.o
155 #on OS X the plugins move to the installation directory
157 @mkdir -p $(CONFDIR)/plugins/sequence
158 @mkdir -p $(CONFDIR)/plugins/texture
159 @mv $(DISTDIR)/plugins/sequence/*.so $(CONFDIR)/plugins/sequence
160 @mv $(DISTDIR)/plugins/texture/*.so $(CONFDIR)/plugins/texture
164 @echo "----> Copy python infrastructure"
165 @[ ! -d scripts ] || cp -r scripts $(CONFDIR)/scripts
167 @echo "----> Copy python UI files"
168 @[ ! -d ui ] || cp -r ui $(CONFDIR)/ui
171 @echo "----> Move .blender to .app/Contents/MacOS/"
172 @rm -fr $(DISTDIR)/blender$(EXT0)/Contents/MacOS/.blender
173 @mv $(DISTDIR)/.blender $(DISTDIR)/blender$(EXT0)/Contents/MacOS/
176 ifneq ($(NOSTRIP),true)
177 @echo "----> Strip blender executable"
179 @strip -x $(DISTDIR)/blender$(EXT0)/Contents/MacOS/blender
181 @strip -x $(DISTDIR)/blender$(EXT0)
182 @if [ -f $(DISTDIR)/blenderplayer$(EXTO) ]; then \
183 strip -x $(DISTDIR)/blenderplayer$(EXT0) ; \
187 @[ ! -x $(CONFIG_GUESS)/specific.sh ] || (\
188 echo "**--> Execute specific.sh in $(CONFIG_GUESS)/" && \
189 cd $(CONFIG_GUESS) && ./specific.sh )
190 @echo "----> Cleaning .svn metadata directories"
191 @find $(DISTDIR) -type d -name ".svn" | xargs rm -fr
194 @echo "----> Create distribution file $(BLENDNAME)$(EXT1)"
195 @#enable the next sleep if you get 'tar file changed while reading'
197 rm -f $(NAN_OBJDIR)/$(VERSION)/$(BLENDNAME)$(EXT1)*
198 @cd $(NAN_OBJDIR) && $(TAR) $(TARFLAGS) $(VERSION)/$(BLENDNAME)$(EXT1) $(BLENDNAME)
200 @echo "----> Compressing distribution to $(BLENDNAME)$(EXT1)$(EXT2)"
201 @$(COMPRESS) $(COMPRESSFLAGS) $(NAN_OBJDIR)/$(VERSION)/$(BLENDNAME)$(EXT1)
203 @#echo "****> Clean up temporary distribution directory"
205 @echo "****> $(NAN_OBJDIR)/$(VERSION)/$(BLENDNAME)$(EXT1)$(EXT2) is ready"
208 @echo "*---> Create $(BLENDNAME) package"
211 @echo "****> Create package directory $(VERSION) if necessary"
212 @[ -d $(NAN_OBJDIR)/$(VERSION) ] || mkdir $(NAN_OBJDIR)/$(VERSION)
213 @echo "****> Remove and recreate temporary distribution directory"