Files
s390-tools/scripts/Makefile
Benjamin Block 4941fc15c0 zfcpdbf: test-compile the script during the build using perl -c
For a slightly easier development loop add a pseudo compilation of the
zfcpdbf Perl script. This will run the Perl interpreter in syntax-check
mode:

  -c   causes Perl to check the syntax of the program and then exit
       without executing it.  Actually, it will execute any "BEGIN",
       "UNITCHECK", or "CHECK" blocks and any "use" statements: these are
       considered as occurring outside the execution of your program.
       "INIT" and "END" blocks, however, will be skipped.

Additionally add the `-w` switch when the Make variable `W` is `1`. This
will print additional warnings about dubious constructs (according to
Perl).

So this pseudo compilation only happens whenever the script is changed
during development create a file `.zfcpdbf.ct` as a result so we can
describe the relationship and dependency in Make. This file can be ignored
otherwise.

Signed-off-by: Benjamin Block <bblock@linux.ibm.com>
Reviewed-by: Steffen Maier <maier@linux.ibm.com>
Reviewed-by: Jan Höppner <hoeppner@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2023-03-17 10:56:11 +01:00

57 lines
1.4 KiB
Makefile

include ../common.mak
SCRIPTS = dbginfo.sh zfcpdbf zipl-switch-to-blscfg scsi_logging_level
SCRIPTS += sclpdbf
# Helper scripts controlled by corresponding systemd services
SD_HELPER_SCRIPTS = cpictl dumpconf
MAN_PAGES = dbginfo.sh.8 zfcpdbf.8 zipl-switch-to-blscfg.8
all:
install:
$(INSTALL) -d -m 755 $(DESTDIR)$(BINDIR) $(DESTDIR)$(MANDIR)/man8
@for i in $(SCRIPTS); \
do \
cat $$i | \
sed -e 's/%S390_TOOLS_VERSION%/$(S390_TOOLS_RELEASE)/' \
>$(DESTDIR)$(BINDIR)/$$i; \
chown $(OWNER):$(GROUP) $(DESTDIR)$(BINDIR)/$$i; \
chmod 755 $(DESTDIR)$(BINDIR)/$$i; \
done
@for i in $(SD_HELPER_SCRIPTS); \
do \
cat $$i | \
sed -e 's/%S390_TOOLS_VERSION%/$(S390_TOOLS_RELEASE)/' \
>$(DESTDIR)$(TOOLS_LIBDIR)/$$i; \
chown $(OWNER):$(GROUP) $(DESTDIR)$(TOOLS_LIBDIR)/$$i; \
chmod 755 $(DESTDIR)$(TOOLS_LIBDIR)/$$i; \
done
@for i in $(MAN_PAGES); \
do \
$(INSTALL) -g $(GROUP) -o $(OWNER) -m 644 $$i \
$(DESTDIR)$(MANDIR)/man8; \
done
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