From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-2.9 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00, URIBL_BLOCKED shortcircuit=no autolearn=unavailable version=3.3.2 X-Original-To: meta@public-inbox.org Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id C92672057D; Thu, 3 Mar 2016 03:38:40 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Cc: Eric Wong Subject: [PATCH 2/2] build: make syntax check target Date: Thu, 3 Mar 2016 03:38:38 +0000 Message-Id: <20160303033838.24778-3-e@80x24.org> In-Reply-To: <20160303033838.24778-1-e@80x24.org> References: <20160303033838.24778-1-e@80x24.org> List-Id: This can be useful for quickly checking for syntax errors and warnings without running the full test suite --- Makefile.PL | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/Makefile.PL b/Makefile.PL index bf30ad0..2a7a6e7 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -6,12 +6,16 @@ # so don't depend on any public Perl API use strict; use ExtUtils::MakeMaker; +my @EXE_FILES = split("\n", `git ls-files 'script/' 2>/dev/null`); +my $PM_FILES = `git ls-files lib '*.pm' 2>/dev/null`; +$PM_FILES =~ tr/\n/ /; + WriteMakefile( NAME => 'ssoma', VERSION => '0.1.0', AUTHOR => 'Eric Wong ', ABSTRACT => 'some sort of mail archiver', - EXE_FILES => [ map { "script/$_" } qw/ssoma-mda ssoma ssoma-rm/], + EXE_FILES => \@EXE_FILES, PREREQ_PM => { # Keep this sorted and synced to the INSTALL document 'Digest::SHA' => 0, @@ -25,11 +29,19 @@ WriteMakefile( ); sub MY::postamble { - <<'EOF'; + </dev/null || echo 2) + 1))) +N := \$(shell echo \$\$(( \$\$(nproc 2>/dev/null || echo 2) + 1))) +my_syntax := \$(addsuffix .syntax, $PM_FILES \$(EXE_FILES)) + +%.syntax :: + @\$(PERL) -I lib -c \$(subst .syntax,,\$@) + +syntax:: \$(my_syntax) + + check:: pure_all - prove -lv -j$(N) + prove -lv -j\$(N) EOF } -- EW