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 13 matching lines...) Loading... | |
24 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 24 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
25 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 25 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
26 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 | 27 |
28 | 28 |
29 # Variable default definitions. Override them by exporting them in your shell. | 29 # Variable default definitions. Override them by exporting them in your shell. |
30 CXX ?= "g++" # For distcc: export CXX="distcc g++" | 30 CXX ?= "g++" # For distcc: export CXX="distcc g++" |
31 LINK ?= "g++" | 31 LINK ?= "g++" |
32 OUTDIR ?= out | 32 OUTDIR ?= out |
33 TESTJOBS ?= -j16 | 33 TESTJOBS ?= -j16 |
34 GYPFLAGS ?= -Dv8_can_use_vfp_instructions=true | 34 GYPFLAGS ?= |
35 | 35 |
36 # Architectures and modes to be compiled. | 36 # Special build flags. Use them like this: "make library=shared" |
37 | |
38 # library=shared || component=shared_library | |
39 ifeq ($(library), shared) | |
40 GYPFLAGS += -Dcomponent=shared_library | |
41 endif | |
42 ifdef $(component) | |
43 GYPFLAGS += -Dcomponent=$(component) | |
44 endif | |
45 # console=readline | |
46 ifdef $(console) | |
47 GYPFLAGS += -Dconsole=$(console) | |
48 endif | |
49 # disassembler=on | |
50 ifeq ($(disassembler), on) | |
51 GYPFLAGS += -Dv8_enable_disassembler=1 | |
52 endif | |
53 # snapshot=off | |
54 ifeq ($(snapshot), off) | |
55 GYPFLAGS += -Dv8_use_snapshot='false' | |
56 endif | |
57 # gdbjit=on | |
58 ifeq ($(gdbjit), on) | |
59 GYPFLAGS += -Dv8_enable_gdbjit=1 | |
60 endif | |
61 # liveobjectlist=on | |
62 ifeq ($(liveobjectlist), on) | |
63 GYPFLAGS += -Dv8_use_liveobjectlist=true | |
64 endif | |
65 # vfp3=off | |
66 ifeq ($(vfp3), off) | |
67 GYPFLAGS += -Dv8_can_use_vfp_instructions=false | |
68 else | |
69 GYPFLAGS += -Dv8_can_use_vfp_instructions=true | |
70 endif | |
71 | |
72 # ----------------- available targets: -------------------- | |
73 # - any arch listed in ARCHES | |
74 # - any mode listed in MODES | |
75 # - every combination <arch>.<mode>, e.g. "ia32.release" | |
76 # - any of the above with .check appended, e.g. "ia32.release.check" | |
77 # - default (no target specified): build all ARCHES and MODES | |
78 # - "check": build all targets and run all tests | |
79 # - "<arch>.clean" for any <arch> in ARCHES | |
80 # - "clean": clean all ARCHES | |
81 | |
82 # ----------------- internal stuff ------------------------ | |
83 | |
84 # Architectures and modes to be compiled. Consider these to be internal | |
85 # variables, don't override them (use the targets instead). | |
37 ARCHES = ia32 x64 arm | 86 ARCHES = ia32 x64 arm |
38 MODES = release debug | 87 MODES = release debug |
39 | 88 |
40 # List of files that trigger Makefile regeneration: | 89 # List of files that trigger Makefile regeneration: |
41 GYPFILES = build/all.gyp build/common.gypi build/standalone.gypi \ | 90 GYPFILES = build/all.gyp build/common.gypi build/standalone.gypi \ |
42 preparser/preparser.gyp samples/samples.gyp src/d8.gyp \ | 91 preparser/preparser.gyp samples/samples.gyp src/d8.gyp \ |
43 test/cctest/cctest.gyp tools/gyp/v8.gyp | 92 test/cctest/cctest.gyp tools/gyp/v8.gyp |
44 | 93 |
45 # Generates all combinations of ARCHES and MODES, e.g. "ia32.release". | 94 # Generates all combinations of ARCHES and MODES, e.g. "ia32.release". |
46 BUILDS = $(foreach mode,$(MODES),$(addsuffix .$(mode),$(ARCHES))) | 95 BUILDS = $(foreach mode,$(MODES),$(addsuffix .$(mode),$(ARCHES))) |
96 # Generates corresponding test targets, e.g. "ia32.release.check". | |
47 CHECKS = $(addsuffix .check,$(BUILDS)) | 97 CHECKS = $(addsuffix .check,$(BUILDS)) |
48 # Generates corresponding test targets, e.g. "ia32.release.check". | 98 ENVFILE = $(OUTDIR)/environment |
49 | 99 |
50 .PHONY: all release debug ia32 x64 arm $(BUILDS) | 100 .PHONY: all clean generate_environment_file \ |
101 $(ARCHES) $(MODES) $(BUILDS) $(addsuffix .clean,$(ARCHES)) | |
Yang
2011/08/26 07:26:42
trailing whitespace.
Jakob Kummerow
2011/08/26 09:45:33
Done.
| |
51 | 102 |
52 # Target definitions. "all" is the default, you can specify any others on the | 103 # Target definitions. "all" is the default. |
53 # command line, e.g. "make ia32". Targets defined in $(BUILDS), e.g. | 104 all: $(MODES) |
54 # "ia32.debug", can also be specified. | |
55 all: release debug | |
56 | 105 |
57 release: $(addsuffix .release,$(ARCHES)) | 106 # Store current GYPFLAGS in a file so we can trigger regeneration of |
58 | 107 # gyp-generated Makefiles when they change. |
59 debug: $(addsuffix .debug,$(ARCHES)) | 108 generate_environment_file: |
60 | 109 » @echo -e "GYPFLAGS=$(GYPFLAGS)" > $(ENVFILE).new; \ |
61 ia32: $(addprefix ia32.,$(MODES)) | 110 » if test -r $(ENVFILE) && cmp $(ENVFILE).new $(ENVFILE) >/dev/null; t hen \ |
62 | 111 » rm $(ENVFILE).new; \ |
63 x64: $(addprefix x64.,$(MODES)) | 112 » else mv $(ENVFILE).new $(ENVFILE); fi |
Yang
2011/08/26 07:26:42
/bin/sh: out/environment.new: No such file or dire
Jakob Kummerow
2011/08/26 09:45:33
Done.
| |
64 | |
65 arm: $(addprefix arm.,$(MODES)) | |
66 | 113 |
67 .SECONDEXPANSION: | 114 .SECONDEXPANSION: |
115 $(MODES): $(addsuffix .$$@,$(ARCHES)) | |
116 | |
117 $(ARCHES): $(addprefix $$@.,$(MODES)) | |
118 | |
68 $(BUILDS): $(OUTDIR)/Makefile-$$(basename $$@) | 119 $(BUILDS): $(OUTDIR)/Makefile-$$(basename $$@) |
69 @$(MAKE) -C "$(OUTDIR)" -f Makefile-$(basename $@) \ | 120 @$(MAKE) -C "$(OUTDIR)" -f Makefile-$(basename $@) \ |
70 CXX="$(CXX)" LINK="$(LINK)" \ | 121 CXX="$(CXX)" LINK="$(LINK)" \ |
71 BUILDTYPE=$(shell echo $(subst .,,$(suffix $@)) | \ | 122 BUILDTYPE=$(shell echo $(subst .,,$(suffix $@)) | \ |
72 python -c "print raw_input().capitalize()") \ | 123 python -c "print raw_input().capitalize()") \ |
73 builddir="$(shell pwd)/$(OUTDIR)/$@" | 124 builddir="$(shell pwd)/$(OUTDIR)/$@" |
74 | 125 |
75 # Test targets. | 126 # Test targets. |
76 check: all | 127 check: all |
77 @tools/test-wrapper-gypbuild.py $(TESTJOBS) --outdir=$(OUTDIR) | 128 @tools/test-wrapper-gypbuild.py $(TESTJOBS) --outdir=$(OUTDIR) |
(...skipping 10 matching lines...) Loading... | |
88 # Clean targets. You can clean each architecture individually, or everything. | 139 # Clean targets. You can clean each architecture individually, or everything. |
89 $(addsuffix .clean,$(ARCHES)): | 140 $(addsuffix .clean,$(ARCHES)): |
90 rm -f $(OUTDIR)/Makefile-$(basename $@) | 141 rm -f $(OUTDIR)/Makefile-$(basename $@) |
91 rm -rf $(OUTDIR)/$(basename $@).release | 142 rm -rf $(OUTDIR)/$(basename $@).release |
92 rm -rf $(OUTDIR)/$(basename $@).debug | 143 rm -rf $(OUTDIR)/$(basename $@).debug |
93 find $(OUTDIR) -regex '.*\(host\|target\)-$(basename $@)\.mk' -delete | 144 find $(OUTDIR) -regex '.*\(host\|target\)-$(basename $@)\.mk' -delete |
94 | 145 |
95 clean: $(addsuffix .clean,$(ARCHES)) | 146 clean: $(addsuffix .clean,$(ARCHES)) |
96 | 147 |
97 # GYP file generation targets. | 148 # GYP file generation targets. |
98 $(OUTDIR)/Makefile-ia32: $(GYPFILES) | 149 $(OUTDIR)/Makefile-ia32: $(GYPFILES) $(ENVFILE) |
99 build/gyp/gyp --generator-output="$(OUTDIR)" build/all.gyp \ | 150 build/gyp/gyp --generator-output="$(OUTDIR)" build/all.gyp \ |
100 -Ibuild/standalone.gypi --depth=. -Dtarget_arch=ia32 -S-ia 32 \ | 151 -Ibuild/standalone.gypi --depth=. -Dtarget_arch=ia32 -S-ia 32 \ |
101 $(GYPFLAGS) | 152 $(GYPFLAGS) |
102 | 153 |
103 $(OUTDIR)/Makefile-x64: $(GYPFILES) | 154 $(OUTDIR)/Makefile-x64: $(GYPFILES) $(ENVFILE) |
104 build/gyp/gyp --generator-output="$(OUTDIR)" build/all.gyp \ | 155 build/gyp/gyp --generator-output="$(OUTDIR)" build/all.gyp \ |
105 -Ibuild/standalone.gypi --depth=. -Dtarget_arch=x64 -S-x64 \ | 156 -Ibuild/standalone.gypi --depth=. -Dtarget_arch=x64 -S-x64 \ |
106 $(GYPFLAGS) | 157 $(GYPFLAGS) |
107 | 158 |
108 $(OUTDIR)/Makefile-arm: $(GYPFILES) build/armu.gypi | 159 $(OUTDIR)/Makefile-arm: $(GYPFILES) $(ENVFILE) |
109 build/gyp/gyp --generator-output="$(OUTDIR)" build/all.gyp \ | 160 build/gyp/gyp --generator-output="$(OUTDIR)" build/all.gyp \ |
110 -Ibuild/standalone.gypi --depth=. -Ibuild/armu.gypi -S-arm \ | 161 -Ibuild/standalone.gypi --depth=. -Ibuild/armu.gypi -S-arm \ |
111 $(GYPFLAGS) | 162 $(GYPFLAGS) |
163 | |
164 $(ENVFILE): generate_environment_file | |
OLD | NEW |