Codebase list tigr-glimmer / baaf227 debian / patches / make-errs.patch
baaf227

Tree @baaf227 (Download .tar.gz)

make-errs.patch @baaf227raw · history · blame

Description: reinforce Makefile error checking and increase verbosity
 Initial version of the patch only reinforced Makefile error checking, but some
 simili try/catch statement seem to be interferring with proper error
 detection.
 .
 This version increases the verbosity of the build procedure by removing the @
 commands, excepts for the beautifying `echo` statements.  In addition, error
 checking if further reinforced, and the error handling logic of the "if"
 statement has been modified to trigger an exit with the error status of the
 linking command.
Author: Étienne Mollier <etienne.mollier@mailoo.org>
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=960294
Forwarded: no
Last-Update: 2020-05-13
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- tigr-glimmer.orig/src/c_make.gen
+++ tigr-glimmer/src/c_make.gen
@@ -314,7 +314,8 @@
 #### *.c
 $(C_OBJECTS): %.o: %.c
 	@ echo "@@@@@@@@@@@@@@@@@@@ " $< "@@@@@@@@@@@@@@@@@@@@@";
-	@ if [ -e $(notdir $<) ] ; then \
+	set -e ; \
+	if [ -e $(notdir $<) ] ; then \
 	  $(CC) $(CPPFLAGS) $(CDEFS) $(CFLAGS) -c \
 		$(INC_DIRS) -o $(LOCAL_OBJ)/$*.o $< ; \
 	else \
@@ -325,7 +326,8 @@
 #### *.cc
 $(CXX_OBJECTS_CC): %.o: %.cc
 	@ echo "@@@@@@@@@@@@@@@@@@@ " $< "@@@@@@@@@@@@@@@@@@@@@";
-	@ if [ -e $(notdir $<) ] ; then \
+	set -e ; \
+	if [ -e $(notdir $<) ] ; then \
 	  $(CXX) $(CPPFLAGS) $(CXXDEFS) $(CXXFLAGS) -c \
 		$(INC_DIRS) -o $(LOCAL_OBJ)/$*.o $< ; \
 	else \
@@ -336,7 +338,8 @@
 #### *.C
 $(CXX_OBJECTS_C): %.o: %.C
 	@ echo "@@@@@@@@@@@@@@@@@@@ " $< "@@@@@@@@@@@@@@@@@@@@@";
-	@ if [ -e $(notdir $<) ] ; then \
+	set -e ; \
+	if [ -e $(notdir $<) ] ; then \
 	  $(CXX) $(CPPFLAGS) $(CXXDEFS) $(CXXFLAGS) -c \
 		$(INC_DIRS) -o $(LOCAL_OBJ)/$*.o $< ; \
 	else \
@@ -350,46 +353,56 @@
 
 $(LIBRARIES):
 	@ echo "################### " $@ "#####################";
-	@ cd $(LOCAL_OBJ); \
+	cd $(LOCAL_OBJ) && \
 	  $(AR) $(ARFLAGS) $(LOCAL_LIB)/$(notdir $@) $+ 
 
 $(PROGS):
 	@ echo "++++++++++++++++++++ " $@ "++++++++++++++++++++++";
-	@ if [ -z "$(filter $(CXX_OBJECTS), $(notdir $+))" ] ; then \
+	set -e ; \
+	STATUS=0 ; \
+	if [ -z "$(filter $(CXX_OBJECTS), $(notdir $+))" ] ; then \
 	  cd $(LOCAL_OBJ); \
-	    if $(CC) -o $(LOCAL_BIN)/$(notdir $@) $(LDFLAGS) \
-               $(LD_DIRS) $(filter-out lib%.a, $+) \
-	       $(patsubst lib%.a, -l%, $(filter lib%.a, $+)) ; then \
-			true; else rm -f $(LOCAL_BIN)/$(notdir $@); fi; \
+	    $(CC) -o $(LOCAL_BIN)/$(notdir $@) $(LDFLAGS) \
+	    $(LD_DIRS) $(filter-out lib%.a, $+) \
+	    $(patsubst lib%.a, -l%, $(filter lib%.a, $+)) \
+	    || STATUS=$${?} ; \
+	    if [ $${STATUS} != 0 ] ; then \
+	      rm -f $(LOCAL_BIN)/$(notdir $@); \
+	      exit $${STATUS}; \
+	    fi; \
 	else \
 	  cd $(LOCAL_OBJ); \
