~diresu/blender/blender-command-port

« back to all changes in this revision

Viewing changes to release/Makefile

  • Committer: theeth
  • Date: 2008-10-14 16:52:04 UTC
  • Revision ID: vcs-imports@canonical.com-20081014165204-r32w2gm6s0osvdhn
copy back trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#
 
2
# $Id: Makefile 14771 2008-05-09 20:00:18Z sirdude $
 
3
#
 
4
# ***** BEGIN GPL LICENSE BLOCK *****
 
5
#
 
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.
 
10
#
 
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.
 
15
#
 
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.
 
19
#
 
20
# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
 
21
# All rights reserved.
 
22
#
 
23
# The Original Code is: all of this file.
 
24
#
 
25
# Contributor(s): none yet.
 
26
#
 
27
# ***** END GPL LICENSE BLOCK *****
 
28
 
 
29
include nan_definitions.mk
 
30
 
 
31
export VERSION := $(shell ./getversion.py)
 
32
 
 
33
BLENDNAME=blender-$(VERSION)-$(CONFIG_GUESS)-py$(NAN_PYTHON_VERSION)$(TYPE)
 
34
export DISTDIR=$(NAN_OBJDIR)/$(BLENDNAME)
 
35
export CONFDIR=$(DISTDIR)/.blender
 
36
 
 
37
ifeq ($(OS),beos)
 
38
   TAR="zip"
 
39
   TARFLAGS="-ry9"
 
40
   EXT0=""
 
41
   EXT1=".zip"
 
42
   COMPRESS=""
 
43
   EXT2=""
 
44
   NOPLUGINS?=true
 
45
endif
 
46
 
 
47
ifeq ($(OS),$(findstring $(OS), "freebsd irix linux openbsd solaris"))
 
48
   TAR="tar"
 
49
   TARFLAGS="cf"
 
50
   EXT0=""
 
51
   EXT1=".tar"
 
52
   COMPRESS="bzip2"
 
53
   COMPRESSFLAGS="-f"
 
54
   EXT2=".bz2"
 
55
   ifeq ($(OS), solaris)
 
56
     ifeq ($(CPU), i386)
 
57
       NOPLUGINS?=true
 
58
     endif
 
59
   endif
 
60
endif
 
61
 
 
62
ifeq ($(OS),windows)
 
63
   TAR="zip"
 
64
   TARFLAGS="-r9"
 
65
   EXT0=".exe"
 
66
   EXT1=".zip"
 
67
   NOPLUGINS?=true
 
68
   NOSTRIP?=true
 
69
endif
 
70
 
 
71
ifeq ($(OS),darwin)
 
72
   TAR="tar"
 
73
   TARFLAGS="cf"
 
74
   EXT0=".app"
 
75
   EXT1=".tar"
 
76
   COMPRESS="bzip2"
 
77
   COMPRESSFLAGS="-f"
 
78
   EXT2=".bz2"
 
79
endif
 
80
 
 
81
release: all
 
82
 
 
83
all:
 
84
        @$(MAKE) pkg TYPE=""
 
85
ifeq ($(WITH_BF_STATICOPENGL), true)
 
86
        @$(MAKE) pkg TYPE="-static" 
 
87
endif
 
88
 
 
89
# OS independent targets below:
 
90
 
 
91
dist: all
 
92
 
 
93
package: version makedirs
 
94
 
 
95
install: package
 
96
        @#echo "****> Install text"
 
97
        @cp text/blender.html $(DISTDIR)
 
