2 # ***** BEGIN LICENSE BLOCK *****
3 # Version: MPL 1.1/GPL 2.0/LGPL 2.1
5 # The contents of this file are subject to the Mozilla Public License Version
6 # 1.1 (the "License"); you may not use this file except in compliance with
7 # the License. You may obtain a copy of the License at
8 # http://www.mozilla.org/MPL/
10 # Software distributed under the License is distributed on an "AS IS" basis,
11 # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 # for the specific language governing rights and limitations under the
15 # The Original Code is Mozilla Communicator client code, released
18 # The Initial Developer of the Original Code is
19 # Netscape Communications Corporation.
20 # Portions created by the Initial Developer are Copyright (C) 1998
21 # the Initial Developer. All Rights Reserved.
25 # Alternatively, the contents of this file may be used under the terms of
26 # either of the GNU General Public License Version 2 or later (the "GPL"),
27 # or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
28 # in which case the provisions of the GPL or the LGPL are applicable instead
29 # of those above. If you wish to allow use of your version of this file only
30 # under the terms of either the GPL or the LGPL, and not to allow others to
31 # use your version of this file under the terms of the MPL, indicate your
32 # decision by deleting the provisions above and replace them with the notice
33 # and other provisions required by the GPL or the LGPL. If you do not delete
34 # the provisions above, a recipient may use your version of this file under
35 # the terms of any one of the MPL, the GPL or the LGPL.
37 # ***** END LICENSE BLOCK *****
40 topsrcdir
= @top_srcdir@
44 include $(DEPTH
)/config
/autoconf.mk
48 ifeq (,$(filter WINCE WINNT OS2
,$(OS_ARCH
)))
52 ifeq (WINNT
,$(OS_ARCH
))
57 # We need jemalloc built before the shunt
60 $(DEPTH
)/memory
/jemalloc \
62 $(DEPTH
)/memory
/mozalloc \
67 $(DEPTH
)/memory
/mozalloc \
74 ifeq (Android
,$(OS_TARGET
))
75 DIRS
+= mobile
/sutagent
/android
78 include $(topsrcdir
)/config
/rules.mk
80 # we install to _leaktest/
82 include $(srcdir)/automation-build.mk
84 _LEAKTEST_DIR
= $(DEPTH
)/_leaktest
85 GARBAGE_DIRS
+= $(_LEAKTEST_DIR
)
92 $(topsrcdir
)/build
/pgo
/server-locations.txt \
95 leaktest.py
: leaktest.py.in
96 $(PYTHON
) $(topsrcdir
)/config
/Preprocessor.py
$^
> $@
98 GARBAGE
+= leaktest.py
100 libs
:: $(_LEAKTEST_FILES
)
101 $(INSTALL
) $^
$(_LEAKTEST_DIR
)
104 # Install bloaturls.txt file for tinderbox bloat test.
106 $(INSTALL
) $< $(DIST
)/bin
108 # Install bloatcycle.html into dist/bin/res, for auto-cycling
109 # of bloaturls.txt. This is for browsers that can't do -f
110 # autocycling of URLs.
111 libs
:: bloatcycle.html
112 $(INSTALL
) $< $(DIST
)/bin
/res
114 libs
:: $(topsrcdir
)/tools
/rb
/fix_stack_using_bpsyms.py
115 $(INSTALL
) $< $(DIST
)/bin
117 ifeq ($(OS_ARCH
),Darwin
)
118 libs
:: $(topsrcdir
)/tools
/rb
/fix-macosx-stack.pl
119 $(INSTALL
) $< $(DIST
)/bin
120 libs
:: $(topsrcdir
)/tools
/rb
/fix_macosx_stack.py
121 $(INSTALL
) $< $(DIST
)/bin
123 # Basic unit tests for some stuff in the unify script
125 # build ppc/i386 binaries, and unify them
126 rm -f unify-test-ppc unify-test-i386 unify-test-universal
127 $(HOST_CC
) -arch ppc
$(srcdir)/unify-test.c
-o unify-test-ppc
128 $(HOST_CC
) -arch i386
$(srcdir)/unify-test.c
-o unify-test-i386
129 @if
! $(srcdir)/macosx
/universal
/unify .
/unify-test-ppc .
/unify-test-i386 \
130 .
/unify-test-universal
; then \
131 echo
"TEST-UNEXPECTED-FAIL | build/ | unify failed to produce a universal binary!"; \
134 @if
test ! -f .
/unify-test-universal
; then \
135 echo
"TEST-UNEXPECTED-FAIL | build/ | unify failed to produce a universal binary!"; \
138 @if
! file
-b .
/unify-test-universal | head
-n1 | grep
-q
"^Mach-O universal binary"; then \
139 echo
"TEST-UNEXPECTED-FAIL | build/ | unify failed to produce a universal binary!"; \
142 echo
"TEST-PASS | build/ | unify produced a universal binary!"; \
144 # try building an x86-64 binary. if that succeeds, try unifying it
145 # with an i386 binary
146 rm -f unify-test-x86_64 unify-test-universal-64
147 -$(HOST_CC
) -arch x86_64
$(srcdir)/unify-test.c
-o unify-test-x86_64
148 @if
test -f .
/unify-test-x86_64
; then \
149 if
! $(srcdir)/macosx
/universal
/unify .
/unify-test-x86_64 .
/unify-test-i386 \
150 .
/unify-test-universal-64
; then \
151 echo
"TEST-UNEXPECTED-FAIL | build/ | unify failed to produce a universal binary with a 64-bit input!"; \
154 if
test ! -f .
/unify-test-universal-64
; then \
155 echo
"TEST-UNEXPECTED-FAIL | build/ | unify failed to produce a universal binary with a 64-bit input!"; \
158 if
! file
-b .
/unify-test-universal-64 | head
-n1 | grep
-q
"^Mach-O universal binary"; then \
159 echo
"TEST-UNEXPECTED-FAIL | build/ | unify failed to produce a universal binary with a 64-bit input!"; \
162 echo
"TEST-PASS | build/ | unify produced a universal binary with a 64-bit input!"; \
165 # try unifying two identical Java class files
166 rm -f unifytesta.class unifytestb.class unifytestc.class
167 cp
$(srcdir)/unifytest.class .
/unifytesta.class
168 cp
$(srcdir)/unifytest.class .
/unifytestb.class
169 @if
! $(srcdir)/macosx
/universal
/unify .
/unifytesta.class .
/unifytestb.class \
170 .
/unifytestc.class
; then \
171 echo
"TEST-UNEXPECTED-FAIL | build/ | unify failed to unify a Java class file!"; \
174 @if
test ! -f .
/unifytestc.class
; then \
175 echo
"TEST-UNEXPECTED-FAIL | build/ | unify failed to unify a Java class file!"; \
178 @if
! diff
-q .
/unifytesta.class .
/unifytestc.class
; then \
179 echo
"TEST-UNEXPECTED-FAIL | build/ | unify failed to unify a Java class file!"; \
182 echo
"TEST-PASS | build/ | unify unified a Java class file!"; \
184 # try unifying some files that differ only in line ordering
185 rm -rf unify-sort-test
186 mkdir unify-sort-test unify-sort-test
/a unify-sort-test
/b
187 printf
"lmn\nabc\nxyz\n" > unify-sort-test
/a
/file.foo
188 printf
"xyz\nlmn\nabc" > unify-sort-test
/b
/file.foo
189 printf
"lmn\nabc\nxyz\n" > unify-sort-test
/expected-result
190 @if
! $(srcdir)/macosx
/universal
/unify
--unify-with-sort
"\.foo$$" \
191 .
/unify-sort-test
/a .
/unify-sort-test
/b \
192 .
/unify-sort-test
/c
; then \
193 echo
"TEST-UNEXPECTED-FAIL | build/ | unify failed to unify files with differing line ordering!"; \
196 @if
! diff
-q .
/unify-sort-test
/expected-result .
/unify-sort-test
/c
/file.foo
; then \
197 echo
"TEST-UNEXPECTED-FAIL | build/ | unify failed to unify files with differing line ordering!"; \
200 echo
"TEST-PASS | build/ | unify unified files with differing line ordering!"; \
204 ifeq ($(OS_ARCH
),Linux
)
205 libs
:: $(topsrcdir
)/tools
/rb
/fix-linux-stack.pl
206 $(INSTALL
) $< $(DIST
)/bin
209 GARBAGE
+= $(srcdir)/automationutils.pyc