Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(22)

Side by Side Diff: Makefile

Issue 10268010: Clean up Makefile, enable MIPS cross-compilation (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: fix nits Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | build/armu.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2012 the V8 project authors. All rights reserved. 1 # Copyright 2012 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 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 # Target definitions. "all" is the default. 137 # Target definitions. "all" is the default.
138 all: $(MODES) 138 all: $(MODES)
139 139
140 # Compile targets. MODES and ARCHES are convenience targets. 140 # Compile targets. MODES and ARCHES are convenience targets.
141 .SECONDEXPANSION: 141 .SECONDEXPANSION:
142 $(MODES): $(addsuffix .$$@,$(DEFAULT_ARCHES)) 142 $(MODES): $(addsuffix .$$@,$(DEFAULT_ARCHES))
143 143
144 $(ARCHES): $(addprefix $$@.,$(MODES)) 144 $(ARCHES): $(addprefix $$@.,$(MODES))
145 145
146 # Defines how to build a particular target (e.g. ia32.release). 146 # Defines how to build a particular target (e.g. ia32.release).
147 $(BUILDS): $(OUTDIR)/Makefile-$$(basename $$@) 147 $(BUILDS): $(OUTDIR)/Makefile.$$(basename $$@)
148 » @$(MAKE) -C "$(OUTDIR)" -f Makefile-$(basename $@) \ 148 » @$(MAKE) -C "$(OUTDIR)" -f Makefile.$(basename $@) \
149 CXX="$(CXX)" LINK="$(LINK)" \ 149 CXX="$(CXX)" LINK="$(LINK)" \
150 BUILDTYPE=$(shell echo $(subst .,,$(suffix $@)) | \ 150 BUILDTYPE=$(shell echo $(subst .,,$(suffix $@)) | \
151 python -c "print raw_input().capitalize()") \ 151 python -c "print raw_input().capitalize()") \
152 builddir="$(shell pwd)/$(OUTDIR)/$@" 152 builddir="$(shell pwd)/$(OUTDIR)/$@"
153 153
154 native: $(OUTDIR)/Makefile-native 154 native: $(OUTDIR)/Makefile.native
155 » @$(MAKE) -C "$(OUTDIR)" -f Makefile-native \ 155 » @$(MAKE) -C "$(OUTDIR)" -f Makefile.native \
156 CXX="$(CXX)" LINK="$(LINK)" BUILDTYPE=Release \ 156 CXX="$(CXX)" LINK="$(LINK)" BUILDTYPE=Release \
157 builddir="$(shell pwd)/$(OUTDIR)/$@" 157 builddir="$(shell pwd)/$(OUTDIR)/$@"
158 158
159 # TODO(jkummerow): add "android.debug" when we need it. 159 # TODO(jkummerow): add "android.debug" when we need it.
160 android android.release: $(OUTDIR)/Makefile-android 160 android android.release: $(OUTDIR)/Makefile.android
161 » @$(MAKE) -C "$(OUTDIR)" -f Makefile-android \ 161 » @$(MAKE) -C "$(OUTDIR)" -f Makefile.android \
162 CXX="$(ANDROID_TOOL_PREFIX)-g++" \ 162 CXX="$(ANDROID_TOOL_PREFIX)-g++" \
163 AR="$(ANDROID_TOOL_PREFIX)-ar" \ 163 AR="$(ANDROID_TOOL_PREFIX)-ar" \
164 RANLIB="$(ANDROID_TOOL_PREFIX)-ranlib" \ 164 RANLIB="$(ANDROID_TOOL_PREFIX)-ranlib" \
165 CC="$(ANDROID_TOOL_PREFIX)-gcc" \ 165 CC="$(ANDROID_TOOL_PREFIX)-gcc" \
166 LD="$(ANDROID_TOOL_PREFIX)-ld" \ 166 LD="$(ANDROID_TOOL_PREFIX)-ld" \
167 LINK="$(ANDROID_TOOL_PREFIX)-g++" \ 167 LINK="$(ANDROID_TOOL_PREFIX)-g++" \
168 BUILDTYPE=Release \ 168 BUILDTYPE=Release \
169 builddir="$(shell pwd)/$(OUTDIR)/android.release" 169 builddir="$(shell pwd)/$(OUTDIR)/android.release"
170 170
171 # Test targets. 171 # Test targets.
(...skipping 12 matching lines...) Expand all
184 184
185 $(CHECKS): $$(basename $$@) 185 $(CHECKS): $$(basename $$@)
186 @tools/test-wrapper-gypbuild.py $(TESTJOBS) --outdir=$(OUTDIR) \ 186 @tools/test-wrapper-gypbuild.py $(TESTJOBS) --outdir=$(OUTDIR) \
187 --arch-and-mode=$(basename $@) $(TESTFLAGS) 187 --arch-and-mode=$(basename $@) $(TESTFLAGS)
188 188
189 native.check: native 189 native.check: native
190 @tools/test-wrapper-gypbuild.py $(TESTJOBS) --outdir=$(OUTDIR)/native \ 190 @tools/test-wrapper-gypbuild.py $(TESTJOBS) --outdir=$(OUTDIR)/native \
191 --arch-and-mode=. $(TESTFLAGS) 191 --arch-and-mode=. $(TESTFLAGS)
192 192
193 # Clean targets. You can clean each architecture individually, or everything. 193 # Clean targets. You can clean each architecture individually, or everything.
194 $(addsuffix .clean,$(ARCHES)): 194 $(addsuffix .clean,$(ARCHES)) android.clean:
195 » rm -f $(OUTDIR)/Makefile-$(basename $@) 195 » rm -f $(OUTDIR)/Makefile.$(basename $@)
196 rm -rf $(OUTDIR)/$(basename $@).release 196 rm -rf $(OUTDIR)/$(basename $@).release
197 rm -rf $(OUTDIR)/$(basename $@).debug 197 rm -rf $(OUTDIR)/$(basename $@).debug
198 » find $(OUTDIR) -regex '.*\(host\|target\)-$(basename $@)\.mk' -delete 198 » find $(OUTDIR) -regex '.*\(host\|target\).$(basename $@)\.mk' -delete
199 199
200 native.clean: 200 native.clean:
201 » rm -f $(OUTDIR)/Makefile-native 201 » rm -f $(OUTDIR)/Makefile.native
202 rm -rf $(OUTDIR)/native 202 rm -rf $(OUTDIR)/native
203 » find $(OUTDIR) -regex '.*\(host\|target\)-native\.mk' -delete 203 » find $(OUTDIR) -regex '.*\(host\|target\).native\.mk' -delete
204 204
205 android.clean: 205 clean: $(addsuffix .clean,$(ARCHES)) native.clean android.clean
206 » rm -f $(OUTDIR)/Makefile-android
207 » rm -rf $(OUTDIR)/android.release
208 » find $(OUTDIR) -regex '.*\(host\|target\)-android\.mk' -delete
209
210 clean: $(addsuffix .clean,$(ARCHES)) native.clean
211 206
212 # GYP file generation targets. 207 # GYP file generation targets.
213 $(OUTDIR)/Makefile-ia32: $(GYPFILES) $(ENVFILE) 208 MAKEFILES = $(addprefix $(OUTDIR)/Makefile.,$(ARCHES))
209 $(MAKEFILES): $(GYPFILES) $(ENVFILE)
214 GYP_GENERATORS=make \ 210 GYP_GENERATORS=make \
215 build/gyp/gyp --generator-output="$(OUTDIR)" build/all.gyp \ 211 build/gyp/gyp --generator-output="$(OUTDIR)" build/all.gyp \
216 » -Ibuild/standalone.gypi --depth=. -Dtarget_arch=ia32 \ 212 » -Ibuild/standalone.gypi --depth=. \
217 » -S-ia32 $(GYPFLAGS) 213 » -Dv8_target_arch=$(subst .,,$(suffix $@)) \
214 » -S.$(subst .,,$(suffix $@)) $(GYPFLAGS)
218 215
219 $(OUTDIR)/Makefile-x64: $(GYPFILES) $(ENVFILE) 216 $(OUTDIR)/Makefile.native: $(GYPFILES) $(ENVFILE)
220 GYP_GENERATORS=make \ 217 GYP_GENERATORS=make \
221 build/gyp/gyp --generator-output="$(OUTDIR)" build/all.gyp \ 218 build/gyp/gyp --generator-output="$(OUTDIR)" build/all.gyp \
222 » -Ibuild/standalone.gypi --depth=. -Dtarget_arch=x64 \ 219 » -Ibuild/standalone.gypi --depth=. -S.native $(GYPFLAGS)
223 » -S-x64 $(GYPFLAGS)
224 220
225 $(OUTDIR)/Makefile-arm: $(GYPFILES) $(ENVFILE) build/armu.gypi 221 $(OUTDIR)/Makefile.android: $(GYPFILES) $(ENVFILE) build/android.gypi \
226 » GYP_GENERATORS=make \
227 » build/gyp/gyp --generator-output="$(OUTDIR)" build/all.gyp \
228 » -Ibuild/standalone.gypi --depth=. -Ibuild/armu.gypi \
229 » -S-arm $(GYPFLAGS)
230
231 $(OUTDIR)/Makefile-mips: $(GYPFILES) $(ENVFILE) build/mipsu.gypi
232 » GYP_GENERATORS=make \
233 » build/gyp/gyp --generator-output="$(OUTDIR)" build/all.gyp \
234 » -Ibuild/standalone.gypi --depth=. -Ibuild/mipsu.gypi \
235 » -S-mips $(GYPFLAGS)
236
237 $(OUTDIR)/Makefile-native: $(GYPFILES) $(ENVFILE)
238 » GYP_GENERATORS=make \
239 » build/gyp/gyp --generator-output="$(OUTDIR)" build/all.gyp \
240 » -Ibuild/standalone.gypi --depth=. -S-native $(GYPFLAGS)
241
242 $(OUTDIR)/Makefile-android: $(GYPFILES) $(ENVFILE) build/android.gypi \
243 must-set-ANDROID_NDK_ROOT 222 must-set-ANDROID_NDK_ROOT
244 GYP_GENERATORS=make \ 223 GYP_GENERATORS=make \
245 CC="${ANDROID_TOOL_PREFIX}-gcc" \ 224 CC="${ANDROID_TOOL_PREFIX}-gcc" \
246 build/gyp/gyp --generator-output="$(OUTDIR)" build/all.gyp \ 225 build/gyp/gyp --generator-output="$(OUTDIR)" build/all.gyp \
247 -Ibuild/standalone.gypi --depth=. -Ibuild/android.gypi \ 226 -Ibuild/standalone.gypi --depth=. -Ibuild/android.gypi \
248 » -S-android $(GYPFLAGS) 227 » -S.android $(GYPFLAGS)
249 228
250 must-set-ANDROID_NDK_ROOT: 229 must-set-ANDROID_NDK_ROOT:
251 ifndef ANDROID_NDK_ROOT 230 ifndef ANDROID_NDK_ROOT
252 $(error ANDROID_NDK_ROOT is not set) 231 $(error ANDROID_NDK_ROOT is not set)
253 endif 232 endif
254 233
255 # Replaces the old with the new environment file if they're different, which 234 # Replaces the old with the new environment file if they're different, which
256 # will trigger GYP to regenerate Makefiles. 235 # will trigger GYP to regenerate Makefiles.
257 $(ENVFILE): $(ENVFILE).new 236 $(ENVFILE): $(ENVFILE).new
258 @if test -r $(ENVFILE) && cmp $(ENVFILE).new $(ENVFILE) >/dev/null; \ 237 @if test -r $(ENVFILE) && cmp $(ENVFILE).new $(ENVFILE) >/dev/null; \
259 then rm $(ENVFILE).new; \ 238 then rm $(ENVFILE).new; \
260 else mv $(ENVFILE).new $(ENVFILE); fi 239 else mv $(ENVFILE).new $(ENVFILE); fi
261 240
262 # Stores current GYPFLAGS in a file. 241 # Stores current GYPFLAGS in a file.
263 $(ENVFILE).new: 242 $(ENVFILE).new:
264 @mkdir -p $(OUTDIR); echo "GYPFLAGS=$(GYPFLAGS)" > $(ENVFILE).new; \ 243 @mkdir -p $(OUTDIR); echo "GYPFLAGS=$(GYPFLAGS)" > $(ENVFILE).new; \
265 echo "CXX=$(CXX)" >> $(ENVFILE).new 244 echo "CXX=$(CXX)" >> $(ENVFILE).new
266 245
267 # Dependencies. 246 # Dependencies.
268 dependencies: 247 dependencies:
269 svn checkout --force http://gyp.googlecode.com/svn/trunk build/gyp \ 248 svn checkout --force http://gyp.googlecode.com/svn/trunk build/gyp \
270 --revision 1282 249 --revision 1282
OLDNEW
« no previous file with comments | « no previous file | build/armu.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698