]> git.ipfire.org Git - thirdparty/public-inbox.git/commitdiff
makefile: add `check-build' target
authorEric Wong <e@80x24.org>
Fri, 8 Dec 2023 03:54:36 +0000 (03:54 +0000)
committerEric Wong <e@80x24.org>
Sat, 9 Dec 2023 02:03:50 +0000 (02:03 +0000)
A quick build check can detect bugs more quickly normal runtime
tests.

Makefile.PL

index 28f8263e4d7bb694ddf8599a5c60c089b8f363bc..2b2e6b18dd47ed17ad77ad9065294f4c7e80c946 100644 (file)
@@ -34,6 +34,19 @@ my @syn = (@EXE_FILES, grep(m!^lib/.*\.pm$!, @manifest), @scripts);
 @syn = grep(!/SaPlugin/, @syn) if !eval { require Mail::SpamAssasin };
 $v->{syn_files} = \@syn;
 $v->{my_syntax} = [map { "$_.syntax" } @syn];
+my %native = (
+       XapHelperCxx => [ qw(xh_cidx.h xh_mset.h xap_helper.h) ],
+);
+my @ck_build;
+for my $m (sort keys %native) {
+       my $hdr = $native{$m};
+       my @dep = map { "lib/PublicInbox/$_" } ("$m.pm", @$hdr);
+       $t->{"$m.check_build: @dep"} = [ "\$(PERL) -w -I lib ".
+               "-MPublicInbox::$m -e PublicInbox::${m}::check_build" ];
+       push @ck_build, "$m.check_build";
+}
+$t->{"check-build: @ck_build"} = [];
+
 my @no_pod;
 $v->{-m1} = [ map {
                my $x = (split('/'))[-1];