-	    if $(CXX) -o $(LOCAL_BIN)/$(notdir $@) $(LDFLAGS) \
-               $(LD_DIRS) $(filter-out lib%.a, $+) \
-	       $(patsubst lib%.a, -l%, $(filter lib%.a, $+)) ; then \
-			true; else rm -f $(LOCAL_BIN)/$(notdir $@); fi; \
+	    $(CXX) -o $(LOCAL_BIN)/$(notdir $@) $(LDFLAGS) \
+	    $(LD_DIRS) $(filter-out lib%.a, $+) \
+	    $(patsubst lib%.a, -l%, $(filter lib%.a, $+)) \
+	    || STATUS=$${?} ; \
+	    if [ $${STATUS} != 0 ] ; then \
+	      rm -f $(LOCAL_BIN)/$(notdir $@); \
+	      exit $${STATUS}; \
+	    fi; \
 	fi ;
 
 #### For making dependencies
 $(C_DEPS): %.d: %.c
-	@ if [ -e $(notdir $<) ] ; then \
+	if [ -e $(notdir $<) ] ; then \
 	  $(SHELL) -ec '$(CC) -M $(CPPFLAGS) $(INC_DIRS) $< \
 	    | sed '\''s/$*\\.o[ :]*/& $@/g'\'' > $@' ; \
         fi ;
 
 $(CXX_DEPS_CC): %.d: %.cc
-	@ if [ -e $(notdir $<) ] ; then \
+	if [ -e $(notdir $<) ] ; then \
 	  $(SHELL) -ec '$(CXX) -M $(CPPFLAGS) $(INC_DIRS) $< \
 	    | sed '\''s/$*\\.o[ :]*/& $@/g'\'' > $@' ; \
         fi ;
 
 $(CXX_DEPS_C): %.d: %.C
-	@ if [ -e $(notdir $<) ] ; then \
+	if [ -e $(notdir $<) ] ; then \
 	  $(SHELL) -ec '$(CXX) -M $(CPPFLAGS) $(INC_DIRS) $< \
 	    | sed '\''s/$*\\.o[ :]*/& $@/g'\'' > $@' ; \
         fi ;
 
 $(CXX_DEPS_CPP): %.d: %.cpp
-	@ if [ -e $(notdir $<) ] ; then \
+	if [ -e $(notdir $<) ] ; then \
 	  $(SHELL) -ec '$(CC) -M $(CPPFLAGS) $(INC_DIRS) $< \
 	    | sed '\''s/$*\\.o[ :]*/& $@/g'\'' > $@' ; \
         fi ;
@@ -415,6 +428,7 @@
 # The following recurses the subdirectories that exist
 define dosubdirs
 echo "* Make Target is " $(TGT);
+set -e ; \
 for i in $(SUBDIRS);\
   do \
     if [ -d $$i ]; then \
--- tigr-glimmer.orig/src/Makefile
+++ tigr-glimmer/src/Makefile
@@ -2,27 +2,27 @@
 
 
 all:
-	@ TGT=objs
-	@ $(dosubdirs)
-	@ TGT=libs
-	@ $(dosubdirs)
-	@ TGT=progs
-	@ $(dosubdirs)
+	TGT=objs
+	$(dosubdirs)
+	TGT=libs
+	$(dosubdirs)
+	TGT=progs
+	$(dosubdirs)
 
 
 install: all
-	@ $(dosubdirs)
+	$(dosubdirs)
 
 clean:
-	@ $(dosubdirs)
+	$(dosubdirs)
 
 
 tester: 
-	@ $(dosubdirs)
+	$(dosubdirs)
 
 
 regression: 
-	@ $(dosubdirs)
+	$(dosubdirs)
 
 LOCAL_WORK = $(shell cd ..; pwd)
 # Include for AS project rules