OLD | NEW |
---|---|
1 # The following variables will likely need to be modified, depending on where | 1 # The following variables will likely need to be modified, depending on where |
2 # and how you built LLVM & Clang. They can be overridden in a command-line | 2 # and how you built LLVM & Clang. They can be overridden in a command-line |
3 # invocation of make, like: | 3 # invocation of make, like: |
4 # | 4 # |
5 # make LLVM_SRC_PATH=<path> LLVM_BIN_PATH=<path> \ | 5 # make LLVM_SRC_PATH=<path> LLVM_BIN_PATH=<path> \ |
6 # LIBCXX_INSTALL_PATH=<path> CLANG_PATH=<path> ... | 6 # LIBCXX_INSTALL_PATH=<path> CLANG_PATH=<path> ... |
7 # | 7 # |
8 | 8 |
9 # LLVM_SRC_PATH is the path to the root of the checked out source code. This | 9 # LLVM_SRC_PATH is the path to the root of the checked out source code. This |
10 # directory should contain the configure script, the include/ and lib/ | 10 # directory should contain the configure script, the include/ and lib/ |
(...skipping 19 matching lines...) Expand all Loading... | |
30 | 30 |
31 HOST_ARCH ?= x86_64 | 31 HOST_ARCH ?= x86_64 |
32 ifeq ($(HOST_ARCH),x86_64) | 32 ifeq ($(HOST_ARCH),x86_64) |
33 HOST_FLAGS = -m64 -stdlib=libc++ | 33 HOST_FLAGS = -m64 -stdlib=libc++ |
34 else | 34 else |
35 ifeq ($(HOST_ARCH),x86) | 35 ifeq ($(HOST_ARCH),x86) |
36 HOST_FLAGS = -m32 -stdlib=libc++ | 36 HOST_FLAGS = -m32 -stdlib=libc++ |
37 endif | 37 endif |
38 endif | 38 endif |
39 | 39 |
40 # The list of attributes associated with the built executable. | |
41 BUILD_ATTS = x86-32 | |
42 | |
40 ifdef DEBUG | 43 ifdef DEBUG |
41 OBJDIR = build/Debug | 44 OBJDIR = build/Debug |
42 OPTLEVEL = -O0 | 45 OPTLEVEL = -O0 |
46 BUILD_ATTS := $(BUILD_ATTS) debug | |
43 else | 47 else |
44 OBJDIR = build/Release | 48 OBJDIR = build/Release |
45 OPTLEVEL = -O2 | 49 OPTLEVEL = -O2 |
50 BUILD_ATTS := $(BUILD_ATTS) release | |
51 endif | |
52 | |
53 ifdef MINIMAL | |
54 ASSERTIONS := $(ASSERTIONS) -DNO_TEXT_ASM -DNO_DUMP -DNO_LLVM_CL | |
Jim Stichnoth
2014/10/15 22:23:54
Maybe name this DEFINES instead of ASSERTIONS, or
Karl
2014/10/16 16:51:48
Refactored to use CXX_DEFINES.
| |
55 OBJDIR := $(OBJDIR)+Min | |
56 BUILD_ATTS := $(BUILD_ATTS) minimal p2i | |
jvoung (off chromium)
2014/10/15 21:57:05
It seems like the builds should always have "p2i"
Karl
2014/10/16 16:51:48
I tried to make the decision logic needed for test
jvoung (off chromium)
2014/10/20 17:36:00
Ah, what I meant was actually that a list of featu
Karl
2014/10/20 21:00:42
Talked with Jim, and decided that:
1) We assume t
| |
57 else | |
58 BUILD_ATTS := $(BUILD_ATTS) nonminimal p2i l2i lc2i | |
46 endif | 59 endif |
47 | 60 |
48 ifdef NOASSERT | 61 ifdef NOASSERT |
49 ASSERTIONS = -DNDEBUG | 62 ASSERTIONS = -DNDEBUG |
50 else | 63 else |
51 ASSERTIONS = | 64 ASSERTIONS = |
52 OBJDIR := $(OBJDIR)+Asserts | 65 OBJDIR := $(OBJDIR)+Asserts |
66 BUILD_ATTS := $(BUILD_ATTS) asserts | |
53 endif | 67 endif |
54 | 68 |
55 $(info -----------------------------------------------) | 69 $(info -----------------------------------------------) |
56 $(info Using LLVM_SRC_PATH = $(LLVM_SRC_PATH)) | 70 $(info Using LLVM_SRC_PATH = $(LLVM_SRC_PATH)) |
57 $(info Using LLVM_BIN_PATH = $(LLVM_BIN_PATH)) | 71 $(info Using LLVM_BIN_PATH = $(LLVM_BIN_PATH)) |
58 $(info Using LIBCXX_INSTALL_PATH = $(LIBCXX_INSTALL_PATH)) | 72 $(info Using LIBCXX_INSTALL_PATH = $(LIBCXX_INSTALL_PATH)) |
59 $(info Using CLANG_PATH = $(CLANG_PATH)) | 73 $(info Using CLANG_PATH = $(CLANG_PATH)) |
60 $(info Using HOST_ARCH = $(HOST_ARCH)) | 74 $(info Using HOST_ARCH = $(HOST_ARCH)) |
61 $(info -----------------------------------------------) | 75 $(info -----------------------------------------------) |
62 | 76 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
96 IceTypeConverter.cpp \ | 110 IceTypeConverter.cpp \ |
97 IceTypes.cpp \ | 111 IceTypes.cpp \ |
98 llvm2ice.cpp \ | 112 llvm2ice.cpp \ |
99 PNaClTranslator.cpp | 113 PNaClTranslator.cpp |
100 | 114 |
101 OBJS=$(patsubst %.cpp, $(OBJDIR)/%.o, $(SRCS)) | 115 OBJS=$(patsubst %.cpp, $(OBJDIR)/%.o, $(SRCS)) |
102 | 116 |
103 # Keep all the first target so it's the default. | 117 # Keep all the first target so it's the default. |
104 all: $(OBJDIR)/llvm2ice make_symlink | 118 all: $(OBJDIR)/llvm2ice make_symlink |
105 | 119 |
106 make_symlink: $(OBJDIR)/llvm2ice | 120 make_symlink: $(OBJDIR)/llvm2ice $(OBJDIR)/llvm2ice.build_atts |
107 » rm -f llvm2ice | 121 » rm -f llvm2ice llvm2ice.build_atts |
108 ln -s $(OBJDIR)/llvm2ice | 122 ln -s $(OBJDIR)/llvm2ice |
123 ln -s $(OBJDIR)/llvm2ice.build_atts | |
109 | 124 |
110 .PHONY: all make_symlink | 125 .PHONY: all make_symlink |
111 | 126 |
112 $(OBJDIR)/llvm2ice: $(OBJS) | 127 $(OBJDIR)/llvm2ice: $(OBJS) |
113 $(CXX) $(LDFLAGS) -o $@ $^ $(LLVM_LDFLAGS) -ldl \ | 128 $(CXX) $(LDFLAGS) -o $@ $^ $(LLVM_LDFLAGS) -ldl \ |
114 -Wl,-rpath=$(abspath $(LIBCXX_INSTALL_PATH)/lib) | 129 -Wl,-rpath=$(abspath $(LIBCXX_INSTALL_PATH)/lib) |
130 echo "$(BUILD_ATTS)" > $@.build_atts | |
115 | 131 |
116 # TODO: Be more precise than "*.h" here and elsewhere. | 132 # TODO: Be more precise than "*.h" here and elsewhere. |
117 $(OBJS): $(OBJDIR)/%.o: src/%.cpp src/*.h src/*.def | 133 $(OBJS): $(OBJDIR)/%.o: src/%.cpp src/*.h src/*.def |
118 $(CXX) -c $(CXXFLAGS) $< -o $@ | 134 $(CXX) -c $(CXXFLAGS) $< -o $@ |
119 | 135 |
120 $(OBJS): | $(OBJDIR) | 136 $(OBJS): | $(OBJDIR) |
121 | 137 |
122 $(OBJDIR): | 138 $(OBJDIR): |
123 @mkdir -p $@ | 139 @mkdir -p $@ |
124 | 140 |
(...skipping 17 matching lines...) Expand all Loading... | |
142 ifeq (,$(wildcard /usr/lib/clang-format/clang-format-diff.py)) | 158 ifeq (,$(wildcard /usr/lib/clang-format/clang-format-diff.py)) |
143 CLANG_FORMAT_DIFF = clang-format-diff.py | 159 CLANG_FORMAT_DIFF = clang-format-diff.py |
144 else | 160 else |
145 CLANG_FORMAT_DIFF = /usr/lib/clang-format/clang-format-diff.py | 161 CLANG_FORMAT_DIFF = /usr/lib/clang-format/clang-format-diff.py |
146 endif | 162 endif |
147 format-diff: | 163 format-diff: |
148 git diff -U0 `git merge-base HEAD master` | \ | 164 git diff -U0 `git merge-base HEAD master` | \ |
149 $(CLANG_FORMAT_DIFF) -p1 -style=LLVM -i | 165 $(CLANG_FORMAT_DIFF) -p1 -style=LLVM -i |
150 | 166 |
151 clean: | 167 clean: |
152 » rm -rf llvm2ice *.o build/ | 168 » rm -rf llvm2ice llvm2ice.build_atts *.o $(OBJDIR) |
169 | |
170 clean-all: clean | |
171 » rm -rf build/ | |
OLD | NEW |