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

Unified 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: Don't make llvm2ice_dbg by default Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Makefile.standalone
diff --git a/Makefile.standalone b/Makefile.standalone
index b6d0d179d196693e31da4af13c617421c05180bb..2caf82dddcf1f61d8c805c98b78bb0c635e19a5f 100644
--- a/Makefile.standalone
+++ b/Makefile.standalone
@@ -50,12 +50,11 @@ LLVM_LDFLAGS := `$(LLVM_BIN_PATH)/llvm-config --libs` \
`$(LLVM_BIN_PATH)/llvm-config --ldflags`
# It's recommended that CXX matches the compiler you used to build LLVM itself.
-OPTLEVEL := -O0
CCACHE := `command -v ccache`
CXX := CCACHE_CPP2=yes $(CCACHE) $(CLANG_PATH)/clang++
CXXFLAGS := $(LLVM_CXXFLAGS) -std=c++11 -Wall -Wextra -Werror -fno-rtti \
- -fno-exceptions $(OPTLEVEL) -g $(HOST_FLAGS) \
+ -fno-exceptions -g $(HOST_FLAGS) \
-Wno-error=unused-parameter -I$(LIBCXX_INSTALL_PATH)/include/c++/v1
LDFLAGS := $(HOST_FLAGS) -L$(LIBCXX_INSTALL_PATH)/lib
@@ -82,24 +81,32 @@ SRCS= \
llvm2ice.cpp \
PNaClTranslator.cpp
-OBJS=$(patsubst %.cpp, build/%.o, $(SRCS))
+OBJS_DBG=$(patsubst %.cpp, build/Debug/%.o, $(SRCS))
+OBJS_REL=$(patsubst %.cpp, build/Release/%.o, $(SRCS))
# Keep all the first target so it's the default.
+# Note: llvm2ice_dbg is not built by default; "make llvm2ice_dbg" if needed.
all: llvm2ice
.PHONY: all
-llvm2ice: $(OBJS)
+llvm2ice: $(OBJS_REL)
+ $(CXX) $(LDFLAGS) -o $@ $^ $(LLVM_LDFLAGS) -ldl \
+ -Wl,-rpath=$(abspath $(LIBCXX_INSTALL_PATH)/lib)
+llvm2ice_dbg: $(OBJS_DBG)
$(CXX) $(LDFLAGS) -o $@ $^ $(LLVM_LDFLAGS) -ldl \
-Wl,-rpath=$(abspath $(LIBCXX_INSTALL_PATH)/lib)
# TODO: Be more precise than "*.h" here and elsewhere.
-$(OBJS): build/%.o: src/%.cpp src/*.h src/*.def
- $(CXX) -c $(CXXFLAGS) $< -o $@
+$(OBJS_DBG): build/Debug/%.o: src/%.cpp src/*.h src/*.def
+ $(CXX) -c -O0 $(CXXFLAGS) $< -o $@
+$(OBJS_REL): build/Release/%.o: src/%.cpp src/*.h src/*.def
+ $(CXX) -c -O2 $(CXXFLAGS) $< -o $@
-$(OBJS): | build
+$(OBJS_DBG): | build/Debug
+$(OBJS_REL): | build/Release
-build:
+build/Debug build/Release:
@mkdir -p $@
check-lit: llvm2ice
@@ -129,4 +136,4 @@ format-diff:
$(CLANG_FORMAT_DIFF) -p1 -style=LLVM -i
clean:
- rm -rf llvm2ice *.o build/
+ rm -rf llvm2ice llvm2ice_dbg *.o build/
« 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