2011-06-22 19:17:28 +00:00
|
|
|
# Makefile that wraps the Gyp and build steps for Unix and Mac (but not Windows)
|
2014-04-01 07:02:41 +00:00
|
|
|
# Uses "ninja" to build the code.
|
2011-06-22 19:17:28 +00:00
|
|
|
#
|
|
|
|
# Some usage examples (tested on both Linux and Mac):
|
|
|
|
#
|
|
|
|
# # Clean everything
|
|
|
|
# make clean
|
|
|
|
#
|
|
|
|
# # Build and run tests (in Debug mode)
|
2014-08-04 16:36:16 +00:00
|
|
|
# make dm
|
|
|
|
# out/Debug/dm
|
2011-06-22 19:17:28 +00:00
|
|
|
#
|
|
|
|
# # Build and run tests (in Release mode)
|
2014-08-04 16:36:16 +00:00
|
|
|
# make dm BUILDTYPE=Release
|
|
|
|
# out/Release/dm
|
2011-06-22 19:17:28 +00:00
|
|
|
#
|
|
|
|
# # Build bench and SampleApp (both in Release mode), and then run them
|
|
|
|
# make SampleApp bench BUILDTYPE=Release
|
|
|
|
# out/Release/bench -repeat 2
|
|
|
|
# out/Release/SampleApp
|
|
|
|
#
|
|
|
|
# # Build all targets (in Debug mode)
|
|
|
|
# make
|
|
|
|
#
|
|
|
|
# If you want more fine-grained control, you can run gyp and then build the
|
|
|
|
# gyp-generated projects yourself.
|
|
|
|
#
|
2015-02-03 15:12:54 +00:00
|
|
|
# See https://skia.org for complete documentation.
|
2011-06-22 19:17:28 +00:00
|
|
|
|
2012-11-28 14:11:41 +00:00
|
|
|
SKIA_OUT ?= out
|
2011-06-22 19:17:28 +00:00
|
|
|
BUILDTYPE ?= Debug
|
|
|
|
CWD := $(shell pwd)
|
2011-07-27 14:06:25 +00:00
|
|
|
|
2012-10-25 16:32:07 +00:00
|
|
|
# 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')
|
2014-04-01 07:02:41 +00:00
|
|
|
#
|
|
|
|
# TODO(epoger): I'm not sure if the above comment is still valid in a ninja
|
|
|
|
# world.
|
2012-10-25 16:32:07 +00:00
|
|
|
VALID_TARGETS := \
|
2014-08-29 14:55:34 +00:00
|
|
|
nanobench \
|
2012-10-25 16:32:07 +00:00
|
|
|
debugger \
|
2014-04-24 18:16:13 +00:00
|
|
|
dm \
|
2012-10-25 16:32:07 +00:00
|
|
|
everything \
|
2015-06-25 14:47:40 +00:00
|
|
|
lua_app \
|
|
|
|
lua_pictures \
|
2012-10-25 16:32:07 +00:00
|
|
|
most \
|
2013-04-11 14:09:50 +00:00
|
|
|
pathops_unittest \
|
2013-06-10 20:44:45 +00:00
|
|
|
pdfviewer \
|
2012-10-25 16:32:07 +00:00
|
|
|
SampleApp \
|
2013-08-12 12:30:04 +00:00
|
|
|
SampleApp_APK \
|
2013-06-17 15:39:43 +00:00
|
|
|
skhello \
|
2013-06-03 12:10:19 +00:00
|
|
|
skia_lib \
|
2013-11-01 17:36:03 +00:00
|
|
|
skpskgr_test \
|
2013-06-14 17:26:54 +00:00
|
|
|
tools \
|
|
|
|
skpdiff
|
2012-06-27 19:04:39 +00:00
|
|
|
|
2011-07-27 14:06:25 +00:00
|
|
|
# Default target. This must be listed before all other targets.
|
|
|
|
.PHONY: default
|
2012-10-18 16:10:56 +00:00
|
|
|
default: most
|
2011-07-27 14:06:25 +00:00
|
|
|
|
|
|
|
# As noted in http://code.google.com/p/skia/issues/detail?id=330 , building
|
|
|
|
# multiple targets in parallel was failing. The special .NOTPARALLEL target
|
2014-04-01 07:02:41 +00:00
|
|
|
# tells gnu make not to run targets within this Makefile in parallel.
|
|
|
|
# Targets that ninja builds at this Makefile's behest should not be affected.
|
2011-07-27 14:06:25 +00:00
|
|
|
.NOTPARALLEL:
|
2011-06-22 19:17:28 +00:00
|
|
|
|
|
|
|
uname := $(shell uname)
|
|
|
|
ifneq (,$(findstring CYGWIN, $(uname)))
|
2015-02-03 15:12:54 +00:00
|
|
|
$(error Cannot build using Make on Windows. See https://skia.org/user/quick/windows)
|
2011-06-22 19:17:28 +00:00
|
|
|
endif
|
|
|
|
|
2012-10-25 16:32:07 +00:00
|
|
|
# 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")
|
2011-06-22 19:17:28 +00:00
|
|
|
.PHONY: all
|
2012-10-25 16:32:07 +00:00
|
|
|
all: everything
|
2011-06-22 19:17:28 +00:00
|
|
|
|
|
|
|
.PHONY: clean
|
|
|
|
clean:
|
|
|
|
rm -rf out xcodebuild
|
2012-11-28 14:11:41 +00:00
|
|
|
ifneq (out, $(SKIA_OUT))
|
|
|
|
rm -rf $(SKIA_OUT)
|
|
|
|
endif
|
2011-06-22 19:17:28 +00:00
|
|
|
|
2011-07-27 14:06:25 +00:00
|
|
|
# Run gyp no matter what.
|
|
|
|
.PHONY: gyp
|
|
|
|
gyp:
|
2015-03-03 14:05:56 +00:00
|
|
|
$(CWD)/gyp_skia --no-parallel -G config=$(BUILDTYPE)
|
2011-07-27 14:06:25 +00:00
|
|
|
|
|
|
|
# For all specific targets: run gyp if necessary, and then pass control to
|
|
|
|
# the gyp-generated buildfiles.
|
2012-10-25 16:32:07 +00:00
|
|
|
.PHONY: $(VALID_TARGETS)
|
2014-04-01 07:02:41 +00:00
|
|
|
$(VALID_TARGETS):: gyp
|
|
|
|
ninja -C $(SKIA_OUT)/$(BUILDTYPE) $@
|