From f06a86e4aa9b2fb96c25b601a90f88e165c92613 Mon Sep 17 00:00:00 2001 From: Gleb Chesnokov Date: Mon, 27 Jun 2022 13:36:59 +0300 Subject: [PATCH] scstadmin/scstadmin.sysfs/Makefile: Add makefile target Most targets of this Makefile require a underlying Makefile to be created before they are called. Otherwise you will get an error like this: make -C scst-1.0.0 clean make[3]: Entering directory '/.../scst/scstadmin/scstadmin.sysfs/scst-1.0.0' make[3]: *** No rule to make target 'clean'. Stop. Hence add a target that creates a underlying Makefile and add it as a dependency for all required targets. --- scstadmin/scstadmin.sysfs/Makefile | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/scstadmin/scstadmin.sysfs/Makefile b/scstadmin/scstadmin.sysfs/Makefile index f23e18955..c749bb425 100644 --- a/scstadmin/scstadmin.sysfs/Makefile +++ b/scstadmin/scstadmin.sysfs/Makefile @@ -15,21 +15,24 @@ install install_vendor: all install -m 755 $(TOOL) $(DESTDIR)$(SBINDIR) regex="s|%INSTALLSITELIB%|$$(make -sC scst-$(MODULE_VERSION) print-INSTALLSITELIB | grep -v ^make)|"; echo "$${regex}"; sed -i "$${regex}" $(DESTDIR)$(SBINDIR)/$(TOOL) -uninstall: +makefile: + @cd ./scst-$(MODULE_VERSION) && \ + perl Makefile.PL PREFIX=$(PREFIX) + +uninstall: makefile -rm -f $(DESTDIR)$(SBINDIR)/$(TOOL) $(MAKE) -C scst-$(MODULE_VERSION) uninstall -perl-module: +perl-module: makefile @cd ./scst-$(MODULE_VERSION) && \ - perl Makefile.PL PREFIX=$(PREFIX) && \ printf '\nprint-%%:\n\t@echo '"'"'$$($$*)'"'"'\n' >> Makefile $(MAKE) -C scst-$(MODULE_VERSION) -test: +test: makefile export PERL_TEST_DIFF=diff $(MAKE) -C scst-$(MODULE_VERSION) test #TEST_VERBOSE=1 -clean: +clean: makefile -$(MAKE) -C scst-$(MODULE_VERSION) clean distclean: clean @@ -38,4 +41,4 @@ distclean: clean extraclean: distclean -.PHONY: all install uninstall perl-module clean distclean extraclean +.PHONY: all install uninstall makefile perl-module clean distclean extraclean