1 # Makefile that wraps the Gyp and build steps for Unix and Mac (but not Windows)
2 # Uses "ninja" to build the code.
4 # Some usage examples (tested on both Linux and Mac):
9 # # Build and run tests (in Debug mode)
13 # # Build and run tests (in Release mode)
14 # make dm BUILDTYPE=Release
17 # # Build bench and SampleApp (both in Release mode), and then run them
18 # make SampleApp bench BUILDTYPE=Release
19 # out/Release/bench -repeat 2
20 # out/Release/SampleApp
22 # # Build all targets (in Debug mode)
25 # If you want more fine-grained control, you can run gyp and then build the
26 # gyp-generated projects yourself.
28 # See https://sites.google.com/site/skiadocs/ for complete documentation.
34 # Soon we should be able to get rid of VALID_TARGETS, and just pass control
35 # to the gyp-generated Makefile for *any* target name.
36 # But that will be a bit complicated, so let's keep it for a future CL.
37 # Tracked as https://code.google.com/p/skia/issues/detail?id=947 ('eliminate
38 # need for VALID_TARGETS in toplevel Makefile')
40 # TODO(epoger): I'm not sure if the above comment is still valid in a ninja
59 # Default target. This must be listed before all other targets.
63 # As noted in http://code.google.com/p/skia/issues/detail?id=330 , building
64 # multiple targets in parallel was failing. The special .NOTPARALLEL target
65 # tells gnu make not to run targets within this Makefile in parallel.
66 # Targets that ninja builds at this Makefile's behest should not be affected.
69 uname := $(shell uname)
70 ifneq (,$(findstring CYGWIN, $(uname)))
71 $(error Cannot build using Make on Windows. See https://sites.google.com/site/skiadocs/user-documentation/quick-start-guides/windows)
74 # If user requests "make all", chain to our explicitly-declared "everything"
75 # target. See https://code.google.com/p/skia/issues/detail?id=932 ("gyp
76 # automatically creates "all" target on some build flavors but not others")
83 ifneq (out, $(SKIA_OUT))
87 # Run gyp no matter what.
92 # For all specific targets: run gyp if necessary, and then pass control to
93 # the gyp-generated buildfiles.
94 .PHONY: $(VALID_TARGETS)
95 $(VALID_TARGETS):: gyp
96 ninja -C $(SKIA_OUT)/$(BUILDTYPE) $@