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

Side by Side Diff: Makefile.standalone

Issue 659513005: Allow conditional lit tests in Subzero, based on build flags. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Fix issues in patch set 3. 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 | pydir/ifatts.py » ('j') | pydir/ifatts.py » ('J')
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 # The list of CXX defines that are dependent on build parameters.
41 CXX_DEFINES =
42
43 # The list of attributes associated with the built executable.
44 BUILD_ATTS = x86-32
45
40 ifdef DEBUG 46 ifdef DEBUG
41 OBJDIR = build/Debug 47 OBJDIR = build/Debug
42 OPTLEVEL = -O0 48 OPTLEVEL = -O0
49 BUILD_ATTS := $(BUILD_ATTS) debug
Jim Stichnoth 2014/10/20 16:44:28 I don't know if this is possible, but I wonder if
Karl 2014/10/20 21:00:42 Done.
43 else 50 else
44 OBJDIR = build/Release 51 OBJDIR = build/Release
45 OPTLEVEL = -O2 52 OPTLEVEL = -O2
53 BUILD_ATTS := $(BUILD_ATTS) release
54 endif
55
56 ifdef MINIMAL
57 CXX_DEFINES := $(CXX_DEFINES) -DNO_TEXT_ASM -DNO_DUMP -DNO_LLVM_CL
58 OBJDIR := $(OBJDIR)+Min
59 BUILD_ATTS := $(BUILD_ATTS) minimal
60 else
61 BUILD_ATTS := $(BUILD_ATTS) nonminimal
46 endif 62 endif
47 63
48 ifdef NOASSERT 64 ifdef NOASSERT
49 ASSERTIONS = -DNDEBUG 65 ASSERTIONS = -DNDEBUG
Jim Stichnoth 2014/10/20 16:44:28 Add noasserts to BUILD_ATTS, for flexibility and c
Karl 2014/10/20 21:00:42 Done.
50 else 66 else
51 ASSERTIONS = 67 ASSERTIONS =
52 OBJDIR := $(OBJDIR)+Asserts 68 OBJDIR := $(OBJDIR)+Asserts
69 BUILD_ATTS := $(BUILD_ATTS) asserts
53 endif 70 endif
54 71
55 $(info -----------------------------------------------) 72 $(info -----------------------------------------------)
56 $(info Using LLVM_SRC_PATH = $(LLVM_SRC_PATH)) 73 $(info Using LLVM_SRC_PATH = $(LLVM_SRC_PATH))
57 $(info Using LLVM_BIN_PATH = $(LLVM_BIN_PATH)) 74 $(info Using LLVM_BIN_PATH = $(LLVM_BIN_PATH))
58 $(info Using LIBCXX_INSTALL_PATH = $(LIBCXX_INSTALL_PATH)) 75 $(info Using LIBCXX_INSTALL_PATH = $(LIBCXX_INSTALL_PATH))
59 $(info Using CLANG_PATH = $(CLANG_PATH)) 76 $(info Using CLANG_PATH = $(CLANG_PATH))
60 $(info Using HOST_ARCH = $(HOST_ARCH)) 77 $(info Using HOST_ARCH = $(HOST_ARCH))
61 $(info -----------------------------------------------) 78 $(info -----------------------------------------------)
62 79
63 LLVM_CXXFLAGS := `$(LLVM_BIN_PATH)/llvm-config --cxxflags` 80 LLVM_CXXFLAGS := `$(LLVM_BIN_PATH)/llvm-config --cxxflags`
64 LLVM_LDFLAGS := `$(LLVM_BIN_PATH)/llvm-config --libs` \ 81 LLVM_LDFLAGS := `$(LLVM_BIN_PATH)/llvm-config --libs` \
65 `$(LLVM_BIN_PATH)/llvm-config --ldflags` 82 `$(LLVM_BIN_PATH)/llvm-config --ldflags`
66 83
67 # It's recommended that CXX matches the compiler you used to build LLVM itself. 84 # It's recommended that CXX matches the compiler you used to build LLVM itself.
68 CCACHE := `command -v ccache` 85 CCACHE := `command -v ccache`
69 CXX := CCACHE_CPP2=yes $(CCACHE) $(CLANG_PATH)/clang++ 86 CXX := CCACHE_CPP2=yes $(CCACHE) $(CLANG_PATH)/clang++
70 87
71 CXXFLAGS := $(LLVM_CXXFLAGS) -std=c++11 -Wall -Wextra -Werror -fno-rtti \ 88 CXXFLAGS := $(LLVM_CXXFLAGS) -std=c++11 -Wall -Wextra -Werror -fno-rtti \
72 » -fno-exceptions $(OPTLEVEL) $(ASSERTIONS) -g $(HOST_FLAGS) \ 89 » -fno-exceptions $(OPTLEVEL) $(ASSERTIONS) $(CXX_DEFINES) -g \
73 » -Wno-error=unused-parameter -I$(LIBCXX_INSTALL_PATH)/include/c++/v1 90 » $(HOST_FLAGS) -Wno-error=unused-parameter \
91 » -I$(LIBCXX_INSTALL_PATH)/include/c++/v1
74 LDFLAGS := $(HOST_FLAGS) -L$(LIBCXX_INSTALL_PATH)/lib 92 LDFLAGS := $(HOST_FLAGS) -L$(LIBCXX_INSTALL_PATH)/lib
75 93
76 SRCS= \ 94 SRCS= \
77 assembler.cpp \ 95 assembler.cpp \
78 assembler_ia32.cpp \ 96 assembler_ia32.cpp \
79 IceCfg.cpp \ 97 IceCfg.cpp \
80 IceCfgNode.cpp \ 98 IceCfgNode.cpp \
81 IceConverter.cpp \ 99 IceConverter.cpp \
82 IceGlobalContext.cpp \ 100 IceGlobalContext.cpp \
83 IceGlobalInits.cpp \ 101 IceGlobalInits.cpp \
(...skipping 12 matching lines...) Expand all
96 IceTypeConverter.cpp \ 114 IceTypeConverter.cpp \
97 IceTypes.cpp \ 115 IceTypes.cpp \
98 llvm2ice.cpp \ 116 llvm2ice.cpp \
99 PNaClTranslator.cpp 117 PNaClTranslator.cpp
100 118
101 OBJS=$(patsubst %.cpp, $(OBJDIR)/%.o, $(SRCS)) 119 OBJS=$(patsubst %.cpp, $(OBJDIR)/%.o, $(SRCS))
102 120
103 # Keep all the first target so it's the default. 121 # Keep all the first target so it's the default.
104 all: $(OBJDIR)/llvm2ice make_symlink 122 all: $(OBJDIR)/llvm2ice make_symlink
105 123
106 make_symlink: $(OBJDIR)/llvm2ice 124 make_symlink: $(OBJDIR)/llvm2ice $(OBJDIR)/llvm2ice.build_atts
107 » rm -f llvm2ice 125 » rm -f llvm2ice llvm2ice.build_atts
Jim Stichnoth 2014/10/20 16:44:28 Can you change to rm -rf in case a directory of th
Karl 2014/10/20 21:00:42 Done.
108 ln -s $(OBJDIR)/llvm2ice 126 ln -s $(OBJDIR)/llvm2ice
127 ln -s $(OBJDIR)/llvm2ice.build_atts
109 128
110 .PHONY: all make_symlink 129 .PHONY: all make_symlink
111 130
112 $(OBJDIR)/llvm2ice: $(OBJS) 131 $(OBJDIR)/llvm2ice: $(OBJS)
113 $(CXX) $(LDFLAGS) -o $@ $^ $(LLVM_LDFLAGS) -ldl \ 132 $(CXX) $(LDFLAGS) -o $@ $^ $(LLVM_LDFLAGS) -ldl \
114 -Wl,-rpath=$(abspath $(LIBCXX_INSTALL_PATH)/lib) 133 -Wl,-rpath=$(abspath $(LIBCXX_INSTALL_PATH)/lib)
134 echo "$(BUILD_ATTS)" > $@.build_atts
115 135
116 # TODO: Be more precise than "*.h" here and elsewhere. 136 # TODO: Be more precise than "*.h" here and elsewhere.
117 $(OBJS): $(OBJDIR)/%.o: src/%.cpp src/*.h src/*.def 137 $(OBJS): $(OBJDIR)/%.o: src/%.cpp src/*.h src/*.def
118 $(CXX) -c $(CXXFLAGS) $< -o $@ 138 $(CXX) -c $(CXXFLAGS) $< -o $@
119 139
120 $(OBJS): | $(OBJDIR) 140 $(OBJS): | $(OBJDIR)
121 141
122 $(OBJDIR): 142 $(OBJDIR):
123 @mkdir -p $@ 143 @mkdir -p $@
124 144
(...skipping 17 matching lines...) Expand all
142 ifeq (,$(wildcard /usr/lib/clang-format/clang-format-diff.py)) 162 ifeq (,$(wildcard /usr/lib/clang-format/clang-format-diff.py))
143 CLANG_FORMAT_DIFF = clang-format-diff.py 163 CLANG_FORMAT_DIFF = clang-format-diff.py
144 else 164 else
145 CLANG_FORMAT_DIFF = /usr/lib/clang-format/clang-format-diff.py 165 CLANG_FORMAT_DIFF = /usr/lib/clang-format/clang-format-diff.py
146 endif 166 endif
147 format-diff: 167 format-diff:
148 git diff -U0 `git merge-base HEAD master` | \ 168 git diff -U0 `git merge-base HEAD master` | \
149 $(CLANG_FORMAT_DIFF) -p1 -style=LLVM -i 169 $(CLANG_FORMAT_DIFF) -p1 -style=LLVM -i
150 170
151 clean: 171 clean:
152 » rm -rf llvm2ice *.o build/ 172 » rm -rf llvm2ice llvm2ice.build_atts *.o $(OBJDIR)
173
174 clean-all: clean
175 » rm -rf build/
OLDNEW
« no previous file with comments | « no previous file | pydir/ifatts.py » ('j') | pydir/ifatts.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698