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

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: Remove the duplication 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..a9134971a37cedd0350cd279314b69bbe9832b90 100644
--- a/Makefile.standalone
+++ b/Makefile.standalone
@@ -37,6 +37,14 @@ else
endif
endif
+ifdef DEBUG
+ OBJDIR = build/Debug
+ OPTLEVEL = -O0
+else
+ OBJDIR = build/Release
+ OPTLEVEL = -O2
+endif
+
$(info -----------------------------------------------)
$(info Using LLVM_SRC_PATH = $(LLVM_SRC_PATH))
$(info Using LLVM_BIN_PATH = $(LLVM_BIN_PATH))
@@ -50,7 +58,6 @@ 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++
@@ -82,24 +89,28 @@ SRCS= \
llvm2ice.cpp \
PNaClTranslator.cpp
-OBJS=$(patsubst %.cpp, build/%.o, $(SRCS))
+OBJS=$(patsubst %.cpp, $(OBJDIR)/%.o, $(SRCS))
# Keep all the first target so it's the default.
-all: llvm2ice
+all: $(OBJDIR)/llvm2ice make_symlink
+
+make_symlink: $(OBJDIR)/llvm2ice
+ rm -f llvm2ice
+ ln -s $(OBJDIR)/llvm2ice
-.PHONY: all
+.PHONY: all make_symlink
-llvm2ice: $(OBJS)
+$(OBJDIR)/llvm2ice: $(OBJS)
$(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
+$(OBJS): $(OBJDIR)/%.o: src/%.cpp src/*.h src/*.def
$(CXX) -c $(CXXFLAGS) $< -o $@
-$(OBJS): | build
+$(OBJS): | $(OBJDIR)
-build:
+$(OBJDIR):
@mkdir -p $@
check-lit: llvm2ice
« 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