git://git.savannah.gnu.org/make
Go to file
Costas Argyris b2bf660abc Add a UTF-8 resource when building for Windows
If a resource compiler is available, use it to add a UTF-8 resource
to the GNU Make executable on Windows.  As a result, GNU Make will
use UTF-8 as its ANSI code page, enabling it to work with UTF-8
encoded Makefiles, understand UTF-8 paths passed to it, etc.

These build process changes apply to all 3 ways that GNU Make can
be built for Windows:

1) configure
2) Basic.mk
3) build_w32.bat

When building with Visual Studio the resource compiler should always
be available.

When building with GCC or TCC, it depends on the availability of
'windres'.

If a resource compiler is not available, don't fail the build but
just proceed without the UTF-8 resource, effectively ignoring this
feature.

The UTF-8 resource only has an effect when GNU Make is running on a
minimum target version of Windows Version 1903 (May 2019 Update).
When the built GNU Make is running on an earlier version of Windows,
the embedded UTF-8 resource has no effect.

Code page information is added to --version output to tell users what
code pages are being used by any combination of GNU Make build (with
or without the UTF-8 resource) and Windows version that GNU Make is
running on (earlier than 1903 or not).

* README.git: Fix a typo.
* configure.ac: Search for windres and set WINDRES / HAVE_WINDRES.
* Makefile.am: Add manifest and resource files to EXTRA_DIST and
add a windres invocation to build them.
* build_w32.bat: Add support to build resource files.
* src/main.c (print_version): Add codepage info to Windows output.
* src/w32/utf8.manifest: Add a windres manifest file.
* src/w32/utf8.rc: Add a windres resource file.
* Basic.mk.template: Add support for building resource files.
* mk/Windows32.mk: Support windres resource files.
* .gitignore: Ignore TCC output directories.
2023-06-19 13:29:52 -04:00
doc [SV 63219] Support an "unload" function for loaded objects 2023-05-14 18:26:35 -04:00
gl Use MK_OS_DOS macro instead of __MSDOS__ 2023-01-16 00:03:13 -05:00
mk Add a UTF-8 resource when building for Windows 2023-06-19 13:29:52 -04:00
po * po/LINGUAS: Add support for Georgian translation 2023-06-19 10:05:19 -04:00
scripts Convert references from "GNU make" to "GNU Make" 2023-01-01 17:05:12 -05:00
src Add a UTF-8 resource when building for Windows 2023-06-19 13:29:52 -04:00
tests [SV 64124] Avoid stack overflows for large command lines 2023-06-19 13:27:50 -04:00
.ccls * .ccls: Disable clang compare against static string warning 2020-11-29 10:02:45 -05:00
.dir-locals.el * .dir-locals.el: Update for newer LSP config 2021-03-07 19:04:48 -05:00
.gitignore Add a UTF-8 resource when building for Windows 2023-06-19 13:29:52 -04:00
AUTHORS Remove support for AmigaOS 2023-01-15 17:32:15 -05:00
autogen.sh Update to the latest gnulib stable branch 2023-01-01 17:05:12 -05:00
autopull.sh Update to the latest gnulib stable branch 2023-01-01 17:05:12 -05:00
Basic.mk.template Add a UTF-8 resource when building for Windows 2023-06-19 13:29:52 -04:00
bootstrap Update to the latest gnulib stable branch 2023-01-01 17:05:12 -05:00
bootstrap-funclib.sh Update to the latest gnulib stable branch 2023-01-01 17:05:12 -05:00
bootstrap.bat Convert references from "GNU make" to "GNU Make" 2023-01-01 17:05:12 -05:00
bootstrap.conf Update to the latest gnulib stable branch 2023-01-01 17:05:12 -05:00
build_w32.bat Add a UTF-8 resource when building for Windows 2023-06-19 13:29:52 -04:00
build.cfg.in Update the copyright year on all files 2023-01-01 10:06:01 -05:00
build.sh [SV 62654] Support GNU Make on z/OS 2023-01-08 10:45:38 -05:00
builddos.bat Add support for .WARNINGS special variable 2023-04-02 10:02:18 -04:00
ChangeLog.1 Update URLs to use https rather than http 2022-10-18 14:37:47 -04:00
ChangeLog.2 Update URLs to use https rather than http 2022-10-18 14:37:47 -04:00
ChangeLog.3 Update URLs to use https rather than http 2022-10-18 14:37:47 -04:00
configure.ac Add a UTF-8 resource when building for Windows 2023-06-19 13:29:52 -04:00
COPYING Change HTTP URLs to use HTTPS instead 2021-12-19 16:55:50 -05:00
maintMakefile Allow jobserver style to be forced to "pipe" 2023-02-19 01:02:16 -05:00
make-gdb.py * NEWS: Use GNU Make instead of GNU make 2022-10-18 14:37:47 -04:00
Makefile.am Add a UTF-8 resource when building for Windows 2023-06-19 13:29:52 -04:00
makefile.com Update the copyright year on all files 2023-01-01 10:06:01 -05:00
NEWS * NEWS: Set a prerelease version 2023-06-19 10:05:19 -04:00
prepare_vms.com Remove template files to simplify distribution creation 2022-10-18 14:20:44 -04:00
README.customs Update the copyright year on all files 2023-01-01 10:06:01 -05:00
README.DOS Update the copyright year on all files 2023-01-01 10:06:01 -05:00
README.git Add a UTF-8 resource when building for Windows 2023-06-19 13:29:52 -04:00
README.in * README.git: Clarify some release steps 2023-02-26 15:52:25 -05:00
README.OS2 Update support for OS/2 2023-01-08 18:44:25 -05:00
README.VMS * NEWS: Use GNU Make instead of GNU make 2022-10-18 14:37:47 -04:00
README.W32 * README.W32: Add Windows 11 2023-02-21 20:54:48 -05:00
README.zOS [SV 62654] Support GNU Make on z/OS 2023-01-08 10:45:38 -05:00
TODO.private Update the copyright year on all files 2023-01-01 10:06:01 -05:00
vms_export_symbol_test.com [SV 42447]: VMS simulate exporting symbols 2014-10-20 01:28:46 -04:00

                                                                     -*-text-*-
