OLD | NEW |
---|---|
1 # Copyright 2011 the V8 project authors. All rights reserved. | 1 # Copyright 2011 the V8 project authors. All rights reserved. |
2 # Redistribution and use in source and binary forms, with or without | 2 # Redistribution and use in source and binary forms, with or without |
3 # modification, are permitted provided that the following conditions are | 3 # modification, are permitted provided that the following conditions are |
4 # met: | 4 # met: |
5 # | 5 # |
6 # * Redistributions of source code must retain the above copyright | 6 # * Redistributions of source code must retain the above copyright |
7 # notice, this list of conditions and the following disclaimer. | 7 # notice, this list of conditions and the following disclaimer. |
8 # * Redistributions in binary form must reproduce the above | 8 # * Redistributions in binary form must reproduce the above |
9 # copyright notice, this list of conditions and the following | 9 # copyright notice, this list of conditions and the following |
10 # disclaimer in the documentation and/or other materials provided | 10 # disclaimer in the documentation and/or other materials provided |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
86 TESTFLAGS += --no-presubmit | 86 TESTFLAGS += --no-presubmit |
87 endif | 87 endif |
88 | 88 |
89 # ----------------- available targets: -------------------- | 89 # ----------------- available targets: -------------------- |
90 # - "dependencies": pulls in external dependencies (currently: GYP) | 90 # - "dependencies": pulls in external dependencies (currently: GYP) |
91 # - any arch listed in ARCHES (see below) | 91 # - any arch listed in ARCHES (see below) |
92 # - any mode listed in MODES | 92 # - any mode listed in MODES |
93 # - every combination <arch>.<mode>, e.g. "ia32.release" | 93 # - every combination <arch>.<mode>, e.g. "ia32.release" |
94 # - "native": current host's architecture, release mode | 94 # - "native": current host's architecture, release mode |
95 # - any of the above with .check appended, e.g. "ia32.release.check" | 95 # - any of the above with .check appended, e.g. "ia32.release.check" |
96 # - default (no target specified): build all ARCHES and MODES | 96 # - default (no target specified): build all DEFAULT_ARCHES and MODES |
97 # - "check": build all targets and run all tests | 97 # - "check": build all targets and run all tests |
98 # - "<arch>.clean" for any <arch> in ARCHES | 98 # - "<arch>.clean" for any <arch> in ARCHES |
99 # - "clean": clean all ARCHES | 99 # - "clean": clean all ARCHES |
100 | 100 |
101 # ----------------- internal stuff ------------------------ | 101 # ----------------- internal stuff ------------------------ |
102 | 102 |
103 # Architectures and modes to be compiled. Consider these to be internal | 103 # Architectures and modes to be compiled. Consider these to be internal |
104 # variables, don't override them (use the targets instead). | 104 # variables, don't override them (use the targets instead). |
105 ARCHES = ia32 x64 arm | 105 ARCHES = ia32 x64 arm mips |
106 DEFAULT_ARCHES = ia32 x64 arm | |
106 MODES = release debug | 107 MODES = release debug |
107 | 108 |
108 # List of files that trigger Makefile regeneration: | 109 # List of files that trigger Makefile regeneration: |
109 GYPFILES = build/all.gyp build/common.gypi build/standalone.gypi \ | 110 GYPFILES = build/all.gyp build/common.gypi build/standalone.gypi \ |
110 preparser/preparser.gyp samples/samples.gyp src/d8.gyp \ | 111 preparser/preparser.gyp samples/samples.gyp src/d8.gyp \ |
111 test/cctest/cctest.gyp tools/gyp/v8.gyp | 112 test/cctest/cctest.gyp tools/gyp/v8.gyp |
112 | 113 |
113 # Generates all combinations of ARCHES and MODES, e.g. "ia32.release". | 114 # Generates all combinations of ARCHES and MODES, e.g. "ia32.release". |
114 BUILDS = $(foreach mode,$(MODES),$(addsuffix .$(mode),$(ARCHES))) | 115 BUILDS = $(foreach mode,$(MODES),$(addsuffix .$(mode),$(ARCHES))) |
115 # Generates corresponding test targets, e.g. "ia32.release.check". | 116 # Generates corresponding test targets, e.g. "ia32.release.check". |
116 CHECKS = $(addsuffix .check,$(BUILDS)) | 117 CHECKS = $(addsuffix .check,$(BUILDS)) |
117 # File where previously used GYPFLAGS are stored. | 118 # File where previously used GYPFLAGS are stored. |
118 ENVFILE = $(OUTDIR)/environment | 119 ENVFILE = $(OUTDIR)/environment |
119 | 120 |
120 .PHONY: all check clean dependencies $(ENVFILE).new native \ | 121 .PHONY: all check clean dependencies $(ENVFILE).new native \ |
121 $(ARCHES) $(MODES) $(BUILDS) $(CHECKS) $(addsuffix .clean,$(ARCHES)) \ | 122 $(ARCHES) $(MODES) $(BUILDS) $(CHECKS) $(addsuffix .clean,$(ARCHES)) \ |
122 $(addsuffix .check,$(MODES)) $(addsuffix .check,$(ARCHES)) | 123 $(addsuffix .check,$(MODES)) $(addsuffix .check,$(ARCHES)) |
123 | 124 |
124 # Target definitions. "all" is the default. | 125 # Target definitions. "all" is the default. |
125 all: $(MODES) | 126 all: $(MODES) |
126 | 127 |
127 # Compile targets. MODES and ARCHES are convenience targets. | 128 # Compile targets. MODES and ARCHES are convenience targets. |
128 .SECONDEXPANSION: | 129 .SECONDEXPANSION: |
129 $(MODES): $(addsuffix .$$@,$(ARCHES)) | 130 $(MODES): $(addsuffix .$$@,$(DEFAULT_ARCHES)) |
130 | 131 |
131 $(ARCHES): $(addprefix $$@.,$(MODES)) | 132 $(ARCHES): $(addprefix $$@.,$(MODES)) |
132 | 133 |
133 # Defines how to build a particular target (e.g. ia32.release). | 134 # Defines how to build a particular target (e.g. ia32.release). |
134 $(BUILDS): $(OUTDIR)/Makefile-$$(basename $$@) | 135 $(BUILDS): $(OUTDIR)/Makefile-$$(basename $$@) |
135 @$(MAKE) -C "$(OUTDIR)" -f Makefile-$(basename $@) \ | 136 @$(MAKE) -C "$(OUTDIR)" -f Makefile-$(basename $@) \ |
136 CXX="$(CXX)" LINK="$(LINK)" \ | 137 CXX="$(CXX)" LINK="$(LINK)" \ |
137 BUILDTYPE=$(shell echo $(subst .,,$(suffix $@)) | \ | 138 BUILDTYPE=$(shell echo $(subst .,,$(suffix $@)) | \ |
138 python -c "print raw_input().capitalize()") \ | 139 python -c "print raw_input().capitalize()") \ |
139 builddir="$(shell pwd)/$(OUTDIR)/$@" | 140 builddir="$(shell pwd)/$(OUTDIR)/$@" |
140 | 141 |
141 native: $(OUTDIR)/Makefile-native | 142 native: $(OUTDIR)/Makefile-native |
142 @$(MAKE) -C "$(OUTDIR)" -f Makefile-native \ | 143 @$(MAKE) -C "$(OUTDIR)" -f Makefile-native \ |
143 CXX="$(CXX)" LINK="$(LINK)" BUILDTYPE=Release \ | 144 CXX="$(CXX)" LINK="$(LINK)" BUILDTYPE=Release \ |
144 builddir="$(shell pwd)/$(OUTDIR)/$@" | 145 builddir="$(shell pwd)/$(OUTDIR)/$@" |
145 | 146 |
146 # Test targets. | 147 # Test targets. |
147 check: all | 148 check: all |
148 @tools/test-wrapper-gypbuild.py $(TESTJOBS) --outdir=$(OUTDIR) \ | 149 @tools/test-wrapper-gypbuild.py $(TESTJOBS) --outdir=$(OUTDIR) \ |
150 --arch=$(shell echo $(DEFAULT_ARCHES) | sed -e 's/ /,/g') \ | |
Sven Panne
2011/11/09 16:10:20
No need for sed, use subst: http://www.gnu.org/s/h
| |
149 $(TESTFLAGS) | 151 $(TESTFLAGS) |
150 | 152 |
151 $(addsuffix .check,$(MODES)): $$(basename $$@) | 153 $(addsuffix .check,$(MODES)): $$(basename $$@) |
152 @tools/test-wrapper-gypbuild.py $(TESTJOBS) --outdir=$(OUTDIR) \ | 154 @tools/test-wrapper-gypbuild.py $(TESTJOBS) --outdir=$(OUTDIR) \ |
153 --mode=$(basename $@) $(TESTFLAGS) | 155 --mode=$(basename $@) $(TESTFLAGS) |
154 | 156 |
155 $(addsuffix .check,$(ARCHES)): $$(basename $$@) | 157 $(addsuffix .check,$(ARCHES)): $$(basename $$@) |
156 @tools/test-wrapper-gypbuild.py $(TESTJOBS) --outdir=$(OUTDIR) \ | 158 @tools/test-wrapper-gypbuild.py $(TESTJOBS) --outdir=$(OUTDIR) \ |
157 --arch=$(basename $@) $(TESTFLAGS) | 159 --arch=$(basename $@) $(TESTFLAGS) |
158 | 160 |
(...skipping 23 matching lines...) Expand all Loading... | |
182 $(OUTDIR)/Makefile-ia32: $(GYPFILES) $(ENVFILE) | 184 $(OUTDIR)/Makefile-ia32: $(GYPFILES) $(ENVFILE) |
183 build/gyp/gyp --generator-output="$(OUTDIR)" build/all.gyp \ | 185 build/gyp/gyp --generator-output="$(OUTDIR)" build/all.gyp \ |
184 -Ibuild/standalone.gypi --depth=. -Dtarget_arch=ia32 \ | 186 -Ibuild/standalone.gypi --depth=. -Dtarget_arch=ia32 \ |
185 -S-ia32 $(GYPFLAGS) | 187 -S-ia32 $(GYPFLAGS) |
186 | 188 |
187 $(OUTDIR)/Makefile-x64: $(GYPFILES) $(ENVFILE) | 189 $(OUTDIR)/Makefile-x64: $(GYPFILES) $(ENVFILE) |
188 build/gyp/gyp --generator-output="$(OUTDIR)" build/all.gyp \ | 190 build/gyp/gyp --generator-output="$(OUTDIR)" build/all.gyp \ |
189 -Ibuild/standalone.gypi --depth=. -Dtarget_arch=x64 \ | 191 -Ibuild/standalone.gypi --depth=. -Dtarget_arch=x64 \ |
190 -S-x64 $(GYPFLAGS) | 192 -S-x64 $(GYPFLAGS) |
191 | 193 |
192 $(OUTDIR)/Makefile-arm: $(GYPFILES) $(ENVFILE) | 194 $(OUTDIR)/Makefile-arm: $(GYPFILES) $(ENVFILE) build/armu.gypi |
193 build/gyp/gyp --generator-output="$(OUTDIR)" build/all.gyp \ | 195 build/gyp/gyp --generator-output="$(OUTDIR)" build/all.gyp \ |
194 -Ibuild/standalone.gypi --depth=. -Ibuild/armu.gypi \ | 196 -Ibuild/standalone.gypi --depth=. -Ibuild/armu.gypi \ |
195 -S-arm $(GYPFLAGS) | 197 -S-arm $(GYPFLAGS) |
196 | 198 |
199 $(OUTDIR)/Makefile-mips: $(GYPFILES) $(ENVFILE) build/mipsu.gypi | |
200 build/gyp/gyp --generator-output="$(OUTDIR)" build/all.gyp \ | |
201 -Ibuild/standalone.gypi --depth=. -Ibuild/mipsu.gypi \ | |
202 -S-mips $(GYPFLAGS) | |
203 | |
197 $(OUTDIR)/Makefile-native: $(GYPFILES) $(ENVFILE) | 204 $(OUTDIR)/Makefile-native: $(GYPFILES) $(ENVFILE) |
198 build/gyp/gyp --generator-output="$(OUTDIR)" build/all.gyp \ | 205 build/gyp/gyp --generator-output="$(OUTDIR)" build/all.gyp \ |
199 -Ibuild/standalone.gypi --depth=. -S-native $(GYPFLAGS) | 206 -Ibuild/standalone.gypi --depth=. -S-native $(GYPFLAGS) |
200 | 207 |
201 # Replaces the old with the new environment file if they're different, which | 208 # Replaces the old with the new environment file if they're different, which |
202 # will trigger GYP to regenerate Makefiles. | 209 # will trigger GYP to regenerate Makefiles. |
203 $(ENVFILE): $(ENVFILE).new | 210 $(ENVFILE): $(ENVFILE).new |
204 @if test -r $(ENVFILE) && cmp $(ENVFILE).new $(ENVFILE) >/dev/null; \ | 211 @if test -r $(ENVFILE) && cmp $(ENVFILE).new $(ENVFILE) >/dev/null; \ |
205 then rm $(ENVFILE).new; \ | 212 then rm $(ENVFILE).new; \ |
206 else mv $(ENVFILE).new $(ENVFILE); fi | 213 else mv $(ENVFILE).new $(ENVFILE); fi |
207 | 214 |
208 # Stores current GYPFLAGS in a file. | 215 # Stores current GYPFLAGS in a file. |
209 $(ENVFILE).new: | 216 $(ENVFILE).new: |
210 @mkdir -p $(OUTDIR); echo "GYPFLAGS=$(GYPFLAGS)" > $(ENVFILE).new; | 217 @mkdir -p $(OUTDIR); echo "GYPFLAGS=$(GYPFLAGS)" > $(ENVFILE).new; |
211 | 218 |
212 # Dependencies. | 219 # Dependencies. |
213 dependencies: | 220 dependencies: |
214 svn checkout --force http://gyp.googlecode.com/svn/trunk build/gyp \ | 221 svn checkout --force http://gyp.googlecode.com/svn/trunk build/gyp \ |
215 --revision 1026 | 222 --revision 1026 |
OLD | NEW |