From: Eric Wong <e@80x24.org>
To: meta@public-inbox.org
Cc: Eric Wong <e@80x24.org>
Subject: [PATCH 2/2] build: make syntax check target
Date: Thu, 3 Mar 2016 03:38:38 +0000 [thread overview]
Message-ID: <20160303033838.24778-3-e@80x24.org> (raw)
In-Reply-To: <20160303033838.24778-1-e@80x24.org>
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 <e@80x24.org>',
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';
+ <<EOF;
-include Documentation/include.mk
-N = $(shell echo $$(( $$(nproc 2>/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
prev parent reply other threads:[~2016-03-03 3:38 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-03 3:38 [ssoma PATCH 0/2] minor build fixes Eric Wong
2016-03-03 3:38 ` [PATCH 1/2] move scripts to script/ directory Eric Wong
2016-03-03 3:38 ` Eric Wong [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://public-inbox.org/README
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160303033838.24778-3-e@80x24.org \
--to=e@80x24.org \
--cc=meta@public-inbox.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).