GNU Make has been ported to z/OS, tested on z/OS V2R4.


PREREQUISITES
-------------
Building GNU Make requires certain tools be installed on your z/OS system.
These tools can be downloaded from: https://github.com/ZOSOpenTools
For detailed instructions on how to set up these tools, visit
https://zosopentools.github.io/meta/#/Guides/Pre-req

You will need curl, tar, and gzip to download and unpack the GNU Make release
package, but presumably you've already worked this out if you're reading this
document!

You will need the IBM C/C++ compiler.  You can download a web deliverable
add-on feature to your XL C/C++ compiler here:
https://www-40.ibm.com/servers/resourcelink/svc00100.nsf/pages/xlCC++V241ForZOsV24

Alternatively, you can install and manage C/C++ for Open Enterprise Languages
on z/OS using RedHat OpenShift Container Platform and IBM Z and Cloud
Modernization Stack.

GNU Make has a dependency on the ZOSLIB library, which is documented here:
https://zosopentools.github.io/meta/#/Guides/Zoslib.

To obtain the latest release of zoslib, you can download it from here:
https://github.com/ZOSOpenTools/zoslibport/releases.


BUILDING
--------
If you are trying to build from a checked-out Git workspace, see README.git.

Before building GNU Make, you will need to ensure that the following
environment variables are set, to turn on z/OS enhanced ASCII support:

  export _BPXK_AUTOCVT=ON
  export _CEE_RUNOPTS="$_CEE_RUNOPTS FILETAG(AUTOCVT,AUTOTAG) POSIX(ON)"
  export _TAG_REDIR_ERR=txt
  export _TAG_REDIR_IN=txt
  export _TAG_REDIR_OUT=txt

To ensure proper functioning of xlclang, set the following environment
variables before building:

  export _CC_CCMODE=1
  export _C89_CCMODE=1
  export _CXX_CCMODE=1

Set PATH_TO_ZOSLIB to the location of your zoslib installation; e.g.:

  PATH_TO_ZOSLIB=$HOME/zopen/prod/zoslib

Invoke ./configure as follows:

  ./configure \
      CC=xlclang \
      CPPFLAGS="-DNSIG=42 -D_XOPEN_SOURCE=600 -D_ALL_SOURCE -D_OPEN_SYS_FILE_EXT=1 -D_AE_BIMODAL=1 -D_ENHANCED_ASCII_EXT=0xFFFFFFF -DZOSLIB_OVERRIDE_CLIB=1" \
      CFLAGS="-qascii -std=gnu11 -qnocsect -qenum=int -I$PATH_TO_ZOSLIB/include" \
      LDFLAGS="-L$PATH_TO_ZOSLIB/lib" \
      LIBS="-lzoslib $PATH_TO_ZOSLIB/lib/CXXRT64.x"

If you have an instance of make already available you can build with:

  make

If not, you can build with:

  ./build.sh


TESTING
-------
To run the regression tests you'll need to install Perl and enable it.
Then you can run:

  ./make check


INSTALLING
----------
Copy the "make" program to wherever you want it to be installed, on your PATH.