diff --git a/common.mak b/common.mak index 1d5e1a27..8ed7c531 100644 --- a/common.mak +++ b/common.mak @@ -75,6 +75,7 @@ $(eval $(call cmd_define, CAT," CAT ",cat)) $(eval $(call cmd_define, SED," SED ",sed)) $(eval $(call cmd_define, GZIP," GZIP ",gzip)) $(eval $(call cmd_define, MV," MV ",mv)) +$(eval $(call cmd_define, PERLC," PERLC ",perl -c)) CHECK = sparse CHECK_SILENT := $(CHECK) @@ -113,6 +114,11 @@ ifeq ("${ASAN}","1") DEFAULT_LDFLAGS += -fsanitize=address endif +DEFAULT_PERLCFLAGS = +ifeq ("${W}","1") + DEFAULT_PERLCFLAGS += -w +endif + # # Check for header prerequisite # @@ -260,6 +266,8 @@ ALL_CXXFLAGS = -DS390_TOOLS_RELEASE=$(S390_TOOLS_RELEASE) \ ALL_CPPFLAGS = -I $(rootdir)include $(CPPFLAGS) ALL_LDFLAGS = $(LDFLAGS) +ALL_PERLCFLAGS = $(DEFAULT_PERLCFLAGS) + # make G=1 # Compile tools so that gcov can be used to collect code coverage data. # See the gcov man page for details. diff --git a/scripts/.gitignore b/scripts/.gitignore new file mode 100644 index 00000000..4324fa0e --- /dev/null +++ b/scripts/.gitignore @@ -0,0 +1 @@ +/.zfcpdbf.ct diff --git a/scripts/Makefile b/scripts/Makefile index d7d12f34..deaed573 100644 --- a/scripts/Makefile +++ b/scripts/Makefile @@ -36,4 +36,21 @@ install: clean: +.zfcpdbf.ct: zfcpdbf + $(PERLC) $(ALL_PERLCFLAGS) zfcpdbf 2>$(@); \ + if [ "$${?}" -ne 0 ]; then \ + cat "$(@)" >&2 && rm "$(@)"; \ + elif [ "$$(cat '$(@)' | wc -l)" -gt 1 ]; then \ + cat "$(@)" >&2; \ + elif [ " $(V)" = " 1" ]; then \ + cat "$(@)"; \ + fi + +.PHONY: .zfcpdbf.ct-clean +.zfcpdbf.ct-clean: + rm -f .zfcpdbf.ct + +all: .zfcpdbf.ct +clean: .zfcpdbf.ct-clean + .PHONY: all install clean