OLD | NEW |
1 # Makefile that wraps the Gyp and build steps for Unix and Mac (but not Windows) | 1 # Makefile that wraps the Gyp and build steps for Unix and Mac (but not Windows) |
2 # Uses "ninja" to build the code. | 2 # Uses "ninja" to build the code. |
3 # | 3 # |
4 # Some usage examples (tested on both Linux and Mac): | 4 # Some usage examples (tested on both Linux and Mac): |
5 # | 5 # |
6 # # Clean everything | 6 # # Clean everything |
7 # make clean | 7 # make clean |
8 # | 8 # |
9 # # Build and run tests (in Debug mode) | 9 # # Build and run tests (in Debug mode) |
10 # make dm | 10 # make dm |
11 # out/Debug/dm | 11 # out/Debug/dm |
12 # | 12 # |
13 # # Build and run tests (in Release mode) | 13 # # Build and run tests (in Release mode) |
14 # make dm BUILDTYPE=Release | 14 # make dm BUILDTYPE=Release |
15 # out/Release/dm | 15 # out/Release/dm |
16 # | 16 # |
17 # # Build bench and SampleApp (both in Release mode), and then run them | 17 # # Build bench and SampleApp (both in Release mode), and then run them |
18 # make SampleApp bench BUILDTYPE=Release | 18 # make SampleApp bench BUILDTYPE=Release |
19 # out/Release/bench -repeat 2 | 19 # out/Release/bench -repeat 2 |
20 # out/Release/SampleApp | 20 # out/Release/SampleApp |
21 # | 21 # |
22 # # Build all targets (in Debug mode) | 22 # # Build all targets (in Debug mode) |
23 # make | 23 # make |
24 # | 24 # |
25 # If you want more fine-grained control, you can run gyp and then build the | 25 # If you want more fine-grained control, you can run gyp and then build the |
26 # gyp-generated projects yourself. | 26 # gyp-generated projects yourself. |
27 # | 27 # |
28 # See https://sites.google.com/site/skiadocs/ for complete documentation. | 28 # See https://skia.org for complete documentation. |
29 | 29 |
30 SKIA_OUT ?= out | 30 SKIA_OUT ?= out |
31 BUILDTYPE ?= Debug | 31 BUILDTYPE ?= Debug |
32 CWD := $(shell pwd) | 32 CWD := $(shell pwd) |
33 | 33 |
34 # Soon we should be able to get rid of VALID_TARGETS, and just pass control | 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. | 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. | 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 | 37 # Tracked as https://code.google.com/p/skia/issues/detail?id=947 ('eliminate |
38 # need for VALID_TARGETS in toplevel Makefile') | 38 # need for VALID_TARGETS in toplevel Makefile') |
(...skipping 21 matching lines...) Expand all Loading... |
60 default: most | 60 default: most |
61 | 61 |
62 # As noted in http://code.google.com/p/skia/issues/detail?id=330 , building | 62 # As noted in http://code.google.com/p/skia/issues/detail?id=330 , building |
63 # multiple targets in parallel was failing. The special .NOTPARALLEL target | 63 # multiple targets in parallel was failing. The special .NOTPARALLEL target |
64 # tells gnu make not to run targets within this Makefile in parallel. | 64 # tells gnu make not to run targets within this Makefile in parallel. |
65 # Targets that ninja builds at this Makefile's behest should not be affected. | 65 # Targets that ninja builds at this Makefile's behest should not be affected. |
66 .NOTPARALLEL: | 66 .NOTPARALLEL: |
67 | 67 |
68 uname := $(shell uname) | 68 uname := $(shell uname) |
69 ifneq (,$(findstring CYGWIN, $(uname))) | 69 ifneq (,$(findstring CYGWIN, $(uname))) |
70 $(error Cannot build using Make on Windows. See https://sites.google.com/site/
skiadocs/user-documentation/quick-start-guides/windows) | 70 $(error Cannot build using Make on Windows. See https://skia.org/user/quick/wi
ndows) |
71 endif | 71 endif |
72 | 72 |
73 # If user requests "make all", chain to our explicitly-declared "everything" | 73 # If user requests "make all", chain to our explicitly-declared "everything" |
74 # target. See https://code.google.com/p/skia/issues/detail?id=932 ("gyp | 74 # target. See https://code.google.com/p/skia/issues/detail?id=932 ("gyp |
75 # automatically creates "all" target on some build flavors but not others") | 75 # automatically creates "all" target on some build flavors but not others") |
76 .PHONY: all | 76 .PHONY: all |
77 all: everything | 77 all: everything |
78 | 78 |
79 .PHONY: clean | 79 .PHONY: clean |
80 clean: | 80 clean: |
81 rm -rf out xcodebuild | 81 rm -rf out xcodebuild |
82 ifneq (out, $(SKIA_OUT)) | 82 ifneq (out, $(SKIA_OUT)) |
83 rm -rf $(SKIA_OUT) | 83 rm -rf $(SKIA_OUT) |
84 endif | 84 endif |
85 | 85 |
86 # Run gyp no matter what. | 86 # Run gyp no matter what. |
87 .PHONY: gyp | 87 .PHONY: gyp |
88 gyp: | 88 gyp: |
89 $(CWD)/gyp_skia | 89 $(CWD)/gyp_skia |
90 | 90 |
91 # For all specific targets: run gyp if necessary, and then pass control to | 91 # For all specific targets: run gyp if necessary, and then pass control to |
92 # the gyp-generated buildfiles. | 92 # the gyp-generated buildfiles. |
93 .PHONY: $(VALID_TARGETS) | 93 .PHONY: $(VALID_TARGETS) |
94 $(VALID_TARGETS):: gyp | 94 $(VALID_TARGETS):: gyp |
95 ninja -C $(SKIA_OUT)/$(BUILDTYPE) $@ | 95 ninja -C $(SKIA_OUT)/$(BUILDTYPE) $@ |
OLD | NEW |