Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(332)

Side by Side Diff: Makefile.standalone

Issue 605093002: Subzero: Build both Debug and Release version of llvm2ice. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Remove the duplication Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 ifdef DEBUG
41 OBJDIR = build/Debug
42 OPTLEVEL = -O0
43 else
44 OBJDIR = build/Release
45 OPTLEVEL = -O2
46 endif
47
40 $(info -----------------------------------------------) 48 $(info -----------------------------------------------)
41 $(info Using LLVM_SRC_PATH = $(LLVM_SRC_PATH)) 49 $(info Using LLVM_SRC_PATH = $(LLVM_SRC_PATH))
42 $(info Using LLVM_BIN_PATH = $(LLVM_BIN_PATH)) 50 $(info Using LLVM_BIN_PATH = $(LLVM_BIN_PATH))
43 $(info Using LIBCXX_INSTALL_PATH = $(LIBCXX_INSTALL_PATH)) 51 $(info Using LIBCXX_INSTALL_PATH = $(LIBCXX_INSTALL_PATH))
44 $(info Using CLANG_PATH = $(CLANG_PATH)) 52 $(info Using CLANG_PATH = $(CLANG_PATH))
45 $(info Using HOST_ARCH = $(HOST_ARCH)) 53 $(info Using HOST_ARCH = $(HOST_ARCH))
46 $(info -----------------------------------------------) 54 $(info -----------------------------------------------)
47 55
48 LLVM_CXXFLAGS := `$(LLVM_BIN_PATH)/llvm-config --cxxflags` 56 LLVM_CXXFLAGS := `$(LLVM_BIN_PATH)/llvm-config --cxxflags`
49 LLVM_LDFLAGS := `$(LLVM_BIN_PATH)/llvm-config --libs` \ 57 LLVM_LDFLAGS := `$(LLVM_BIN_PATH)/llvm-config --libs` \
50 `$(LLVM_BIN_PATH)/llvm-config --ldflags` 58 `$(LLVM_BIN_PATH)/llvm-config --ldflags`
51 59
52 # It's recommended that CXX matches the compiler you used to build LLVM itself. 60 # It's recommended that CXX matches the compiler you used to build LLVM itself.
53 OPTLEVEL := -O0
54 CCACHE := `command -v ccache` 61 CCACHE := `command -v ccache`
55 CXX := CCACHE_CPP2=yes $(CCACHE) $(CLANG_PATH)/clang++ 62 CXX := CCACHE_CPP2=yes $(CCACHE) $(CLANG_PATH)/clang++
56 63
57 CXXFLAGS := $(LLVM_CXXFLAGS) -std=c++11 -Wall -Wextra -Werror -fno-rtti \ 64 CXXFLAGS := $(LLVM_CXXFLAGS) -std=c++11 -Wall -Wextra -Werror -fno-rtti \
58 -fno-exceptions $(OPTLEVEL) -g $(HOST_FLAGS) \ 65 -fno-exceptions $(OPTLEVEL) -g $(HOST_FLAGS) \
59 -Wno-error=unused-parameter -I$(LIBCXX_INSTALL_PATH)/include/c++/v1 66 -Wno-error=unused-parameter -I$(LIBCXX_INSTALL_PATH)/include/c++/v1
60 LDFLAGS := $(HOST_FLAGS) -L$(LIBCXX_INSTALL_PATH)/lib 67 LDFLAGS := $(HOST_FLAGS) -L$(LIBCXX_INSTALL_PATH)/lib
61 68
62 SRCS= \ 69 SRCS= \
63 assembler.cpp \ 70 assembler.cpp \
(...skipping 11 matching lines...) Expand all
75 IceRegAlloc.cpp \ 82 IceRegAlloc.cpp \
76 IceRNG.cpp \ 83 IceRNG.cpp \
77 IceTargetLowering.cpp \ 84 IceTargetLowering.cpp \
78 IceTargetLoweringX8632.cpp \ 85 IceTargetLoweringX8632.cpp \
79 IceTranslator.cpp \ 86 IceTranslator.cpp \
80 IceTypeConverter.cpp \ 87 IceTypeConverter.cpp \
81 IceTypes.cpp \ 88 IceTypes.cpp \
82 llvm2ice.cpp \ 89 llvm2ice.cpp \
83 PNaClTranslator.cpp 90 PNaClTranslator.cpp
84 91
85 OBJS=$(patsubst %.cpp, build/%.o, $(SRCS)) 92 OBJS=$(patsubst %.cpp, $(OBJDIR)/%.o, $(SRCS))
86 93
87 # Keep all the first target so it's the default. 94 # Keep all the first target so it's the default.
88 all: llvm2ice 95 all: $(OBJDIR)/llvm2ice make_symlink
89 96
90 .PHONY: all 97 make_symlink: $(OBJDIR)/llvm2ice
98 » rm -f llvm2ice
99 » ln -s $(OBJDIR)/llvm2ice
91 100
92 llvm2ice: $(OBJS) 101 .PHONY: all make_symlink
102
103 $(OBJDIR)/llvm2ice: $(OBJS)
93 $(CXX) $(LDFLAGS) -o $@ $^ $(LLVM_LDFLAGS) -ldl \ 104 $(CXX) $(LDFLAGS) -o $@ $^ $(LLVM_LDFLAGS) -ldl \
94 -Wl,-rpath=$(abspath $(LIBCXX_INSTALL_PATH)/lib) 105 -Wl,-rpath=$(abspath $(LIBCXX_INSTALL_PATH)/lib)
95 106
96 # TODO: Be more precise than "*.h" here and elsewhere. 107 # TODO: Be more precise than "*.h" here and elsewhere.
97 $(OBJS): build/%.o: src/%.cpp src/*.h src/*.def 108 $(OBJS): $(OBJDIR)/%.o: src/%.cpp src/*.h src/*.def
98 $(CXX) -c $(CXXFLAGS) $< -o $@ 109 $(CXX) -c $(CXXFLAGS) $< -o $@
99 110
100 $(OBJS): | build 111 $(OBJS): | $(OBJDIR)
101 112
102 build: 113 $(OBJDIR):
103 @mkdir -p $@ 114 @mkdir -p $@
104 115
105 check-lit: llvm2ice 116 check-lit: llvm2ice
106 LLVM_BIN_PATH=$(LLVM_BIN_PATH) \ 117 LLVM_BIN_PATH=$(LLVM_BIN_PATH) \
107 $(LLVM_SRC_PATH)/utils/lit/lit.py -sv tests_lit 118 $(LLVM_SRC_PATH)/utils/lit/lit.py -sv tests_lit
108 119
109 check: check-lit 120 check: check-lit
110 (cd crosstest; ./runtests.sh) 121 (cd crosstest; ./runtests.sh)
111 122
112 # TODO: Fix the use of wildcards. 123 # TODO: Fix the use of wildcards.
(...skipping 10 matching lines...) Expand all
123 CLANG_FORMAT_DIFF = clang-format-diff.py 134 CLANG_FORMAT_DIFF = clang-format-diff.py
124 else 135 else
125 CLANG_FORMAT_DIFF = /usr/lib/clang-format/clang-format-diff.py 136 CLANG_FORMAT_DIFF = /usr/lib/clang-format/clang-format-diff.py
126 endif 137 endif
127 format-diff: 138 format-diff:
128 git diff -U0 `git merge-base HEAD master` | \ 139 git diff -U0 `git merge-base HEAD master` | \
129 $(CLANG_FORMAT_DIFF) -p1 -style=LLVM -i 140 $(CLANG_FORMAT_DIFF) -p1 -style=LLVM -i
130 141
131 clean: 142 clean:
132 rm -rf llvm2ice *.o build/ 143 rm -rf llvm2ice *.o build/
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698