From 1bb3ac2a0640ef2a26e019a575c73fa0d59e15e8 Mon Sep 17 00:00:00 2001 From: Christopher LaChance Date: Wed, 6 Dec 2017 13:12:13 -0600 Subject: [PATCH] Cleaned up 'make clean' output significantly. --- Makefile | 42 +++++++++++++------ share/trick/makefiles/Makefile.tricklib | 20 +++++++-- .../codegen/Interface_Code_Gen/makefile | 2 + .../Apps/ExternalPrograms/makefile | 2 + .../data_products/Apps/Trk2csv/makefile | 2 + .../data_products/DPX/APPS/FXPLOT/makefile | 2 + .../data_products/DPX/APPS/GXPLOT/makefile | 2 + trick_source/data_products/DPX/APPS/makefile | 12 +++--- trick_source/data_products/DPX/DPC/makefile | 8 ++++ trick_source/data_products/DPX/DPM/makefile | 2 + .../data_products/DPX/DPV/UTILS/makefile | 9 ++++ .../DPX/TESTING/DPC_TEST/makefile | 3 +- .../DPX/TESTING/DPM_TEST/makefile | 2 + .../data_products/DPX/TESTING/DS/makefile | 2 + .../DPX/TESTING/DS_exercisor/makefile | 2 + .../data_products/DPX/TESTING/TCDS/makefile | 3 +- .../data_products/DPX/TESTING/UDS/makefile | 3 +- .../data_products/DPX/TESTING/makefile | 12 +++--- trick_source/data_products/DPX/makefile | 11 +++-- trick_source/data_products/EQParse/makefile | 11 ++++- trick_source/data_products/Log/makefile | 11 ++++- trick_source/data_products/Var/makefile | 9 ++++ trick_source/data_products/makefile | 13 +++--- trick_source/data_products/units/makefile | 11 ++++- trick_source/java/makefile | 2 + trick_source/trick_swig/Makefile | 15 +++++-- 26 files changed, 166 insertions(+), 47 deletions(-) diff --git a/Makefile b/Makefile index ba43b81c..0cfc582f 100644 --- a/Makefile +++ b/Makefile @@ -134,6 +134,14 @@ endif # libraries. ICG_EXE := ${TRICK_HOME}/bin/trick-ICG +################################################################################ +# Formating Variables +################################################################################ + +# Appends a newline to the -w / --print-directories leaving message for make. +# This helps break up directory traversal into blocks. +MAKE_TRAVERSAL_NEWLINE := | sed '/^make.*: Leaving directory/a\ ' + ################################################################################ # RULES ################################################################################ @@ -269,43 +277,54 @@ sim_test: # CLEAN Targets ################################################################################ - clean: clean_sim_serv clean_utils clean_swig clean_dp clean_ICG clean_java @/bin/rm -rf $(TRICK_BIN_DIR) @/bin/rm -rf $(TRICK_LIB_DIR) + @echo -e "\e[31m# #" + @echo -e "\e[33m## ##" + @echo -e "\e[32m### ###" + @echo -e "\e[34m#### ####" + @echo -e "\e[35m##### #####" + @echo -e "\e[39m-----Trick has been successfully cleaned.-----" + @echo -e "\e[35m##### #####" + @echo -e "\e[34m#### ####" + @echo -e "\e[32m### ###" + @echo -e "\e[33m## ##" + @echo -e "\e[31m# #\n" + ifeq ($(USE_ER7_UTILS), 1) clean: clean_er7_utils endif clean_sim_serv: @for i in $(SIM_SERV_DIRS) ; do \ - $(MAKE) -C $$i real_clean ; \ + $(MAKE) -C $$i real_clean $(MAKE_TRAVERSAL_NEWLINE); \ done - @ $(MAKE) -C ${TRICK_HOME}/trick_source/sim_services/mains real_clean + @ $(MAKE) -C ${TRICK_HOME}/trick_source/sim_services/mains real_clean $(MAKE_TRAVERSAL_NEWLINE) clean_er7_utils: make_er7_makefiles @for i in $(ER7_UTILS_DIRS) ; do \ - $(MAKE) -C $$i real_clean ; \ + $(MAKE) -C $$i real_clean $ $(MAKE_TRAVERSAL_NEWLINE); \ rm $$i/Makefile; \ done clean_utils: @for i in $(UTILS_DIRS) ; do \ - $(MAKE) -C $$i real_clean ; \ + $(MAKE) -C $$i real_clean $(MAKE_TRAVERSAL_NEWLINE); \ done clean_swig: @for i in $(SWIG_DIRS) ; do \ - $(MAKE) -C $$i real_clean ; \ + $(MAKE) -C $$i real_clean $(MAKE_TRAVERSAL_NEWLINE); \ done ifeq ($(USE_ER7_UTILS), 1) -clean_swig: make_er7_makefiles +clean_swig: make_er7_makefiles endif clean_ICG : - $(MAKE) -C ${TRICK_HOME}/trick_source/codegen/Interface_Code_Gen clean + @ $(MAKE) -C ${TRICK_HOME}/trick_source/codegen/Interface_Code_Gen clean $(MAKE_TRAVERSAL_NEWLINE) clean_unit_test: @/bin/rm -rf ${TRICK_HOME}/trick_test/*.xml @@ -314,14 +333,13 @@ clean_unit_test: done clean_doxygen: - @ $(MAKE) -C ${TRICK_HOME}/doxygen clean - + @ $(MAKE) -C ${TRICK_HOME}/doxygen clean $(MAKE_TRAVERSAL_NEWLINE) clean_dp: - @ $(MAKE) clean -C ${TRICK_HOME}/trick_source/data_products + @ $(MAKE) clean -C ${TRICK_HOME}/trick_source/data_products $(MAKE_TRAVERSAL_NEWLINE) clean_java: - @ $(MAKE) -C ${TRICK_HOME}/trick_source/java clean + @ $(MAKE) -C ${TRICK_HOME}/trick_source/java clean $(MAKE_TRAVERSAL_NEWLINE) # FIXME: Seems to me that the for loop below should be removed and that the diff --git a/share/trick/makefiles/Makefile.tricklib b/share/trick/makefiles/Makefile.tricklib index f9162d69..603ed2ba 100644 --- a/share/trick/makefiles/Makefile.tricklib +++ b/share/trick/makefiles/Makefile.tricklib @@ -161,6 +161,12 @@ $(Y_OBJS) : $(OBJ_DIR)/%.tab.o : $(SRC_DIR)%.tab.c | $(OBJ_DIR) $(CD_CMD) $(TRICK_CPPC) $(TRICK_CXXFLAGS) $(TRICK_SYSTEM_CXXFLAGS) -c ${