Subject: | Getopt-Long-2.49 fails to build with MSVC nmake on Windows due to incompatible Makefile syntax |
Date: | Thu, 16 Jun 2016 15:51:04 -0400 |
To: | bug-Getopt-Long [...] rt.cpan.org |
From: | "A. Sinan Unur" <nanis [...] cpan.org> |
Replicated on 32 bit Vista with SDK tools and 64 bit Windows 10 with
MSVS 2013 tools. Test reports submitted.
C:\...\Getopt-Long-2.49> nmake
Microsoft (R) Program Maintenance Utility Version 12.00.21005.1
Copyright (C) Microsoft Corporation. All rights reserved.
makefile(925) : fatal error U1093: cannot mix dot directives
Stop.
The line in question in the Makefile is:
# --- MakeMaker postamble section:
regtest .SILENT : all
cd regtest && $(MAKE) $(PASTHRU) test
Here is what GNU Make manual has to say about .SILENT[1]:
Show quoted text
> The ‘-s’ or ‘--silent’ flag to make prevents all echoing, as
> if all recipes started with ‘@’. A rule in the makefile for the
> special target .SILENT without prerequisites has the same
> effect (see Special Built-in Target Names). .SILENT is
> *essentially obsolete* since ‘@’ is more flexible.
nmake does support .SILENT[2], but it has to be on a line by itself.
GNU make and nmake both support the -s command line option.
So, it seems, there are two options. One is for Makefile.PL to
conditionally generate something like
.SILENT
regtest : all
cd regtest && \$(MAKE) \$(PASTHRU) test
Unfortunately, that disables echoing to the end of the Makefile which
is probably not desirable.
It may be cleaner to just do:
# regtest
$ret .= <<EOD;
regtest : all
\@cd regtest && \@\$(MAKE) -s \$(PASTHRU) test
-- Sinan
[1]: https://www.gnu.org/software/make/manual/html_node/Echoing.html
[2]: https://msdn.microsoft.com/en-us/library/d82af2ab.aspx