]> Sergey Matveev's repositories - public-inbox.git/commitdiff
Makefile.PL: improve make(1) portability
authorEric Wong <e@80x24.org>
Tue, 7 May 2019 23:43:42 +0000 (23:43 +0000)
committerEric Wong <e@80x24.org>
Wed, 8 May 2019 22:56:34 +0000 (22:56 +0000)
The `shell' function appears missing, so we'll rely on Bourne
shell expansioN, instead.

Use "$?" instead of "$<" since the latter is only specified
for inference and .DEFAULT rules, not target rules.

Tested on FreeBSD make(1) and bmake(1) on Debian.

Makefile.PL

index eda7319230a031ab8815ed1367a84f21bf4b1711..6be913b168f58cf4dd7a86bb67ab1dcb5cf5f74d 100644 (file)
@@ -59,7 +59,7 @@ sub MY::postamble {
 EATMYDATA =
 -include config.mak
 -include Documentation/include.mk
-N ?= \$(shell echo \$\$(( \$\$(nproc 2>/dev/null || echo 2) + 1)))
+N = \$\$(( \$\$(nproc 2>/dev/null || gnproc 2>/dev/null || echo 2) + 1 ))
 SCRIPTS := scripts/ssoma-replay
 my_syntax := \$(addsuffix .syntax, $PM_FILES \$(EXE_FILES) \$(SCRIPTS))
 
@@ -70,13 +70,13 @@ my_syntax := \$(addsuffix .syntax, $PM_FILES \$(EXE_FILES) \$(SCRIPTS))
 syntax:: \$(my_syntax)
 
 check-manifest :: MANIFEST
-       if git ls-files >\$<.gen 2>&1; then diff -u \$< \$<.gen; fi
+       if git ls-files >\$?.gen 2>&1; then diff -u \$? \$?.gen; fi
 
 check:: pure_all check-manifest
        \$(EATMYDATA) prove -lv -j\$(N)
 
 lib/PublicInbox/UserContent.pm :: contrib/css/216dark.css
-       @\$(PERL) -I lib \$@ \$<
+       \$(PERL) -I lib \$@ \$?
 
 EOF
 }