-
Notifications
You must be signed in to change notification settings - Fork 10.3k
/
Makefile
83 lines (62 loc) · 1.94 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
83
##===- Makefile --------------------------------------------*- Makefile -*-===##
#
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2015 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See http://swift.org/LICENSE.txt for license information
# See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
#
##===----------------------------------------------------------------------===##
# If SWIFT_LEVEL is not set, then we are the top-level Makefile. Otherwise, we
# are being included from a subdirectory makefile.
ifndef SWIFT_LEVEL
IS_TOP_LEVEL := 1
SWIFT_LEVEL := .
DIRS := lib tools # include docs
PARALLEL_DIRS :=
endif
ifeq ($(MAKECMDGOALS),libs-only)
DIRS := $(filter-out tools docs, $(DIRS))
OPTIONAL_DIRS :=
endif
###
# Common Makefile code, shared by all Swift Makefiles.
# Set LLVM source root level.
LEVEL := $(SWIFT_LEVEL)/../..
# Include LLVM common makefile.
include $(LEVEL)/Makefile.common
# Set common Swift build flags.
CPP.Flags += -I$(PROJ_SRC_DIR)/$(SWIFT_LEVEL)/include \
-I$(PROJ_OBJ_DIR)/$(SWIFT_LEVEL)/include
ifdef SWIFT_VENDOR
CPP.Flags += -DSWIFT_VENDOR='"$(SWIFT_VENDOR) "'
endif
###
# Swift Top Level specific stuff.
ifeq ($(IS_TOP_LEVEL),1)
ifneq ($(PROJ_SRC_ROOT),$(PROJ_OBJ_ROOT))
$(RecursiveTargets)::
$(Verb) if [ ! -f test/Makefile ]; then \
$(MKDIR) test; \
$(CP) $(PROJ_SRC_DIR)/test/Makefile test/Makefile; \
fi
endif
test::
@ $(MAKE) -C test
report::
@ $(MAKE) -C test report
clean::
@ $(MAKE) -C test clean
libs-only: all
tags::
$(Verb) etags `find . -type f -name '*.h' -or -name '*.cpp' | \
grep -v /lib/Headers | grep -v /test/`
cscope.files:
find tools lib include -name '*.cpp' \
-or -name '*.def' \
-or -name '*.td' \
-or -name '*.h' > cscope.files
.PHONY: test report clean cscope.files
endif