perl5
perl5 copied to clipboard
No Makefile generated on MSYS2: make: *** No targets specified and no makefile found. Stop
I am trying to install a debug version of perl 5.32.0 on Windows 10, using MSYS2. After applying the fix for symlinks in #18037 I get:
$ wget https://www.cpan.org/src/5.0/perl-5.32.0.tar.gz
$ tar zxvf perl-5.32.0.tar.gz
$ cd perl-5.32.0
$ sh Configure -de -Dprefix=$HOME/myperl -DDEBUGGING -Dman1dir=none -Dman3dir=none
[...]
Doing variable substitutions on .SH files...
Extracting config.h (with variable substitutions)
cflags.SH: Adding -Werror=pointer-arith.
cflags.SH: Adding -Wextra.
cflags.SH: Adding -Wc++-compat.
cflags.SH: Adding -Wwrite-strings.
cflags.SH: Adding -Werror=declaration-after-statement.
cflags.SH: cc = cc
cflags.SH: ccflags = -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -D_FORTIFY_SOURCE=2
cflags.SH: stdflags =
cflags.SH: optimize = -O
cflags.SH: warn = -Wall -Werror=pointer-arith -Wextra -Wc++-compat -Wwrite-strings -Werror=declaration-after-statement
Extracting cflags (with variable substitutions)
Not re-extracting config.h
Extracting makedepend (with variable substitutions)
Extracting Makefile (with variable substitutions)
Extracting myconfig (with variable substitutions)
Extracting pod/Makefile (with variable substitutions)
Extracting Policy.sh (with variable substitutions)
Extracting runtests (with variable substitutions)
Configure done.
If you compile perl5 on a different machine or from a different object
directory, copy the Policy.sh file from this object directory to the
new one before you run Configure -- this will help you with most of
the policy defaults.
$ make
make: *** No targets specified and no makefile found. Stop.
By inspecting Makefile.SH I see that on line 1754 it deletes makefile:
$rm -f $firstmakefile
(since $firstmakefile is equal to makefile). But I believe in MSYS2 case does not matter so it deletes the newly generated Makefile instead (note capital M).
If I change the definition of firstmakefile on line 696 in the generated config.sh to:
firstmakefile='makefile2'
and rerun Makefile.SH it does not delete the generated Makefile. So this is just a quick fix to be able to run make
I had this exact same issue in a centos:7 container that had a bind mount to a folder on my Mac. I believe its due to the case insensitive file system.
The issue easily reproduced in a container by executing the following:
# place perl-5.34.0.tar.gz in ./test locally
docker run --rm -it -v $(pwd)/test:/test centos:centos7 /bin/bash
# in the container
cd /test
yum install -y make gcc
tar xvzf perl-5.34.0.tar.gz
cd perl-5.34.0
./Configure -des -Dprefix=$HOME/perl5 -Dusethreads
Then when running make you then get an make: *** No targets specified and no makefile found. Stop. error. This is because the Makefile gets deleted like in your example.
Does it work if you add firstmakefile='GNUmakefile' to hints/msys.sh? Or just a -Dfirstmakefile=GNUmakefile argument to Configure?
@Leont Yes it does :)
Me and @Corion have been working on a branch to make msys2 work out of the box, most recently at https://github.com/Perl/perl5/issues/18489
I also encountered the same problem