98
        @cp text/*.txt $(DISTDIR)
 
99
        @cp text/*.pdf $(DISTDIR)
 
100
    ifeq ($(FREEDESKTOP), true)
 
101
        @#echo "****> Install freedesktop icons"
 
102
        @mkdir $(DISTDIR)/icons
 
103
        @mkdir $(DISTDIR)/icons/16x16
 
104
        @cp freedesktop/icons/16x16/blender.png $(DISTDIR)/icons/16x16
 
105
        @mkdir $(DISTDIR)/icons/22x22
 
106
        @cp freedesktop/icons/22x22/blender.png $(DISTDIR)/icons/22x22
 
107
        @mkdir $(DISTDIR)/icons/32x32
 
108
        @cp freedesktop/icons/32x32/blender.png $(DISTDIR)/icons/32x32
 
109
        @mkdir $(DISTDIR)/icons/scalable
 
110
        @cp freedesktop/icons/scalable/blender.svg $(DISTDIR)/icons/scalable
 
111
    endif
 
112
        @echo "----> Make Config dir .blender"
 
113
        @mkdir -p $(CONFDIR)
 
114
        @# possible overruling .txt text documents
 
115
        @[ ! -d $(CONFIG_GUESS)/text ] || \
 
116
            cp -f $(CONFIG_GUESS)/text/*.txt $(DISTDIR)
 
117
#on OS X the contents of the .blender dir is already inside the bundle
 
118
    ifneq ($(OS), darwin)
 
119
        @[ ! -d $(OCGDIR)/bin/.blender ] || \
 
120
                cp -r $(OCGDIR)/bin/.blender $(DISTDIR)
 
121
        @cp $(NANBLENDERHOME)/bin/.blender/.Blanguages $(CONFDIR)
 
122
        @cp $(NANBLENDERHOME)/bin/.blender/.bfont.ttf $(CONFDIR)
 
123
    endif
 
124
        @echo "----> Copy blender$(EXT0) executable"
 
125
    ifeq ($(TYPE),-static)
 
126
        @cp $(OCGDIR)/bin/blenderstatic$(EXT0) $(DISTDIR)/blender$(EXT0)
 
127
    else
 
128
    ifeq ($(OS),darwin)
 
129
        @cp -r $(OCGDIR)/bin/blender$(EXT0) $(DISTDIR)/Blender$(EXT0)
 
130
    else
 
131
        @cp $(OCGDIR)/bin/blender$(EXT0) $(DISTDIR)/blender$(EXT0)
 
132
    endif
 
133
        @if [ -f $(OCGDIR)/bin/blenderplayer$(EXTO) ]; then \
 
134
                cp $(OCGDIR)/bin/blenderplayer$(EXTO) \
 
135
                        $(DISTDIR)/blenderplayer$(EXTO) ; \
 
136
        fi
 
137
    endif
 
138
 
 
139
ifneq ($(NOPLUGINS),true)
 
140
        @echo "----> Copy and compile plugins"
 
141
        @cp -r plugins $(DISTDIR)/plugins
 
142
        @mkdir -p $(DISTDIR)/plugins/include
 
143
        @cp ../source/blender/blenpluginapi/*.h $(DISTDIR)/plugins/include/
 
144
        @chmod 755 $(DISTDIR)/plugins/bmake
 
145
        @$(MAKE) -C $(DISTDIR)/plugins all  > /dev/null || exit 1;
 
146
        @rm -f $(DISTDIR)/plugins/*/*.o
 
147
 
 
148
#on OS X the plugins move to the installation directory
 
149
    ifneq ($(OS),darwin)
 
150
        @mkdir -p $(CONFDIR)/plugins/sequence
 
151
        @mkdir -p $(CONFDIR)/plugins/texture
 
152
        @mv $(DISTDIR)/plugins/sequence/*.so $(CONFDIR)/plugins/sequence
 
153
        @mv $(DISTDIR)/plugins/texture/*.so $(CONFDIR)/plugins/texture
 
154
    endif
 
155
endif
 
156
 
 
157
        @echo "----> Copy python infrastructure"
 
158
        @[ ! -d scripts ] || cp -r scripts $(CONFDIR)/scripts
 
159
 
 
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
 
165
 
 
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) ; \
 
174
        fi
 
175
      endif
 
176
    endif
 
177
        @[ ! -x $(CONFIG_GUESS)/specific.sh ] || (\
 
178
            echo "**--> Execute specific.sh in $(CONFIG_GUESS)/" && \
 
179
            cd $(CONFIG_GUESS) && ./specific.sh )
 
180
        @echo "----> Cleaning .svn metadata directories"
 
181
        @find $(DISTDIR) -type d -name ".svn" | xargs rm -fr
 
182
 
 
183
pkg: install
 
184
        @echo "----> Create distribution file $(BLENDNAME)$(EXT1)"
 
185
        @#enable the next sleep if you get 'tar file changed while reading'
 
186
        @#sleep 10
 
187
        rm -f  $(NAN_OBJDIR)/$(VERSION)/$(BLENDNAME)$(EXT1)*
 
188
        @cd $(NAN_OBJDIR) && $(TAR) $(TARFLAGS) $(VERSION)/$(BLENDNAME)$(EXT1) $(BLENDNAME)
 
189
    ifdef COMPRESS
 
190
        @echo "----> Compressing distribution to $(BLENDNAME)$(EXT1)$(EXT2)"
 
191
        @$(COMPRESS) $(COMPRESSFLAGS) $(NAN_OBJDIR)/$(VERSION)/$(BLENDNAME)$(EXT1)
 
192
    endif
 
193
        @#echo "****> Clean up temporary distribution directory"
 
194
        @rm -fr $(DISTDIR)
 
195
        @echo "****> $(NAN_OBJDIR)/$(VERSION)/$(BLENDNAME)$(EXT1)$(EXT2) is ready"
 
196
 
 
197
version: FORCE
 
198
        @echo "*---> Create $(BLENDNAME) package"
 
199
 
 
200
makedirs: FORCE
 
201
        @#echo "****> Create package directory $(VERSION) if necessary"
 
202
        @[ -d $(NAN_OBJDIR)/$(VERSION) ] || mkdir $(NAN_OBJDIR)/$(VERSION)
 
203
        @#echo "****> Prepare temporary distribution directory"
 
204
        @rm -fr $(DISTDIR)
 
205
        @mkdir $(DISTDIR)
 
206
 
 
207
FORCE: