This repository has been archived by the owner on Sep 4, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
/
Makefile
82 lines (75 loc) · 2.47 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# Makefile that wraps the Gyp and build steps for Unix and Mac (but not Windows)
# Uses "make" to build on Unix, and "xcodebuild" to build on Mac.
#
# Some usage examples (tested on both Linux and Mac):
#
# # Clean everything
# make clean
#
# # Build and run tests (in Debug mode)
# make tests
# out/Debug/tests
#
# # Build and run tests (in Release mode)
# make tests BUILDTYPE=Release
# out/Release/tests
#
# # 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.
#
# See http://code.google.com/p/skia/wiki/DocRoot for complete documentation.
BUILDTYPE ?= Debug
CWD := $(shell pwd)
uname := $(shell uname)
ifneq (,$(findstring CYGWIN, $(uname)))
$(error Cannot build using Make on Windows. See http://code.google.com/p/skia/wiki/GettingStartedOnWindows)
endif
# Default target. This must be listed before all other targets.
.PHONY: default
default: all
.PHONY: all
all: SampleApp bench gm tests tools
.PHONY: clean
clean:
rm -rf out xcodebuild
# Any targets not defined above...
# Ask gyp to generate the buildfiles as appropriate for this platform,
# and then pass control to those buildfiles.
#
# For the Mac, we create a convenience symlink to the generated binary.
%:
./gyp_skia
ifneq (,$(findstring Linux, $(uname)))
$(MAKE) -C out $@ BUILDTYPE=$(BUILDTYPE)
endif
ifneq (,$(findstring Darwin, $(uname)))
xcodebuild -project out/gyp/[email protected] -configuration $(BUILDTYPE)
mkdir -p out/$(BUILDTYPE)
rm -f out/$(BUILDTYPE)/$@
ln -s $(CWD)/xcodebuild/$(BUILDTYPE)/[email protected]/Contents/MacOS/$@ out/$(BUILDTYPE)/$@
endif
# This repetition is ugly, but necessary.
# If there are any files/directories within the same directory as this Makefile
# which share the same name as a target ("tests", for example), then make
# will refuse to rebuild those targets because the file already exists.
local_filenames := $(shell ls)
.PHONY: $(local_filenames)
$(local_filenames)::
./gyp_skia
ifneq (,$(findstring Linux, $(uname)))
$(MAKE) -C out $@ BUILDTYPE=$(BUILDTYPE)
endif
ifneq (,$(findstring Darwin, $(uname)))
xcodebuild -project out/gyp/[email protected] -configuration $(BUILDTYPE)
mkdir -p out/$(BUILDTYPE)
rm -f out/$(BUILDTYPE)/$@
ln -s $(CWD)/xcodebuild/$(BUILDTYPE)/[email protected]/Contents/MacOS/$@ out/$(BUILDTYPE)/$@
endif