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

Unified Diff: Makefile.standalone

Issue 678533005: Subzero: Add basic ELFObjectWriter (text section, symtab, strtab, headers) (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: minor cleanup Created 6 years 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 | src/IceCfg.cpp » ('j') | 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 d6a2dafaa796c9fe0d22d4c0062c47dbd0b08f8c..787e13873f402fd8e52bbbd44639d430569f60f2 100644
--- a/Makefile.standalone
+++ b/Makefile.standalone
@@ -92,13 +92,14 @@ SRCS = \
assembler_ia32.cpp \
IceCfg.cpp \
IceCfgNode.cpp \
+ IceELFObjectWriter.cpp \
+ IceELFSection.cpp \
IceGlobalContext.cpp \
IceGlobalInits.cpp \
IceInst.cpp \
IceInstX8632.cpp \
IceIntrinsics.cpp \
IceLiveness.cpp \
- IceMemoryRegion.cpp \
IceOperand.cpp \
IceRegAlloc.cpp \
IceRNG.cpp \
@@ -117,6 +118,12 @@ endif
OBJS=$(patsubst %.cpp, $(OBJDIR)/%.o, $(SRCS))
+UNITTEST_SRCS = \
+ IceELFSectionTest.cpp
+
+UNITTEST_OBJS = $(patsubst %.cpp, $(OBJDIR)/unittest/%.o, $(UNITTEST_SRCS))
+UNITTEST_LIB_OBJS = $(filter-out $(OBJDIR)/llvm2ice.o,$(OBJS))
+
# Keep all the first target so it's the default.
all: $(OBJDIR)/llvm2ice make_symlink
@@ -141,20 +148,39 @@ $(OBJDIR)/llvm2ice: $(OBJS)
$(OBJS): $(OBJDIR)/%.o: src/%.cpp src/*.h src/*.def
$(CXX) -c $(CXXFLAGS) $< -o $@
+$(OBJDIR)/run_unittests: $(UNITTEST_OBJS) $(UNITTEST_LIB_OBJS)
+ $(CXX) $(LDFLAGS) -o $@ $^ $(LLVM_LDFLAGS) -lgtest -lgtest_main -ldl \
+ -Wl,-rpath=$(abspath $(LIBCXX_INSTALL_PATH)/lib)
+
+$(UNITTEST_OBJS): $(OBJDIR)/unittest/%.o: unittest/%.cpp
+ $(CXX) -c $(CXXFLAGS) \
+ -Isrc/ \
+ -I$(LLVM_SRC_PATH)/utils/unittest/googletest/include \
+ -DGTEST_HAS_RTTI=0 -DGTEST_USE_OWN_TR1_TUPLE \
+ $< -o $@
+
$(OBJS): | $(OBJDIR)
+$(UNITTEST_OBJS): | $(OBJDIR)/unittest
+
$(OBJDIR):
@mkdir -p $@
+$(OBJDIR)/unittest: $(OBJDIR)
+ @mkdir -p $@
+
check-lit: llvm2ice make_symlink
LLVM_BIN_PATH=$(LLVM_BIN_PATH) \
$(LLVM_SRC_PATH)/utils/lit/lit.py -sv tests_lit
+check-unit: $(OBJDIR)/run_unittests
+ $(OBJDIR)/run_unittests
+
ifdef MINIMAL
-check: check-lit
+check: check-lit check-unit
@echo "Crosstests ignored, minimal build"
else
-check: check-lit
+check: check-lit check-unit
(cd crosstest; ./runtests.sh)
endif
« no previous file with comments | « no previous file | src/IceCfg.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698