Chromium Code Reviews

Unified 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: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
« no previous file with comments | « no previous file | pydir/buildatts.py » ('j') | pydir/buildatts.py » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Makefile.standalone
diff --git a/Makefile.standalone b/Makefile.standalone
index cb0082cee3a5914a7151e50d27f8346a3bd03d80..a74e552c4272322794c8181f291ddd2ad18aebe2 100644
--- a/Makefile.standalone
+++ b/Makefile.standalone
@@ -37,12 +37,25 @@ else
endif
endif
+# The list of attributes associated with the built executable.
+BUILD_ATTS =
+
+ifdef MINIMAL
+ OBJDIR := build/min
Jim Stichnoth 2014/10/15 03:16:36 It looks like this creates subdirs build/Release a
Karl 2014/10/15 20:12:31 Done.
+ BUILD_ATTS := $(BUILD_ATTS) minimal p2i
Jim Stichnoth 2014/10/15 03:16:36 I think the logic of "minimal" is backwards. None
Karl 2014/10/15 20:12:31 A better choice would be to put "minimal" when min
+else
+ OBJDIR = build
+ BUILD_ATTS := $(BUILD_ATTS) p2i l2i lc2i
+endif
+
ifdef DEBUG
- OBJDIR = build/Debug
+ OBJDIR := $(OBJDIR)/Debug
OPTLEVEL = -O0
+ BUILD_ATTS := $(BUILD_ATTS) debug
else
- OBJDIR = build/Release
+ OBJDIR := $(OBJDIR)/Release
OPTLEVEL = -O2
+ BUILD_ATTS := $(BUILD_ATTS) release
endif
ifdef NOASSERT
@@ -50,6 +63,7 @@ ifdef NOASSERT
else
ASSERTIONS =
OBJDIR := $(OBJDIR)+Asserts
+ BUILD_ATTS := $(BUILD_ATTS) asserts
endif
$(info -----------------------------------------------)
@@ -73,6 +87,10 @@ CXXFLAGS := $(LLVM_CXXFLAGS) -std=c++11 -Wall -Wextra -Werror -fno-rtti \
-Wno-error=unused-parameter -I$(LIBCXX_INSTALL_PATH)/include/c++/v1
LDFLAGS := $(HOST_FLAGS) -L$(LIBCXX_INSTALL_PATH)/lib
+ifdef MINIMAL
+ CXXFLAGS :=$(CXXFLAGS) -DSZ_MINIMAL
Jim Stichnoth 2014/10/15 03:16:36 I started thinking that maybe instead of a single
Karl 2014/10/15 20:12:31 Went ahead and added multiple flags for correspond
+endif
+
SRCS= \
assembler.cpp \
assembler_ia32.cpp \
@@ -104,14 +122,16 @@ OBJS=$(patsubst %.cpp, $(OBJDIR)/%.o, $(SRCS))
all: $(OBJDIR)/llvm2ice make_symlink
make_symlink: $(OBJDIR)/llvm2ice
- rm -f llvm2ice
+ rm -f llvm2ice llvm2ice.build_atts
ln -s $(OBJDIR)/llvm2ice
+ ln -s $(OBJDIR)/llvm2ice.build_atts
.PHONY: all make_symlink
$(OBJDIR)/llvm2ice: $(OBJS)
$(CXX) $(LDFLAGS) -o $@ $^ $(LLVM_LDFLAGS) -ldl \
-Wl,-rpath=$(abspath $(LIBCXX_INSTALL_PATH)/lib)
+ echo "$(BUILD_ATTS)" > $@.build_atts
# TODO: Be more precise than "*.h" here and elsewhere.
$(OBJS): $(OBJDIR)/%.o: src/%.cpp src/*.h src/*.def
@@ -149,4 +169,4 @@ format-diff:
$(CLANG_FORMAT_DIFF) -p1 -style=LLVM -i
clean:
- rm -rf llvm2ice *.o build/
+ rm -rf llvm2ice llvm2ice.build_atts *.o $(OBJDIR)
Jim Stichnoth 2014/10/15 03:16:36 Shouldn't "make clean" remove the entire build/ di
Karl 2014/10/15 20:12:31 Added "clean-all" to clean all.
« no previous file with comments | « no previous file | pydir/buildatts.py » ('j') | pydir/buildatts.py » ('J')

Powered by Google App Engine