Skip to content

Commit

Permalink
win32: remove makefile.mk (#18511)
Browse files Browse the repository at this point in the history
Makefile.mk is redundant with GNUmakefile. See
https://www.nntp.perl.org/group/perl.perl5.porters/2021/01/msg258848.html
for more details.

We planned to remove it shortly after the introduction of GNUmakefile
but that slipped through the cracks for some reason:
#14341
  • Loading branch information
xenu authored Jan 28, 2021
1 parent 341a561 commit 76b7a97
Show file tree
Hide file tree
Showing 15 changed files with 28 additions and 2,024 deletions.
1 change: 0 additions & 1 deletion MANIFEST
Original file line number Diff line number Diff line change
Expand Up @@ -6280,7 +6280,6 @@ win32/include/sys/errno2.h Win32 port
win32/include/sys/socket.h Win32 port
win32/list_static_libs.pl prints libraries for static linking
win32/Makefile Win32 makefile for NMAKE (Visual C++ build)
win32/makefile.mk Win32 makefile for DMAKE (BC++, VC++ builds)
win32/perlexe.ico perlexe.ico image file
win32/perlexe.manifest Assembly manifest file
win32/perlexe.rc associated perl binary with icon
Expand Down
4 changes: 2 additions & 2 deletions Porting/add-package.pl
Original file line number Diff line number Diff line change
Expand Up @@ -319,11 +319,11 @@
}
}
### add entries to win32/Makefile and win32/makefile.mk
### add entries to win32/Makefile
### they contain the following lines:
# ./win32/makefile.mk: ..\utils\ptardiff \
# ./win32/makefile.mk: xsubpp instmodsh prove ptar ptardiff
for my $file ( qw[win32/Makefile win32/makefile.mk] ) {
for my $file ( qw[win32/Makefile] ) {
unless ( `grep $bin $Repo/$file` ) {
print " Adding $bin entries to $file..." if $Verbose;
Expand Down
1 change: 0 additions & 1 deletion Porting/makerel
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,6 @@ my @writables = qw(
lib/warnings.pm
win32/GNUmakefile
win32/Makefile
win32/makefile.mk
win32/config_H.gc
win32/config_H.vc
uconfig.h
Expand Down
1 change: 0 additions & 1 deletion Porting/pod_lib.pl
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,6 @@ =head2 C<verify_contiguous()>
manifest => 'MANIFEST',
vms => 'vms/descrip_mms.template',
nmake => 'win32/Makefile',
dmake => 'win32/makefile.mk',
gmake => 'win32/GNUmakefile',
podmak => 'win32/pod.mak',
unix => 'Makefile.SH',
Expand Down
2 changes: 0 additions & 2 deletions Porting/pod_rules.pl
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
manifest => 'MANIFEST',
vms => 'vms/descrip_mms.template',
nmake => 'win32/Makefile',
dmake => 'win32/makefile.mk',
gmake => 'win32/GNUmakefile',
podmak => 'win32/pod.mak',
unix => 'Makefile.SH',
Expand Down Expand Up @@ -165,7 +164,6 @@ sub do_nmake {
}

# shut up used only once warning
*do_dmake = *do_dmake = \&do_nmake;
*do_gmake = *do_gmake = \&do_nmake;

sub do_podmak {
Expand Down
2 changes: 1 addition & 1 deletion README.cygwin
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,7 @@ be kept as clean as possible.
plan9/mkfile
hints/uwin.sh
vms/descrip_mms.template
win32/Makefile win32/makefile.mk
win32/Makefile

=item Tests

Expand Down
60 changes: 17 additions & 43 deletions README.win32
Original file line number Diff line number Diff line change
Expand Up @@ -97,20 +97,9 @@ See L</Usage Hints for Perl on Windows> below for general hints about this.

You need a "make" program to build the sources. If you are using
Visual C++ or the Windows SDK tools, you can use nmake supplied with Visual C++
or Windows SDK. You may also use, for Visual C++ or Windows SDK, dmake or gmake
instead of nmake. dmake is open source software, but is not included with
Visual C++ or Windows SDK. Builds using gcc need dmake or gmake. nmake is not
supported for gcc builds. Parallel building is only supported with dmake and
gmake, not nmake. When using dmake it is recommended to use dmake 4.13 or newer
for parallel building. Older dmakes, in parallel mode, have very high CPU usage
and pound the disk/filing system with duplicate I/O calls in an aggressive
polling loop.

A port of dmake for Windows is available from:

L<https://metacpan.org/release/dmake>

Fetch and install dmake somewhere on your path.
or Windows SDK. You may also use gmake instead of nmake. Builds using gcc need
gmake. nmake is not supported for gcc builds. Parallel building is only
supported with gmake, not nmake.

=item Command Shell

Expand Down Expand Up @@ -321,7 +310,8 @@ MinGW64 (version 4.4.3 or later). It can be downloaded here:
L<http://www.mingw.org/>
L<http://www.mingw-w64.org/>

You also need dmake or gmake. See L</"Make"> above on how to get it.
You also need gmake. Usually it comes with MinGW but its executable may have
a different name, such as mingw32-make.exe.

Note that the MinGW build currently fails with version 6.3.0 or later.

Expand Down Expand Up @@ -354,15 +344,14 @@ unlike GCC.
Make sure you are in the "win32" subdirectory under the perl toplevel.
This directory contains a "Makefile" that will work with
versions of nmake that come with Visual C++ or the Windows SDK, and
a GNU make "GNUmakefile" or dmake "makefile.mk" that will work for all
supported compilers. The defaults in the gmake and dmake makefile are
setup to build using MinGW/gcc.
a GNU make "GNUmakefile" that will work for all supported compilers.
The defaults in the gmake makefile are setup to build using MinGW/gcc.

=item *

Edit the GNUmakefile, makefile.mk (or Makefile, if you're using nmake)
and change the values of INST_DRV and INST_TOP. You can also enable
various build flags. These are explained in the makefiles.
Edit the GNUmakefile (or Makefile, if you're using nmake) and change the values
of INST_DRV and INST_TOP. You can also enable various build flags. These are
explained in the makefiles.

Note that it is generally not a good idea to try to build a perl with
INST_DRV and INST_TOP set to a path that already exists from a previous
Expand All @@ -378,7 +367,7 @@ F<lib> directories.

If building with the cross-compiler provided by
mingw-w64.org you'll need to uncomment the line that sets
GCCCROSS in the makefile.mk. Do this only if it's the cross-compiler - ie
GCCCROSS in the GNUmakefile. Do this only if it's the cross-compiler - ie
only if the bin folder doesn't contain a gcc.exe. (The cross-compiler
does not provide a gcc.exe, g++.exe, ar.exe, etc. Instead, all of these
executables are prefixed with 'x86_64-w64-mingw32-'.)
Expand All @@ -394,21 +383,18 @@ Be sure to read the instructions near the top of the makefiles carefully.

=item *

Type "dmake" ("gmake" for GNU make, or "nmake" if you are using that make).
Type "gmake" (or "nmake" if you are using that make).

This should build everything. Specifically, it will create perl.exe,
perl533.dll at the perl toplevel, and various other extension dll's
under the lib\auto directory. If the build fails for any reason, make
sure you have done the previous steps correctly.

To try dmake's parallel mode, type "dmake -P2", where 2, is the maximum number
To try gmake's parallel mode, type "gmake -j2", where 2, is the maximum number
of parallel jobs you want to run. A number of things in the build process will
run in parallel, but there are serialization points where you will see just 1
CPU maxed out. This is normal.

Similarly you can build in parallel with GNU make, type "gmake -j2" to
build with two parallel jobs, or higher for more.

If you are advanced enough with building C code, here is a suggestion to speed
up building perl, and the later C<make test>. Try to keep your PATH environmental
variable with the least number of folders possible (remember to keep your C
Expand All @@ -420,7 +406,7 @@ is the most commonly launched program during the build and later testing.

=head2 Testing Perl on Windows

Type "dmake test" (or "gmake test", "nmake test"). This will run most
Type "gmake test" (or "nmake test"). This will run most
of the tests from the testsuite (many tests will be skipped).

There should be no test failures.
Expand Down Expand Up @@ -448,7 +434,7 @@ native "cmd.exe", or if you are building from a path that contains
spaces. So don't do that.

If you are running the tests from a emacs shell window, you may see
failures in op/stat.t. Run "dmake test-notty" in that case.
failures in op/stat.t. Run "gmake test-notty" in that case.

Furthermore, you should make sure that during C<make test> you do not
have any GNU tool packages in your path: some toolkits like Unixutils
Expand All @@ -467,7 +453,7 @@ Please report any other failures as described under L</BUGS AND CAVEATS>.

=head2 Installation of Perl on Windows

Type "dmake install" (or "gmake install", "nmake install"). This will
Type "gmake install" ("nmake install"). This will
put the newly built perl and the libraries under whatever C<INST_TOP>
points to in the Makefile. It will also install the pod documentation
under C<$INST_TOP\$INST_VER\lib\pod> and HTML versions of the same
Expand Down Expand Up @@ -650,25 +636,13 @@ may not provide a testsuite (so "$MAKE test" may not do anything or
fail), but most serious ones do.

It is important that you use a supported 'make' program, and
ensure Config.pm knows about it. If you don't have nmake, you can
either get dmake from the location mentioned earlier or get an
old version of nmake reportedly available from:

L<http://download.microsoft.com/download/vc15/Patch/1.52/W95/EN-US/nmake15.exe>

Another option is to use the make written in Perl, available from
CPAN.

L<https://www.cpan.org/modules/by-module/Make/>

You may also use dmake or gmake. See L</"Make"> above on how to get it.
ensure Config.pm knows about it.

Note that MakeMaker actually emits makefiles with different syntax
depending on what 'make' it thinks you are using. Therefore, it is
important that one of the following values appears in Config.pm:

make='nmake' # MakeMaker emits nmake syntax
make='dmake' # MakeMaker emits dmake syntax
any other value # MakeMaker emits generic make syntax
(e.g GNU make, or Perl make)

Expand Down
4 changes: 0 additions & 4 deletions make_ext.pl
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@
#
# make_ext.pl "MAKE=nmake -nologo" --dir=..\ext --target=clean
#
# make_ext.pl MAKE=dmake --dir=..\ext
#
# make_ext.pl MAKE=dmake --dir=..\ext --target=clean
#
# Will skip building extensions which are marked with an '!' char.
# Mostly because they still not ported to specified platform.
#
Expand Down
4 changes: 4 additions & 0 deletions pod/perldelta.pod
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,10 @@ versions < 3.22 now works again. This was broken in Perl 5.31.4.
Building with mingw.org compilers (version 3.4.5 or later) using mingw runtime
versions >= 3.21 now works (for compilers up to version 5.3.0).

Makefile.mk, and thus support for dmake, has been removed. It is still possible
to build Perl on Windows using nmake (Makefile) and GNU make (GNUmakefile).
[L<GH #18511|https://github.com/Perl/perl5/pull/18511>]

=back

=head1 Internal Changes
Expand Down
5 changes: 1 addition & 4 deletions pod/perlmodinstall.pod
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,7 @@ If you used WinZip, this was already done for you.

C. BUILD

You'll need the C<nmake> utility, available at
L<http://download.microsoft.com/download/vc15/Patch/1.52/W95/EN-US/nmake15.exe>
or dmake, available on CPAN.
L<https://metacpan.org/release/dmake>
You'll need either C<nmake> or C<gmake>.

Does the module require compilation (i.e. does it have files that end
in .xs, .c, .h, .y, .cc, .cxx, or .C)? If it does, life is now
Expand Down
2 changes: 1 addition & 1 deletion regen/lib_cleanup.pl
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ sub edit_win32_makefile {
}

process('Makefile.SH', 'Makefile.SH', \&edit_makefile_SH, $TAP && '', $Verbose);
foreach ('win32/Makefile', 'win32/makefile.mk', 'win32/GNUmakefile') {
foreach ('win32/Makefile', 'win32/GNUmakefile') {
process($_, $_, \&edit_win32_makefile, $TAP && '', $Verbose);
}

Expand Down
1 change: 0 additions & 1 deletion t/porting/pod_rules.t
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
#
# Why do we test this?
# Among other reasons, to check the well-formed-ness of these files:
# win32/makefile.mk
# MANIFEST
# win32/Makefile
# win32/pod.mak
Expand Down
2 changes: 1 addition & 1 deletion t/porting/regen.t
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ if ( $Config{usecrosscompile} ) {
skip_all( "Not all files are available during cross-compilation" );
}

my $tests = 25; # I can't see a clean way to calculate this automatically.
my $tests = 24; # I can't see a clean way to calculate this automatically.

my %skip = ("regen_perly.pl" => [qw(perly.act perly.h perly.tab)],
"regen/keywords.pl" => [qw(keywords.c keywords.h)],
Expand Down
2 changes: 1 addition & 1 deletion win32/config.gc
Original file line number Diff line number Diff line change
Expand Up @@ -894,7 +894,7 @@ lseektype='long long'
mad='undef'
mail=''
mailx=''
make='dmake'
make='gmake'
make_set_make='#'
mallocobj='malloc.o'
mallocsrc='malloc.c'
Expand Down
Loading

0 comments on commit 76b7a97

Please sign in to comment.