~mozillateam/xulrunner/xulrunner-1.9.head

285 by Fabien Tassin
* Add a build-system for xulrunner application inside the SDK.
1
#!/bin/sh
2
3
# Copyright (c) 2008 Fabien Tassin <fta@sofaraway.org>
4
# Description: Create a build-system for xulrunner applications
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 as
8
# published by the Free Software Foundation; either version 2, or (at
9
# your option) any later version.
10
#
11
# This program is distributed in the hope that it will be useful, but
12
# WITHOUT ANY WARRANTY; without even the implied warranty of
13
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14
# General Public License for more details.
15
#
16
# You should have received a copy of the GNU General Public License along
17
# with this program; if not, write to the Free Software Foundation, Inc.,
18
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
20
############################################################################
21
286 by Fabien Tassin
* Update the build-system script for install:: and clean::
22
DIRS="config build toolkit/mozapps/installer"
285 by Fabien Tassin
* Add a build-system for xulrunner application inside the SDK.
23
FILES="configure.in aclocal.m4 allmakefiles.sh toolkit/xre/make-platformini.py nsprpub/config/make-system-wrappers.pl"
24
25
NAME="build-system"
26
323 by Fabien Tassin
* improve create-build-system.sh to detect build-tree directory
27
SRCDIR=mozilla
28
if [ ! -d $SRCDIR ] ; then
29
  if [ -d build-tree/mozilla ] ; then
30
    SRCDIR=build-tree/mozilla
31
  else
32
    echo "Error: can't find mozilla dir"
33
    exit 1
34
  fi
35
fi
36
326 by Fabien Tassin
* Create build-system.tar.gz in the debian directory to prevent
37
rm -rf $NAME debian/$NAME.tar.gz
285 by Fabien Tassin
* Add a build-system for xulrunner application inside the SDK.
38
mkdir -p $NAME
323 by Fabien Tassin
* improve create-build-system.sh to detect build-tree directory
39
tar -C $SRCDIR -cf - $DIRS $FILES | tar -C $NAME -xf -
285 by Fabien Tassin
* Add a build-system for xulrunner application inside the SDK.
40
cat - > $NAME/Makefile.in <<EOF
41
# ***** BEGIN LICENSE BLOCK *****
42
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
43
#
44
# The contents of this file are subject to the Mozilla Public License Version
45
# 1.1 (the "License"); you may not use this file except in compliance with
46
# the License. You may obtain a copy of the License at
47
# http://www.mozilla.org/MPL/
48
#
49
# Software distributed under the License is distributed on an "AS IS" basis,
50
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
51
# for the specific language governing rights and limitations under the
52
# License.
53
#
54
# The Original Code is Mozilla.
55
#
56
# The Initial Developer of the Original Code is
57
# the Mozilla Foundation <http://www.mozilla.org/>.
58
# Portions created by the Initial Developer are Copyright (C) 2007
59
# the Initial Developer. All Rights Reserved.
60
#
61
# Contributor(s):
62
#   Fabien Tassin <fta@sofaraway.org>
63
#
64
# Alternatively, the contents of this file may be used under the terms of
65
# either the GNU General Public License Version 2 or later (the "GPL"), or
66
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
67
# in which case the provisions of the GPL or the LGPL are applicable instead
68
# of those above. If you wish to allow use of your version of this file only
69
# under the terms of either the GPL or the LGPL, and not to allow others to
70
# use your version of this file under the terms of the MPL, indicate your
71
# decision by deleting the provisions above and replace them with the notice
72
# and other provisions required by the GPL or the LGPL. If you do not delete
73
# the provisions above, a recipient may use your version of this file under
74
# the terms of any one of the MPL, the GPL or the LGPL.
75
#
76
# ***** END LICENSE BLOCK *****
77
78
DEPTH           = .
79
topsrcdir       = @top_srcdir@
80
srcdir          = @srcdir@
81
VPATH           = @srcdir@
82
83
include \$(DEPTH)/config/autoconf.mk
84
286 by Fabien Tassin
* Update the build-system script for install:: and clean::
85
include \$(topsrcdir)/config/config.mk
86
87
default alldep all::
88
	\$(RM) -rf _tests
89
90
TIERS += base
91
92
#
93
# tier "base" - basic setup
94
#
95
tier_base_dirs = \\
96
	config \\
97
	build \\
98
	\$(NULL)
99
100
include \$(topsrcdir)/\$(MOZ_BUILD_APP)/build.mk
101
102
GARBAGE_DIRS += dist _javagen _profile _tests staticlib
103
DIST_GARBAGE = config.cache config.log config.status config-defs.h \\
104
   dependencies.beos config/autoconf.mk config/myrules.mk config/myconfig.mk \\
105
   unallmakefiles mozilla-config.h \\
106
   netwerk/necko-config.h xpcom/xpcom-config.h xpcom/xpcom-private.h \\
107
   \$(topsrcdir)/.mozconfig.mk \$(topsrcdir)/.mozconfig.out
108
109
# Build pseudo-external modules first when export is explicitly called
110
export::
111
	\$(MAKE) -C config export
112
	\$(MAKE) tier_nspr
285 by Fabien Tassin
* Add a build-system for xulrunner application inside the SDK.
113
114
include \$(topsrcdir)/config/rules.mk
115
286 by Fabien Tassin
* Update the build-system script for install:: and clean::
116
distclean::
325 by Fabien Tassin
* Fix un-escaped variables in the build-system creator script
117
	cat unallmakefiles | \$(XARGS) rm -f
118
	rm -f unallmakefiles \$(DIST_GARBAGE)
285 by Fabien Tassin
* Add a build-system for xulrunner application inside the SDK.
119
EOF
120
326 by Fabien Tassin
* Create build-system.tar.gz in the debian directory to prevent
121
tar -C $NAME -zcvf debian/$NAME.tar.gz .
285 by Fabien Tassin
* Add a build-system for xulrunner application inside the SDK.
122
rm -rf $NAME