[Crash-utility] [PATCH] Makefile: crash multi-target and multithread compile support

Tao Liu ltao at redhat.com
Mon Feb 21 07:34:24 UTC 2022


This patch will enable making crash as follows:

    $ make -j8 warn lzo zstd

Signed-off-by: Tao Liu <ltao at redhat.com>
---
 Makefile | 50 ++++++++++++++++++++++++++++++--------------------
 1 file changed, 30 insertions(+), 20 deletions(-)

diff --git a/Makefile b/Makefile
index ede87a1..79017a0 100644
--- a/Makefile
+++ b/Makefile
@@ -305,33 +305,43 @@ install:
 unconfig: make_configure
 	@./configure -u
 
-warn: make_configure
-	@./configure ${CONF_TARGET_FLAG} -w -b
+config: make_configure
+	if [ -n "$(findstring warn,$(MAKECMDGOALS))" ]; then \
+	  ./configure ${CONF_TARGET_FLAG} -w -b; fi
+	if [ -n "$(findstring Warn,$(MAKECMDGOALS))" ]; then \
+	  ./configure ${CONF_TARGET_FLAG} -W -b; fi
+	if [ -n "$(findstring nowarn,$(MAKECMDGOALS))" ]; then \
+	  ./configure ${CONF_TARGET_FLAG} -n -b; fi
+	if [ -n "$(findstring lzo,$(MAKECMDGOALS))" ]; then \
+	  ./configure -x lzo ${CONF_TARGET_FLAG} -w -b; fi
+	if [ -n "$(findstring snappy,$(MAKECMDGOALS))" ]; then \
+	  ./configure -x snappy ${CONF_TARGET_FLAG} -w -b; fi
+	if [ -n "$(findstring zstd,$(MAKECMDGOALS))" ]; then \
+	  ./configure -x zstd ${CONF_TARGET_FLAG} -w -b; fi
+	if [ -n "$(findstring valgrind,$(MAKECMDGOALS))" ]; then \
+	  ./configure -x valgrind ${CONF_TARGET_FLAG} -w -b; fi
 	@$(MAKE) gdb_merge
 
-Warn: make_configure
-	@./configure ${CONF_TARGET_FLAG} -W -b
-	@$(MAKE) gdb_merge
+warn: config
+	
 
-nowarn: make_configure
-	@./configure ${CONF_TARGET_FLAG} -n -b
-	@$(MAKE) gdb_merge
+Warn: config
+	
 
-lzo: make_configure
-	@./configure -x lzo ${CONF_TARGET_FLAG} -w -b
-	@$(MAKE) gdb_merge
+nowarn: config
+	
 
-snappy: make_configure
-	@./configure -x snappy ${CONF_TARGET_FLAG} -w -b
-	@$(MAKE) gdb_merge
+lzo: config
+	
 
-zstd: make_configure
-	@./configure -x zstd ${CONF_TARGET_FLAG} -w -b
-	@$(MAKE) gdb_merge
+snappy: config
+	
 
-valgrind: make_configure
-	@./configure -x valgrind ${CONF_TARGET_FLAG} -w -b
-	@$(MAKE) gdb_merge
+zstd: config
+	
+
+valgrind: config
+	
 
 main.o: ${GENERIC_HFILES} main.c
 	${CC} -c ${CRASH_CFLAGS} main.c ${WARNING_OPTIONS} ${WARNING_ERROR} 
-- 
2.33.1




More information about the Crash-utility mailing list