Commit 70e3f1cd by John Porto

Suzero. Refactors dependencies in Makefile.standalone.

Uses the compiler's frontend -MD -MP options to auto-generate make dependencies. BUG= R=stichnot@chromium.org Review URL: https://codereview.chromium.org/1801273003 .
parent 3b4dc93e
...@@ -247,7 +247,7 @@ endif ...@@ -247,7 +247,7 @@ endif
BASE_CXXFLAGS := -std=gnu++11 -Wall -Wextra -Werror -fno-rtti \ BASE_CXXFLAGS := -std=gnu++11 -Wall -Wextra -Werror -fno-rtti \
-fno-exceptions $(OPTLEVEL) $(ASSERTIONS) -g -pedantic \ -fno-exceptions $(OPTLEVEL) $(ASSERTIONS) -g -pedantic \
$(LLVM_EXTRA_WARNINGS) $(CXX_EXTRA) $(LLVM_EXTRA_WARNINGS) $(CXX_EXTRA) -MP -MD
CXXFLAGS := $(LLVM_CXXFLAGS) $(BASE_CXXFLAGS) $(CXX_DEFINES) $(HOST_FLAGS) \ CXXFLAGS := $(LLVM_CXXFLAGS) $(BASE_CXXFLAGS) $(CXX_DEFINES) $(HOST_FLAGS) \
$(STDLIB_FLAGS) $(STDLIB_FLAGS)
...@@ -409,14 +409,16 @@ $(SBB_OBJDIR)/pnacl_public_x86_64_pnacl_sz_nexe: $(SBB_OBJDIR)/pnacl-sz.pexe ...@@ -409,14 +409,16 @@ $(SBB_OBJDIR)/pnacl_public_x86_64_pnacl_sz_nexe: $(SBB_OBJDIR)/pnacl-sz.pexe
src/IceRegistersARM32.def: pydir/gen_arm32_reg_tables.py src/IceRegistersARM32.def: pydir/gen_arm32_reg_tables.py
python $< > $@ python $< > $@
# TODO(stichnot): Be more precise than "*.h" here and elsewhere. -include $(foreach dep,$(SRCS:.cpp=.d),$(OBJDIR)/$(dep))
$(OBJS): $(OBJDIR)/%.o: src/%.cpp src/*.h src/*.def $(OBJS): $(OBJDIR)/%.o: src/%.cpp
$(CXX) -c $(CXXFLAGS) $< -o $@ $(CXX) -c $(CXXFLAGS) $< -o $@
$(SB_OBJS): $(SB_OBJDIR)/%.o: src/%.cpp src/*.h src/*.def -include $(foreach dep,$(SRCS:.cpp=.d),$(SB_OBJDIR)/$(dep))
$(SB_OBJS): $(SB_OBJDIR)/%.o: src/%.cpp
$(SB_CXX) -c $(SB_CXXFLAGS) -DPNACL_BROWSER_TRANSLATOR=0 $< -o $@ $(SB_CXX) -c $(SB_CXXFLAGS) -DPNACL_BROWSER_TRANSLATOR=0 $< -o $@
$(SBB_OBJS): $(SBB_OBJDIR)/%.o: src/%.cpp src/*.h src/*.def -include $(foreach dep,$(SRCS:.cpp=.d),$(SBB_OBJDIR)/$(dep))
$(SBB_OBJS): $(SBB_OBJDIR)/%.o: src/%.cpp
$(SB_CXX) -c $(SB_CXXFLAGS) -DPNACL_BROWSER_TRANSLATOR=1 $< -o $@ $(SB_CXX) -c $(SB_CXXFLAGS) -DPNACL_BROWSER_TRANSLATOR=1 $< -o $@
$(OBJDIR)/run_unittests: $(UNITTEST_OBJS) $(UNITTEST_LIB_OBJS) $(OBJDIR)/run_unittests: $(UNITTEST_OBJS) $(UNITTEST_LIB_OBJS)
...@@ -424,8 +426,8 @@ $(OBJDIR)/run_unittests: $(UNITTEST_OBJS) $(UNITTEST_LIB_OBJS) ...@@ -424,8 +426,8 @@ $(OBJDIR)/run_unittests: $(UNITTEST_OBJS) $(UNITTEST_LIB_OBJS)
-lgtest -lgtest_main -ldl \ -lgtest -lgtest_main -ldl \
-Wl,-rpath=$(abspath $(LIBCXX_INSTALL_PATH)/lib) -Wl,-rpath=$(abspath $(LIBCXX_INSTALL_PATH)/lib)
$(UNITTEST_OBJS): $(OBJDIR)/unittest/%.o: unittest/%.cpp unittest/*.h \ -include $(foreach dep,$(UNITTEST_SRCS:.cpp=.d),$(OBJDIR)/unittest/$(dep))
src/*.h src/*.def $(UNITTEST_OBJS): $(OBJDIR)/unittest/%.o: unittest/%.cpp
$(CXX) -c $(CXXFLAGS) \ $(CXX) -c $(CXXFLAGS) \
-Isrc/ \ -Isrc/ \
-Iunittest/ \ -Iunittest/ \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment