Sim build doesn't stop on error #421

When I added the "tee" commands to split off command outputs to
a file and the screen, I forgot that the exit status of the make commands
takes the exit status of "tee" which does not ususally have an error and
masks any error in the actual compilation.  I added an exit ${PIPESTATUS[0]}
which returns the exit status of the compilation.
This commit is contained in:
Alex Lin
2017-05-15 13:36:06 -05:00
parent 4d1c3eae4f
commit a11e51cce7
3 changed files with 16 additions and 16 deletions

View File

@ -386,7 +386,7 @@ void PrintAttributes::printIOMakefile() {
<< "$(IO_OBJECTS): \%.o : \%.cpp \%.d" << std::endl
<< "\t$(PRINT_COMPILE)" << std::endl
<< "\t@echo $(TRICK_CPPC) $(TRICK_CXXFLAGS) $(TRICK_SYSTEM_CXXFLAGS) -MMD -MP -c -o $@ $< >> $(MAKE_OUT)" << std::endl
<< "\t$(ECHO_CMD)$(TRICK_CPPC) $(TRICK_CXXFLAGS) $(TRICK_SYSTEM_CXXFLAGS) -MMD -MP -c -o $@ $< 2>&1 | $(TEE) -a $(MAKE_OUT)" << std::endl
<< "\t$(ECHO_CMD)$(TRICK_CPPC) $(TRICK_CXXFLAGS) $(TRICK_SYSTEM_CXXFLAGS) -MMD -MP -c -o $@ $< 2>&1 | $(TEE) -a $(MAKE_OUT) ; exit $${PIPESTATUS[0]}" << std::endl
<< std::endl
<< "$(IO_OBJECTS:.o=.d): ;" << std::endl
<< std::endl