gyp: generate "everything" and "most" targets instead of "all"

"make all" at the toplevel now chains to "make everything"

BUG=http://code.google.com/p/skia/issues/detail?id=932
Review URL: https://codereview.appspot.com/6651064

git-svn-id: http://skia.googlecode.com/svn/trunk@6116 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
epoger@google.com 2012-10-25 16:32:07 +00:00
parent f28dd8ab10
commit 6714ea4e4d
5 changed files with 62 additions and 86 deletions

View File

@ -25,22 +25,28 @@
# If you want more fine-grained control, you can run gyp and then build the # If you want more fine-grained control, you can run gyp and then build the
# gyp-generated projects yourself. # gyp-generated projects yourself.
# #
# See http://code.google.com/p/skia/wiki/DocRoot for complete documentation. # See https://sites.google.com/site/skiadocs/ for complete documentation.
BUILDTYPE ?= Debug BUILDTYPE ?= Debug
CWD := $(shell pwd) CWD := $(shell pwd)
ALL_TARGETS := skia_base_libs \
# Soon we should be able to get rid of VALID_TARGETS, and just pass control
# to the gyp-generated Makefile for *any* target name.
# But that will be a bit complicated, so let's keep it for a future CL.
# Tracked as https://code.google.com/p/skia/issues/detail?id=947 ('eliminate
# need for VALID_TARGETS in toplevel Makefile')
VALID_TARGETS := \
bench \ bench \
debugger \
everything \
gm \ gm \
most \ most \
SampleApp \ SampleApp \
SkiaAndroidApp \
skia_base_libs \
tests \ tests \
tools tools
ifneq (,$(findstring skia_os=android, $(GYP_DEFINES)))
ALL_TARGETS += SkiaAndroidApp
endif
# Default target. This must be listed before all other targets. # Default target. This must be listed before all other targets.
.PHONY: default .PHONY: default
default: most default: most
@ -54,21 +60,19 @@ default: most
uname := $(shell uname) uname := $(shell uname)
ifneq (,$(findstring CYGWIN, $(uname))) ifneq (,$(findstring CYGWIN, $(uname)))
$(error Cannot build using Make on Windows. See http://code.google.com/p/skia/wiki/GettingStartedOnWindows) $(error Cannot build using Make on Windows. See https://sites.google.com/site/skiadocs/user-documentation/quick-start-guides/windows)
endif endif
# If user requests "make all", chain to our explicitly-declared "everything"
# target. See https://code.google.com/p/skia/issues/detail?id=932 ("gyp
# automatically creates "all" target on some build flavors but not others")
.PHONY: all .PHONY: all
all: $(ALL_TARGETS) all: everything
.PHONY: clean .PHONY: clean
clean: clean:
rm -rf out xcodebuild rm -rf out xcodebuild
# Add the debugger to the target list after the 'all' target is defined so that the
# debugger is only executed with 'make debugger' and not 'make all' as well. The reason
# for this is unless the user has Qt installed the debugger target will fail.
ALL_TARGETS += debugger
# Run gyp no matter what. # Run gyp no matter what.
.PHONY: gyp .PHONY: gyp
gyp: gyp:
@ -99,8 +103,8 @@ out/Makefile:
# the gyp-generated buildfiles. # the gyp-generated buildfiles.
# #
# For the Mac, we create a convenience symlink to the generated binary. # For the Mac, we create a convenience symlink to the generated binary.
.PHONY: $(ALL_TARGETS) .PHONY: $(VALID_TARGETS)
$(ALL_TARGETS):: gyp_if_needed $(VALID_TARGETS):: gyp_if_needed
ifneq (,$(findstring skia_os=android, $(GYP_DEFINES))) ifneq (,$(findstring skia_os=android, $(GYP_DEFINES)))
$(MAKE) -C out $@ BUILDTYPE=$(BUILDTYPE) $(MAKE) -C out $@ BUILDTYPE=$(BUILDTYPE)
else ifneq (,$(findstring Linux, $(uname))) else ifneq (,$(findstring Linux, $(uname)))

View File

@ -1,41 +0,0 @@
# Creates a Makefile that is capable of building all executable targets.
#
# To build on Linux:
# ./gyp_skia && make all
#
# Building on other platforms not tested yet.
#
#
#
#
#
#
# THIS IS DEPRECATED IN FAVOR OF trunk/skia.gyp !!!
# Questions? Contact epoger@google.com
#
#
#
#
{
'targets': [
{
'target_name': 'all',
'type': 'none',
'dependencies': [
'bench.gyp:bench',
'gm.gyp:gm',
'SampleApp.gyp:SampleApp',
'tests.gyp:tests',
'tools.gyp:tools',
],
},
],
}
# Local Variables:
# tab-width:2
# indent-tabs-mode:nil
# End:
# vim: set expandtab tabstop=2 shiftwidth=2:

31
gyp/everything.gyp Normal file
View File

@ -0,0 +1,31 @@
# Build EVERYTHING provided by Skia.
# (Start with the "most" target, and then add targets that we intentionally
# left out of "most". See most.gyp for an explanation of which targets are
# left out of "most".)
#
# We used to call this the 'all' target, but in SOME cases that
# conflicted with an automatically-generated 'all' target.
# See https://code.google.com/p/skia/issues/detail?id=932
#
{
'targets': [
{
'target_name': 'everything',
'type': 'none',
'dependencies': ['most.gyp:most'],
'conditions': [
['skia_os == "ios" or skia_os == "android" or (skia_os == "mac" and skia_arch_width == 32)', {
# debugger is not supported on this platform
}, {
'dependencies': [ 'debugger.gyp:debugger' ],
}],
],
},
],
}
# Local Variables:
# tab-width:2
# indent-tabs-mode:nil
# End:
# vim: set expandtab tabstop=2 shiftwidth=2:

View File

@ -24,7 +24,6 @@ TARGET_ALL = 'all'
TARGET_CLEAN = 'clean' TARGET_CLEAN = 'clean'
TARGET_DEFAULT = 'most' TARGET_DEFAULT = 'most'
TARGET_GYP = 'gyp' TARGET_GYP = 'gyp'
LIST_OF_ALL_TARGETS = ['SampleApp', 'bench', 'gm', 'tests', 'tools']
SCRIPT_DIR = os.path.abspath(os.path.dirname(__file__)) SCRIPT_DIR = os.path.abspath(os.path.dirname(__file__))
OUT_SUBDIR = 'out' OUT_SUBDIR = 'out'
@ -141,8 +140,11 @@ def Make(args):
targets = [] targets = []
for arg in args: for arg in args:
# If user requests "make all", chain to our explicitly-declared "everything"
# target. See https://code.google.com/p/skia/issues/detail?id=932 ("gyp
# automatically creates "all" target on some build flavors but not others")
if arg == TARGET_ALL: if arg == TARGET_ALL:
targets.extend(LIST_OF_ALL_TARGETS) targets.append('everything')
elif arg == TARGET_CLEAN: elif arg == TARGET_CLEAN:
MakeClean() MakeClean()
elif arg.startswith('BUILDTYPE='): elif arg.startswith('BUILDTYPE='):

View File

@ -6,36 +6,16 @@
# More targets are defined within the gyp/ directory, but those are # More targets are defined within the gyp/ directory, but those are
# not intended for external use and may change without notice. # not intended for external use and may change without notice.
# #
# Full documentation at http://code.google.com/p/skia/wiki/DocRoot # Full documentation at https://sites.google.com/site/skiadocs/
# #
{ {
'targets': [ 'targets': [
{ {
# Use this target to build everything provided by Skia. 'target_name': 'alltargets',
'target_name': 'all',
'type': 'none', 'type': 'none',
'dependencies': [ 'dependencies': [
# The minimal set of static libraries for basic Skia functionality. 'gyp/everything.gyp:everything',
'gyp/skia_base_libs.gyp:skia_base_libs',
'gyp/bench.gyp:bench',
'gyp/gm.gyp:gm',
'gyp/most.gyp:most', 'gyp/most.gyp:most',
'gyp/SampleApp.gyp:SampleApp',
'gyp/tests.gyp:tests',
'gyp/tools.gyp:tools',
],
'conditions': [
['skia_os == "android"', {
'dependencies': [
'gyp/android_system.gyp:SkiaAndroidApp',
],
}],
# The debugger is not supported for iOS, Android and 32-bit Mac builds.
['skia_os != "ios" and skia_os != "android" and (skia_os != "mac" or skia_arch_width == 64)', {
'dependencies': [ 'gyp/debugger.gyp:debugger' ],
}],
], ],
}, },
], ],