Merge mozilla-central and tracemonkey. (a=blockers)
[mozilla-central.git] / build / Makefile.in
blob9765d849078bc126e9c169e9c8905f7d1b38e167
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
13 # License.
15 # The Original Code is Mozilla Communicator client code, released
16 # March 31, 1998.
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.
23 # Contributor(s):
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 *****
39 DEPTH = ..
40 topsrcdir = @top_srcdir@
41 srcdir = @srcdir@
42 VPATH = @srcdir@
44 include $(DEPTH)/config/autoconf.mk
46 MODULE = build
48 ifeq (,$(filter WINCE WINNT OS2,$(OS_ARCH)))
49 DIRS = unix
50 endif
52 ifeq (WINNT,$(OS_ARCH))
53 DIRS = win32
54 endif
56 ifdef WINCE
57 # We need jemalloc built before the shunt
58 ifdef MOZ_MEMORY
59 DIRS += wince/tools \
60 $(DEPTH)/memory/jemalloc \
61 wince/shunt \
62 $(DEPTH)/memory/mozalloc \
63 $(NULL)
64 else
65 DIRS += wince/tools \
66 wince/shunt \
67 $(DEPTH)/memory/mozalloc \
68 $(NULL)
69 endif
70 endif
72 DIRS += pgo
74 ifeq (Android,$(OS_TARGET))
75 DIRS += mobile/sutagent/android
76 endif
78 include $(topsrcdir)/config/rules.mk
80 # we install to _leaktest/
81 TARGET_DEPTH = ..
82 include $(srcdir)/automation-build.mk
84 _LEAKTEST_DIR = $(DEPTH)/_leaktest
85 GARBAGE_DIRS += $(_LEAKTEST_DIR)
87 _LEAKTEST_FILES = \
88 automation.py \
89 automationutils.py \
90 leaktest.py \
91 bloatcycle.html \
92 $(topsrcdir)/build/pgo/server-locations.txt \
93 $(topsrcdir)/build/pgo/favicon.ico \
94 $(topsrcdir)/build/pgo/blueprint/sample.html \
95 $(topsrcdir)/build/pgo/blueprint/elements.html \
96 $(topsrcdir)/build/pgo/blueprint/forms.html \
97 $(topsrcdir)/build/pgo/blueprint/grid.html \
98 $(topsrcdir)/build/pgo/blueprint/test.jpg \
99 $(topsrcdir)/build/pgo/blueprint/test-small.jpg \
100 $(topsrcdir)/build/pgo/blueprint/valid.png \
101 $(topsrcdir)/build/pgo/blueprint/screen.css \
102 $(topsrcdir)/build/pgo/blueprint/print.css \
103 $(topsrcdir)/build/pgo/blueprint/grid.png \
104 $(topsrcdir)/build/pgo/blueprint/fancytype-screen.css \
105 $(NULL)
107 leaktest.py: leaktest.py.in
108 $(PYTHON) $(topsrcdir)/config/Preprocessor.py $^ > $@
109 chmod +x $@
110 GARBAGE += leaktest.py
112 libs:: $(_LEAKTEST_FILES)
113 $(INSTALL) $^ $(_LEAKTEST_DIR)
115 ifdef ENABLE_TESTS
116 libs:: $(topsrcdir)/tools/rb/fix_stack_using_bpsyms.py
117 $(INSTALL) $< $(DIST)/bin
119 ifeq ($(OS_ARCH),Darwin)
120 libs:: $(topsrcdir)/tools/rb/fix-macosx-stack.pl
121 $(INSTALL) $< $(DIST)/bin
122 libs:: $(topsrcdir)/tools/rb/fix_macosx_stack.py
123 $(INSTALL) $< $(DIST)/bin
125 # Basic unit tests for some stuff in the unify script
126 check::
127 # build ppc/i386 binaries, and unify them
128 rm -f unify-test-ppc unify-test-i386 unify-test-universal
129 $(HOST_CC) -arch ppc $(srcdir)/unify-test.c -o unify-test-ppc
130 $(HOST_CC) -arch i386 $(srcdir)/unify-test.c -o unify-test-i386
131 @if ! $(srcdir)/macosx/universal/unify ./unify-test-ppc ./unify-test-i386 \
132 ./unify-test-universal; then \
133 echo "TEST-UNEXPECTED-FAIL | build/ | unify failed to produce a universal binary!"; \
134 false; \
136 @if test ! -f ./unify-test-universal; then \
137 echo "TEST-UNEXPECTED-FAIL | build/ | unify failed to produce a universal binary!"; \
138 false; \
140 @if ! file -b ./unify-test-universal | head -n1 | grep -q "^Mach-O universal binary"; then \
141 echo "TEST-UNEXPECTED-FAIL | build/ | unify failed to produce a universal binary!"; \
142 false; \
143 else \
144 echo "TEST-PASS | build/ | unify produced a universal binary!"; \
146 # try building an x86-64 binary. if that succeeds, try unifying it
147 # with an i386 binary
148 rm -f unify-test-x86_64 unify-test-universal-64
149 -$(HOST_CC) -arch x86_64 $(srcdir)/unify-test.c -o unify-test-x86_64
150 @if test -f ./unify-test-x86_64; then \
151 if ! $(srcdir)/macosx/universal/unify ./unify-test-x86_64 ./unify-test-i386 \
152 ./unify-test-universal-64; then \
153 echo "TEST-UNEXPECTED-FAIL | build/ | unify failed to produce a universal binary with a 64-bit input!"; \
154 false; \
155 fi; \
156 if test ! -f ./unify-test-universal-64; then \
157 echo "TEST-UNEXPECTED-FAIL | build/ | unify failed to produce a universal binary with a 64-bit input!"; \
158 false; \
159 fi; \
160 if ! file -b ./unify-test-universal-64 | head -n1 | grep -q "^Mach-O universal binary"; then \
161 echo "TEST-UNEXPECTED-FAIL | build/ | unify failed to produce a universal binary with a 64-bit input!"; \
162 false; \
163 else \
164 echo "TEST-PASS | build/ | unify produced a universal binary with a 64-bit input!"; \
165 fi \
167 # try unifying two identical Java class files
168 rm -f unifytesta.class unifytestb.class unifytestc.class
169 cp $(srcdir)/unifytest.class ./unifytesta.class
170 cp $(srcdir)/unifytest.class ./unifytestb.class
171 @if ! $(srcdir)/macosx/universal/unify ./unifytesta.class ./unifytestb.class \
172 ./unifytestc.class; then \
173 echo "TEST-UNEXPECTED-FAIL | build/ | unify failed to unify a Java class file!"; \
174 false; \
176 @if test ! -f ./unifytestc.class; then \
177 echo "TEST-UNEXPECTED-FAIL | build/ | unify failed to unify a Java class file!"; \
178 false; \
180 @if ! diff -q ./unifytesta.class ./unifytestc.class; then \
181 echo "TEST-UNEXPECTED-FAIL | build/ | unify failed to unify a Java class file!"; \
182 false; \
183 else \
184 echo "TEST-PASS | build/ | unify unified a Java class file!"; \
186 # try unifying some files that differ only in line ordering
187 rm -rf unify-sort-test
188 mkdir unify-sort-test unify-sort-test/a unify-sort-test/b
189 printf "lmn\nabc\nxyz\n" > unify-sort-test/a/file.foo
190 printf "xyz\nlmn\nabc" > unify-sort-test/b/file.foo
191 printf "lmn\nabc\nxyz\n" > unify-sort-test/expected-result
192 @if ! $(srcdir)/macosx/universal/unify --unify-with-sort "\.foo$$" \
193 ./unify-sort-test/a ./unify-sort-test/b \
194 ./unify-sort-test/c; then \
195 echo "TEST-UNEXPECTED-FAIL | build/ | unify failed to unify files with differing line ordering!"; \
196 false; \
198 @if ! diff -q ./unify-sort-test/expected-result ./unify-sort-test/c/file.foo; then \
199 echo "TEST-UNEXPECTED-FAIL | build/ | unify failed to unify files with differing line ordering!"; \
200 false; \
201 else \
202 echo "TEST-PASS | build/ | unify unified files with differing line ordering!"; \
204 endif
206 ifeq ($(OS_ARCH),Linux)
207 libs:: $(topsrcdir)/tools/rb/fix-linux-stack.pl
208 $(INSTALL) $< $(DIST)/bin
209 endif
211 GARBAGE += $(srcdir)/automationutils.pyc
212 endif # ENABLE_TESTS