Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Package request: bmake (BSD make) #5858

Closed
ofry opened this issue Oct 10, 2019 · 43 comments
Closed

Package request: bmake (BSD make) #5858

ofry opened this issue Oct 10, 2019 · 43 comments

Comments

@ofry
Copy link
Contributor

ofry commented Oct 10, 2019

Source code: http://www.crufty.net/ftp/pub/sjg/

Are there any issues which prevent to port it?

@StarWolf3000
Copy link
Contributor

There is no need to support other Make flavours other than GNU Make. BSD Make does not support some automatic variables like GNU Make does, also most Makefiles are written with GNU Make in mind, and the Autotools do not generate BSD Make compliant files. There's also only a small list of packages, that are BSD based (only at MSYS2):

  • bsdtar (as part of libarchive)
  • bsdcpio (as part of libarchive)
  • openbsd-netcat

@ofry
Copy link
Contributor Author

ofry commented Oct 11, 2019

@StarWolf3000 I need bmake for #5859

Elf toolchain (elftc) requires bmake as make tool (instantly fail compilation with GNU make)

@StarWolf3000
Copy link
Contributor

And what do you need those tools for? They're of no use on Windows platforms (which is the target of MSYS2 and MINGW), Windows does not support ELF (and no, Windows Subsystem for Linux does not count).

@ofry
Copy link
Contributor Author

ofry commented Oct 11, 2019

These tools (in this toolchain):

libelf
libelftc
libdwarf

required to build dynamorio https://github.com/DynamoRIO/dynamorio/

@ofry
Copy link
Contributor Author

ofry commented Oct 11, 2019

See DynamoRIO/dynamorio#638 for details

@ofry
Copy link
Contributor Author

ofry commented Oct 11, 2019

@StarWolf3000 So I really need BSD make in mingw32/mingw64

@StarWolf3000
Copy link
Contributor

Then it's also your turn to build BSD Make yourself, and provide afterwards (if successful) a PKGBUILD for it, including a PR. As long as not multiple other people really need it or an existing package needs it, it will not be provided. Again, this is a project that's made available in the free time of most of us, especially @Alexpux.

@ofry
Copy link
Contributor Author

ofry commented Oct 11, 2019

@StarWolf3000 Current status:

ofry@games MINGW64 ~/bmake
$ ./configure
configure: loading site script /mingw64/etc/config.site
checking for gcc... gcc
checking for C compiler default output file name... a.exe
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... .exe
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking whether gcc needs -traditional... no
checking for a BSD-compatible install... /usr/bin/install -c
Using: BMAKE_PATH_MAX=1024
checking for ANSI C header files... (cached) yes
checking for sys/wait.h that is POSIX.1 compatible... no
checking for dirent.h that defines DIR... yes
checking for library containing opendir... none required
checking sys/param.h usability... yes
checking sys/param.h presence... yes
checking for sys/param.h... yes
checking for sys/sysctl.h... no
checking ar.h usability... no
checking ar.h presence... no
checking for ar.h... no
checking err.h usability... no
checking err.h presence... no
checking for err.h... no
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking libgen.h usability... yes
checking libgen.h presence... yes
checking for libgen.h... yes
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking paths.h usability... no
checking paths.h presence... no
checking for paths.h... no
checking poll.h usability... no
checking poll.h presence... no
checking for poll.h... no
checking ranlib.h usability... no
checking ranlib.h presence... no
checking for ranlib.h... no
checking for string.h... (cached) yes
checking sys/mman.h usability... no
checking sys/mman.h presence... no
checking for sys/mman.h... no
checking sys/select.h usability... no
checking sys/select.h presence... no
checking for sys/select.h... no
checking sys/socket.h usability... no
checking sys/socket.h presence... no
checking for sys/socket.h... no
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking sys/uio.h usability... no
checking sys/uio.h presence... no
checking for sys/uio.h... no
checking for unistd.h... (cached) yes
checking utime.h usability... yes
checking utime.h presence... yes
checking for utime.h... yes
checking sys/cdefs.h usability... yes
checking sys/cdefs.h presence... yes
checking for sys/cdefs.h... yes
checking whether sys/cdefs.h is compatible... no
checking for __attribute__... yes
checking whether byte ordering is bigendian... no
checking for an ANSI C-conforming const... yes
checking for mode_t... yes
checking for off_t... yes
checking for pid_t... yes
checking for size_t... yes
checking for uint32_t... yes
checking whether sys_siglist is declared... no
checking whether time.h and sys/time.h may both be included... yes
checking whether struct tm is in sys/time.h or time.h... time.h
checking return type of signal handlers... void
checking vfork.h usability... no
checking vfork.h presence... no
checking for vfork.h... no
checking for fork... no
checking for vfork... no
checking for vprintf... yes
checking for _doprnt... no
checking for wait3 that fills in rusage... no
checking for err... no
checking for errx... no
checking for getcwd... yes
checking for getenv... yes
checking for getopt... yes
checking for getwd... no
checking for killpg... no
checking for mmap... no
checking for putenv... yes
checking for select... no
checking for setenv... no
checking for setpgid... no
checking for setsid... no
checking for sigaction... no
checking for sigvec... no
checking for snprintf... yes
checking for strerror... yes
checking for strftime... yes
checking for strsep... no
checking for strtod... yes
checking for strtol... yes
checking for sysctl... no
checking for unsetenv... no
checking for vsnprintf... yes
checking for wait3... no
checking for wait4... no
checking for waitpid... no
checking for warn... no
checking for warnx... no
checking for realpath... no
checking for dirname... yes
checking for stresep... no
checking for strlcpy... no
checking for emalloc in -lutil... no
checking whether stat file-mode macros are broken... no
checking for struct stat.st_rdev... yes
checking if compiler supports __func__
checking if diff -u works... yes
checking for MACHINE & MACHINE_ARCH...
defaults: MACHINE=mingw64_nt-6.3-96003, MACHINE_ARCH=x86_64
Using: MACHINE=mingw64_nt-6.3-96003, MACHINE_ARCH=x86_64
Using: MKSRC=${srcdir}/mk
configure: creating ./config.status
config.status: creating makefile
config.status: creating Makefile.config
config.status: creating make-bootstrap.sh
config.status: creating unit-tests/Makefile
config.status: creating config.h

You can now run

        sh ./make-bootstrap.sh

to produce a fully functional bmake.


ofry@games MINGW64 ~/bmake
$ ./make-bootstrap.sh
gcc -c -g -O2 -I. -I/home/ofry/bmake -DHAVE_CONFIG_H -I/home/ofry/bmake/missing -DNEED_HOST_CDEFS_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -DMAKE_VERSION="20181221" -DMACHINE="mingw64_nt-6.3-96003" -DMACHINE_ARCH="x86_64" -D_PATH_DEFSYSPATH="/share/mk" -o main.o /home/ofry/bmake/main.c
C:/msys64/home/ofry/bmake/main.c:119:10: fatal error: sys/resource.h: No such file or directory
  119 | #include <sys/resource.h>
      |          ^~~~~~~~~~~~~~~~
compilation terminated.

Mirror of sources there: https://github.com/ofry/bmake

@StarWolf3000
Copy link
Contributor

MINGW does not have a header named sys/resource.h. This header only exists in MSYS2 environment. So you can only build it for MSYS2 environment, where it succeeds for me:

user@DESKTOP-OQ78UR1 MSYS ~/bmake
$ ./configure
configure: loading site script /etc/config.site
checking for gcc... gcc
checking for C compiler default output file name... a.exe
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... .exe
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking whether gcc needs -traditional... no
checking for a BSD-compatible install... /usr/bin/install -c
Using: BMAKE_PATH_MAX=1024
checking for ANSI C header files... (cached) yes
checking for sys/wait.h that is POSIX.1 compatible... yes
checking for dirent.h that defines DIR... yes
checking for library containing opendir... none required
checking sys/param.h usability... yes
checking sys/param.h presence... yes
checking for sys/param.h... yes
checking for sys/sysctl.h... no
checking ar.h usability... yes
checking ar.h presence... yes
checking for ar.h... yes
checking err.h usability... yes
checking err.h presence... yes
checking for err.h... yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking libgen.h usability... yes
checking libgen.h presence... yes
checking for libgen.h... yes
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking paths.h usability... yes
checking paths.h presence... yes
checking for paths.h... yes
checking poll.h usability... yes
checking poll.h presence... yes
checking for poll.h... yes
checking ranlib.h usability... no
checking ranlib.h presence... no
checking for ranlib.h... no
checking for string.h... (cached) yes
checking sys/mman.h usability... yes
checking sys/mman.h presence... yes
checking for sys/mman.h... yes
checking sys/select.h usability... yes
checking sys/select.h presence... yes
checking for sys/select.h... yes
checking sys/socket.h usability... yes
checking sys/socket.h presence... yes
checking for sys/socket.h... yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking sys/uio.h usability... yes
checking sys/uio.h presence... yes
checking for sys/uio.h... yes
checking for unistd.h... (cached) yes
checking utime.h usability... yes
checking utime.h presence... yes
checking for utime.h... yes
checking sys/cdefs.h usability... yes
checking sys/cdefs.h presence... yes
checking for sys/cdefs.h... yes
checking whether sys/cdefs.h is compatible... yes
checking for __attribute__... yes
checking whether byte ordering is bigendian... no
checking for an ANSI C-conforming const... yes
checking for mode_t... yes
checking for off_t... yes
checking for pid_t... yes
checking for size_t... yes
checking for uint32_t... yes
checking whether sys_siglist is declared... yes
checking whether time.h and sys/time.h may both be included... yes
checking whether struct tm is in sys/time.h or time.h... time.h
checking return type of signal handlers... void
checking vfork.h usability... no
checking vfork.h presence... no
checking for vfork.h... no
checking for fork... yes
checking for vfork... yes
checking for working fork... yes
checking for working vfork... (cached) yes
checking for vprintf... yes
checking for _doprnt... no
checking for wait3 that fills in rusage... yes
checking for err... yes
checking for errx... yes
checking for getcwd... yes
checking for getenv... yes
checking for getopt... yes
checking for getwd... yes
checking for killpg... yes
checking for mmap... yes
checking for putenv... yes
checking for select... yes
checking for setenv... yes
checking for setpgid... yes
checking for setsid... yes
checking for sigaction... yes
checking for sigvec... no
checking for snprintf... yes
checking for strerror... yes
checking for strftime... yes
checking for strsep... yes
checking for strtod... yes
checking for strtol... yes
checking for sysctl... no
checking for unsetenv... yes
checking for vsnprintf... yes
checking for wait3... yes
checking for wait4... yes
checking for waitpid... yes
checking for warn... yes
checking for warnx... yes
checking for realpath... yes
checking for dirname... yes
checking for stresep... no
checking for strlcpy... yes
checking for emalloc in -lutil... no
checking whether stat file-mode macros are broken... no
checking for struct stat.st_rdev... yes
checking if compiler supports __func__
checking if diff -u works... yes
checking for MACHINE & MACHINE_ARCH...
defaults: MACHINE=msys_nt-10.0-183623, MACHINE_ARCH=x86_64
Using: MACHINE=msys_nt-10.0-183623, MACHINE_ARCH=x86_64
Using: MKSRC=${srcdir}/mk
configure: creating ./config.status
config.status: creating makefile
config.status: creating Makefile.config
config.status: creating make-bootstrap.sh
config.status: creating unit-tests/Makefile
config.status: creating config.h

You can now run

        sh ./make-bootstrap.sh

to produce a fully functional bmake.


user@DESKTOP-OQ78UR1 MSYS ~/bmake
$ ./make-bootstrap.sh
gcc -c -g -O2 -I. -I/home/user/bmake -DHAVE_CONFIG_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -DMAKE_VERSION="20181221" -DMACHINE="msys_nt-10.0-183623" -DMACHINE_ARCH="x86_64" -D_PATH_DEFSYSPATH="/share/mk" -o main.o /home/user/bmake/main.c
gcc -c -g -O2 -I. -I/home/user/bmake -DHAVE_CONFIG_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -o arch.o /home/user/bmake/arch.c
gcc -c -g -O2 -I. -I/home/user/bmake -DHAVE_CONFIG_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -o buf.o /home/user/bmake/buf.c
gcc -c -g -O2 -I. -I/home/user/bmake -DHAVE_CONFIG_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -o compat.o /home/user/bmake/compat.c
gcc -c -g -O2 -I. -I/home/user/bmake -DHAVE_CONFIG_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -o cond.o /home/user/bmake/cond.c
gcc -c -g -O2 -I. -I/home/user/bmake -DHAVE_CONFIG_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -o dir.o /home/user/bmake/dir.c
gcc -c -g -O2 -I. -I/home/user/bmake -DHAVE_CONFIG_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -o for.o /home/user/bmake/for.c
gcc -c -g -O2 -I. -I/home/user/bmake -DHAVE_CONFIG_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -o getopt /home/user/bmake/getopt.c
gcc -c -g -O2 -I. -I/home/user/bmake -DHAVE_CONFIG_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -o hash.o /home/user/bmake/hash.c
gcc -c -g -O2 -I. -I/home/user/bmake -DHAVE_CONFIG_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -o job.o /home/user/bmake/job.c
gcc -c -g -O2 -I. -I/home/user/bmake -DHAVE_CONFIG_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -o make.o /home/user/bmake/make.c
gcc -c -g -O2 -I. -I/home/user/bmake -DHAVE_CONFIG_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -o make_malloc.o /home/user/bmake/make_malloc.c
gcc -c -g -O2 -I. -I/home/user/bmake -DHAVE_CONFIG_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -o metachar.o /home/user/bmake/metachar.c
gcc -c -g -O2 -I. -I/home/user/bmake -DHAVE_CONFIG_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -o parse.o /home/user/bmake/parse.c
gcc -c -g -O2 -I. -I/home/user/bmake -DHAVE_CONFIG_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -o sigcompat.o /home/user/bmake/sigcompat.c
gcc -c -g -O2 -I. -I/home/user/bmake -DHAVE_CONFIG_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -o str.o /home/user/bmake/str.c
gcc -c -g -O2 -I. -I/home/user/bmake -DHAVE_CONFIG_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -o strlist.o /home/user/bmake/strlist.c
gcc -c -g -O2 -I. -I/home/user/bmake -DHAVE_CONFIG_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -o suff.o /home/user/bmake/suff.c
gcc -c -g -O2 -I. -I/home/user/bmake -DHAVE_CONFIG_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -o targ.o /home/user/bmake/targ.c
gcc -c -g -O2 -I. -I/home/user/bmake -DHAVE_CONFIG_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -o trace.o /home/user/bmake/trace.c
gcc -c -g -O2 -I. -I/home/user/bmake -DHAVE_CONFIG_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -o var.o /home/user/bmake/var.c
gcc -c -g -O2 -I. -I/home/user/bmake -DHAVE_CONFIG_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -o util.o /home/user/bmake/util.c
gcc -c -g -O2 -I. -I/home/user/bmake -DHAVE_CONFIG_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -o lstAppend.o /home/user/bmake/lst.lib/lstAppend.c
gcc -c -g -O2 -I. -I/home/user/bmake -DHAVE_CONFIG_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -o lstDupl.o /home/user/bmake/lst.lib/lstDupl.c
gcc -c -g -O2 -I. -I/home/user/bmake -DHAVE_CONFIG_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -o lstInit.o /home/user/bmake/lst.lib/lstInit.c
gcc -c -g -O2 -I. -I/home/user/bmake -DHAVE_CONFIG_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -o lstOpen.o /home/user/bmake/lst.lib/lstOpen.c
gcc -c -g -O2 -I. -I/home/user/bmake -DHAVE_CONFIG_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -o lstAtEnd.o /home/user/bmake/lst.lib/lstAtEnd.c
gcc -c -g -O2 -I. -I/home/user/bmake -DHAVE_CONFIG_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -o lstEnQueue.o /home/user/bmake/lst.lib/lstEnQueue.c
gcc -c -g -O2 -I. -I/home/user/bmake -DHAVE_CONFIG_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -o lstInsert.o /home/user/bmake/lst.lib/lstInsert.c
gcc -c -g -O2 -I. -I/home/user/bmake -DHAVE_CONFIG_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -o lstAtFront.o /home/user/bmake/lst.lib/lstAtFront.c
gcc -c -g -O2 -I. -I/home/user/bmake -DHAVE_CONFIG_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -o lstIsAtEnd.o /home/user/bmake/lst.lib/lstIsAtEnd.c
gcc -c -g -O2 -I. -I/home/user/bmake -DHAVE_CONFIG_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -o lstClose.o /home/user/bmake/lst.lib/lstClose.c
gcc -c -g -O2 -I. -I/home/user/bmake -DHAVE_CONFIG_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -o lstFind.o /home/user/bmake/lst.lib/lstFind.c
gcc -c -g -O2 -I. -I/home/user/bmake -DHAVE_CONFIG_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -o lstIsEmpty.o /home/user/bmake/lst.lib/lstIsEmpty.c
gcc -c -g -O2 -I. -I/home/user/bmake -DHAVE_CONFIG_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -o lstRemove.o /home/user/bmake/lst.lib/lstRemove.c
gcc -c -g -O2 -I. -I/home/user/bmake -DHAVE_CONFIG_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -o lstConcat.o /home/user/bmake/lst.lib/lstConcat.c
gcc -c -g -O2 -I. -I/home/user/bmake -DHAVE_CONFIG_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -o lstFindFrom.o /home/user/bmake/lst.lib/lstFindFrom.c
gcc -c -g -O2 -I. -I/home/user/bmake -DHAVE_CONFIG_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -o lstLast.o /home/user/bmake/lst.lib/lstLast.c
gcc -c -g -O2 -I. -I/home/user/bmake -DHAVE_CONFIG_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -o lstReplace.o /home/user/bmake/lst.lib/lstReplace.c
gcc -c -g -O2 -I. -I/home/user/bmake -DHAVE_CONFIG_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -o lstFirst.o /home/user/bmake/lst.lib/lstFirst.c
gcc -c -g -O2 -I. -I/home/user/bmake -DHAVE_CONFIG_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -o lstDatum.o /home/user/bmake/lst.lib/lstDatum.c
gcc -c -g -O2 -I. -I/home/user/bmake -DHAVE_CONFIG_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -o lstForEach.o /home/user/bmake/lst.lib/lstForEach.c
gcc -c -g -O2 -I. -I/home/user/bmake -DHAVE_CONFIG_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -o lstMember.o /home/user/bmake/lst.lib/lstMember.c
gcc -c -g -O2 -I. -I/home/user/bmake -DHAVE_CONFIG_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -o lstSucc.o /home/user/bmake/lst.lib/lstSucc.c
gcc -c -g -O2 -I. -I/home/user/bmake -DHAVE_CONFIG_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -o lstDeQueue.o /home/user/bmake/lst.lib/lstDeQueue.c
gcc -c -g -O2 -I. -I/home/user/bmake -DHAVE_CONFIG_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -o lstForEachFrom.o /home/user/bmake/lst.lib/lstForEachFrom.c
gcc -c -g -O2 -I. -I/home/user/bmake -DHAVE_CONFIG_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -o lstDestroy.o /home/user/bmake/lst.lib/lstDestroy.c
gcc -c -g -O2 -I. -I/home/user/bmake -DHAVE_CONFIG_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -o lstNext.o /home/user/bmake/lst.lib/lstNext.c
gcc -c -g -O2 -I. -I/home/user/bmake -DHAVE_CONFIG_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -o lstPrev.o /home/user/bmake/lst.lib/lstPrev.c
gcc -c -g -O2 -I. -I/home/user/bmake -DHAVE_CONFIG_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -o stresep.o /home/user/bmake/stresep.c
gcc -c -g -O2 -I. -I/home/user/bmake -DHAVE_CONFIG_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -o meta.o /home/user/bmake/meta.c
gcc -o bmake main.o meta.o arch.o buf.o compat.o cond.o dir.o for.o getopt hash.o job.o make.o make_malloc.o metachar.o parse.o sigcompat.o str.o strlist.o suff.o targ.o trace.o var.o util.o lstAppend.o lstDupl.o lstInit.o lstOpen.o lstAtEnd.o lstEnQueue.o lstInsert.o lstAtFront.o lstIsAtEnd.o lstClose.o lstFind.o lstIsEmpty.o lstRemove.o lstConcat.o lstFindFrom.o lstLast.o lstReplace.o lstFirst.o lstDatum.o lstForEach.o lstMember.o lstSucc.o lstDeQueue.o lstForEachFrom.o lstDestroy.o lstNext.o lstPrev.o stresep.o

user@DESKTOP-OQ78UR1 MSYS ~/bmake
$

@ofry
Copy link
Contributor Author

ofry commented Oct 11, 2019

@StarWolf3000 If I apply this patch to source code: https://gist.github.com/ofry/898f8e28e61c130314cbddb16fb5685a

I got these errors:

gcc -c -g -O2 -I. -I/home/ofry/bmake -DHAVE_CONFIG_H -I/home/ofry/bmake/missing -DNEED_HOST_CDEFS_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -DMAKE_VERSION="20181221" -DMACHINE="mingw64_nt-6.3-96003" -DMACHINE_ARCH="x86_64" -D_PATH_DEFSYSPATH="/share/mk" -o main.o /home/ofry/bmake/main.c
C:/msys64/home/ofry/bmake/main.c: In function 'MainParseArgs':
C:/msys64/home/ofry/bmake/main.c:522:9: warning: implicit declaration of function 'fcntl' [-Wimplicit-function-declaration]
  522 |    if ((fcntl(jp_0, F_GETFD, 0) < 0) ||
      |         ^~~~~
C:/msys64/home/ofry/bmake/main.c:522:21: error: 'F_GETFD' undeclared (first use in this function)
  522 |    if ((fcntl(jp_0, F_GETFD, 0) < 0) ||
      |                     ^~~~~~~
C:/msys64/home/ofry/bmake/main.c:522:21: note: each undeclared identifier is reported only once for each function it appears in
C:/msys64/home/ofry/bmake/main.c: In function 'Main_SetObjdir':
C:/msys64/home/ofry/bmake/main.c:782:4: warning: implicit declaration of function 'setenv'; did you mean 'getenv'? [-Wimplicit-function-declaration]
  782 |    setenv("PWD", objdir, 1);
      |    ^~~~~~
      |    getenv
C:/msys64/home/ofry/bmake/main.c: In function 'main':
C:/msys64/home/ofry/bmake/main.c:1021:2: warning: implicit declaration of function 'srandom'; did you mean 'srand'? [-Wimplicit-function-declaration]
 1021 |  srandom(rightnow.tv_sec + rightnow.tv_usec);
      |  ^~~~~~~
      |  srand
C:/msys64/home/ofry/bmake/main.c:1032:17: error: storage size of 'rl' isn't known
 1032 |   struct rlimit rl;
      |                 ^~
C:/msys64/home/ofry/bmake/main.c:1033:7: warning: implicit declaration of function 'getrlimit' [-Wimplicit-function-declaration]
 1033 |   if (getrlimit(RLIMIT_NOFILE, &rl) != -1 &&
      |       ^~~~~~~~~
C:/msys64/home/ofry/bmake/main.c:1033:17: error: 'RLIMIT_NOFILE' undeclared (first use in this function)
 1033 |   if (getrlimit(RLIMIT_NOFILE, &rl) != -1 &&
      |                 ^~~~~~~~~~~~~
C:/msys64/home/ofry/bmake/main.c:1036:10: warning: implicit declaration of function 'setrlimit' [-Wimplicit-function-declaration]
 1036 |    (void)setrlimit(RLIMIT_NOFILE, &rl);
      |          ^~~~~~~~~
C:/msys64/home/ofry/bmake/main.c:1192:39: warning: implicit declaration of function 'getppid'; did you mean 'getpid'? [-Wimplicit-function-declaration]
 1192 |      snprintf(tmp, sizeof(tmp), "%u", getppid());
      |                                       ^~~~~~~
      |                                       getpid
C:/msys64/home/ofry/bmake/main.c: In function 'Cmd_Exec':
C:/msys64/home/ofry/bmake/main.c:1656:9: warning: implicit declaration of function 'pipe'; did you mean '_pipe'? [-Wimplicit-function-declaration]
 1656 |     if (pipe(fds) == -1) {
      |         ^~~~
      |         _pipe
In file included from C:/msys64/home/ofry/bmake/pathnames.h:36,
                 from C:/msys64/home/ofry/bmake/main.c:143:
C:/msys64/home/ofry/bmake/config.h:345:15: warning: implicit declaration of function 'fork' [-Wimplicit-function-declaration]
  345 | #define vfork fork
      |               ^~~~
C:/msys64/home/ofry/bmake/make.h:446:40: note: in expansion of macro 'vfork'
  446 | #define vFork() ((getpid() == myPid) ? vfork() : fork())
      |                                        ^~~~~
C:/msys64/home/ofry/bmake/main.c:1664:20: note: in expansion of macro 'vFork'
 1664 |     switch (cpid = vFork()) {
      |                    ^~~~~
C:/msys64/home/ofry/bmake/main.c:1716:16: warning: implicit declaration of function 'waitpid' [-Wimplicit-function-declaration]
 1716 |  while(((pid = waitpid(cpid, &status, 0)) != cpid) && (pid >= 0)) {
      |                ^~~~~~~
C:/msys64/home/ofry/bmake/main.c:1726:6: warning: implicit declaration of function 'WIFSIGNALED' [-Wimplicit-function-declaration]
 1726 |  if (WIFSIGNALED(status))
      |      ^~~~~~~~~~~
C:/msys64/home/ofry/bmake/main.c: In function 'eunlink':
C:/msys64/home/ofry/bmake/main.c:1906:6: warning: implicit declaration of function 'lstat'; did you mean 'wstat'? [-Wimplicit-function-declaration]
 1906 |  if (lstat(file, &st) == -1)
      |      ^~~~~
      |      wstat
C:/msys64/home/ofry/bmake/main.c: In function 'cached_realpath':
C:/msys64/home/ofry/bmake/main.c:2022:22: warning: implicit declaration of function 'realpath'; did you mean 'is_relpath'? [-Wimplicit-function-declaration]
 2022 |     } else if ((rp = realpath(pathname, resolved)) != NULL) {
      |                      ^~~~~~~~
      |                      is_relpath
C:/msys64/home/ofry/bmake/main.c:2022:20: warning: assignment to 'char *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
 2022 |     } else if ((rp = realpath(pathname, resolved)) != NULL) {
      |                    ^
C:/msys64/home/ofry/bmake/main.c: In function 'PrintAddr':
C:/msys64/home/ofry/bmake/main.c:2032:20: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
 2032 |     printf("%lx ", (unsigned long) a);
      |                    ^

Could you help me with this? In MSYS2 wiki I not found alternatives to these constants and functions.

@ofry
Copy link
Contributor Author

ofry commented Oct 11, 2019

@StarWolf3000 I need 32 and 64 bit versions, so I should port it to mingw too. Could you help me with that? At least. where to dig with this?

@oscarfv
Copy link
Contributor

oscarfv commented Oct 14, 2019

@StarWolf3000 : opening issues for requesting packages is perfectly ok on this project. As long as you don't demand a response, of course.

@ofry : for what I can see on the issue you linked to, lack of BSD Make if the least of your concerns. That project (DynamoRIO) is so dependent on VS that extensive changes are required to its source code to make it compilable with MinGW. Apart that it is much more easy to adapt their CMake script than to port BSD Make to Windows just to use their alternative hand-made makefiles.

So I suggest that you keep adapting the CMake scripts and then proceed to adapt the C/C++ source code.

@ofry
Copy link
Contributor Author

ofry commented Dec 18, 2019

@StarWolf3000 @oscarfv

I tried to port bmake to MinGW. Result is in https://github.com/ofry/bmake/commits/port-20181221

At least, it compiles fine. Could anyone help me with PKGBUILD file?

@ofry
Copy link
Contributor Author

ofry commented Dec 18, 2019

@oscarfv I need bmake not for DynamoRio itself. I need it because I need some dependencies (libelf, libelftc, libdwarf) available as MinGW libraries.

And these dependencies require bmake to build it, so I can't create package with it.

@mingwandroid
Copy link
Member

You could create cmake files for these projects and propose them upstream. The soft part of software really does mean something.

@Biswa96
Copy link
Member

Biswa96 commented Dec 18, 2019

I tried to create the bmake package with makpkg -s using the PKGBUILD file from ArchLinux. The source code is compiled successfully but some error is shown during package() step. Here are the errors:

install: cannot change permissions of ‘/c/MyFiles/bmake/pkg/bmake/usr/share/man/cat1’: Permission denied
*** [beforeinstall] Error code 1
install: cannot change permissions of ‘/c/MyFiles/bmake/pkg/bmake/usr/share/mk’: Permission denied
*** [install-mk] Error code 1

Use the msys2 mode aka. the purple icon because bmake needs some *nix functions.

@ofry
Copy link
Contributor Author

ofry commented Dec 18, 2019

@Biswa96 Thank you, will look into it.

@ofry
Copy link
Contributor Author

ofry commented Dec 19, 2019

Current state:

ofry@games MINGW64 ~/bmake
$ ./boot-strap
NOTE: default prefix=/home/ofry/mingw64_nt-6.3-96003-x86_64
configure: loading site script /mingw64/etc/config.site
checking for gcc... gcc
checking for C compiler default output file name... a.exe
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... .exe
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking whether gcc needs -traditional... no
checking for a BSD-compatible install... /usr/bin/install -c
Using: BMAKE_PATH_MAX=1024
checking for ANSI C header files... (cached) yes
checking for sys/wait.h that is POSIX.1 compatible... no
checking for dirent.h that defines DIR... yes
checking for library containing opendir... none required
checking sys/param.h usability... yes
checking sys/param.h presence... yes
checking for sys/param.h... yes
checking for sys/sysctl.h... no
checking ar.h usability... no
checking ar.h presence... no
checking for ar.h... no
checking err.h usability... no
checking err.h presence... no
checking for err.h... no
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking libgen.h usability... yes
checking libgen.h presence... yes
checking for libgen.h... yes
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking paths.h usability... no
checking paths.h presence... no
checking for paths.h... no
checking poll.h usability... no
checking poll.h presence... no
checking for poll.h... no
checking ranlib.h usability... no
checking ranlib.h presence... no
checking for ranlib.h... no
checking for string.h... (cached) yes
checking sys/mman.h usability... no
checking sys/mman.h presence... no
checking for sys/mman.h... no
checking sys/resource.h usability... no
checking sys/resource.h presence... no
checking for sys/resource.h... no
checking sys/select.h usability... no
checking sys/select.h presence... no
checking for sys/select.h... no
checking sys/socket.h usability... no
checking sys/socket.h presence... no
checking for sys/socket.h... no
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking sys/uio.h usability... no
checking sys/uio.h presence... no
checking for sys/uio.h... no
checking sys/utsname.h usability... no
checking sys/utsname.h presence... no
checking for sys/utsname.h... no
checking for sys/wait.h... (cached) no
checking for unistd.h... (cached) yes
checking utime.h usability... yes
checking utime.h presence... yes
checking for utime.h... yes
checking sys/cdefs.h usability... yes
checking sys/cdefs.h presence... yes
checking for sys/cdefs.h... yes
checking whether sys/cdefs.h is compatible... no
checking for __attribute__... yes
checking whether byte ordering is bigendian... no
checking for an ANSI C-conforming const... yes
checking for mode_t... yes
checking for off_t... yes
checking for pid_t... yes
checking for size_t... yes
checking for int32_t... no
checking for uint32_t... yes
checking whether sys_siglist is declared... no
checking whether time.h and sys/time.h may both be included... yes
checking whether struct tm is in sys/time.h or time.h... time.h
checking return type of signal handlers... void
checking vfork.h usability... no
checking vfork.h presence... no
checking for vfork.h... no
checking for fork... no
checking for vfork... no
checking for vprintf... yes
checking for _doprnt... no
checking for wait3 that fills in rusage... no
checking for _Exit... yes
checking for atoll... yes
checking for canonicalize_file_name... no
checking for chown... no
checking for dup2... yes
checking for dup3... no
checking for endusershell... no
checking for err... no
checking for errx... no
checking for euidaccess... no
checking for faccessat... no
checking for fchdir... no
checking for fchmodat... no
checking for fchownat... no
checking for fcntl... no
checking for fdatasync... no
checking for fstatat... no
checking for fsync... no
checking for ftruncate... yes
checking for futimens... no
checking for getcwd... yes
checking for getdomainname... no
checking for getdtablesize... no
checking for getenv... yes
checking for getgroups... no
checking for gethostname... no
checking for getloadavg... no
checking for getlogin... yes
checking for getlogin_r... no
checking for getopt... yes
checking for getpass... no
checking for getppid... no
checking for getrusage... no
checking for getsubopt... no
checking for getusershell... no
checking for getwd... no
checking for grantpt... no
checking for group_member... no
checking for initstate... no
checking for initstate_r... no
checking for kill... no
checking for killpg... no
checking for lchmod... no
checking for lchown... no
checking for link... no
checking for linkat... no
checking for lstat... no
checking for mkdirat... no
checking for mkdtemp... no
checking for mkfifo... no
checking for mkfifoat... no
checking for mknod... no
checking for mknodat... no
checking for mkostemp... no
checking for mkostemps... no
checking for mkstemp... yes
checking for mkstemps... no
checking for mmap... no
checking for openat... no
checking for pipe... no
checking for pipe2... no
checking for poll... no
checking for posix_openpt... no
checking for pread... no
checking for pthread_sigmask... no
checking for ptsname... no
checking for ptsname_r... no
checking for putenv... yes
checking for pwrite... no
checking for qsort_r... no
checking for raise... yes
checking for random... no
checking for random_r... no
checking for readlink... no
checking for readlinkat... no
checking for reallocarray... no
checking for realpath... no
checking for rpmatch... no
checking for secure_getenv... no
checking for select... no
checking for setenv... no
checking for sethostname... no
checking for setpgid... no
checking for setpgrp... no
checking for setsid... no
checking for setstate... no
checking for setstate_r... no
checking for setusershell... no
checking for sigaction... no
checking for sigaddset... no
checking for sigdelset... no
checking for sigemptyset... no
checking for sigfillset... no
checking for sigismember... no
checking for signal... yes
checking for sigpending... no
checking for sigprocmask... no
checking for sigvec... no
checking for sleep... yes
checking for snprintf... yes
checking for srandom... no
checking for srandom_r... no
checking for strerror... yes
checking for strftime... yes
checking for strsep... no
checking for strtod... yes
checking for strtol... yes
checking for strtoll... yes
checking for strtoull... yes
checking for symlink... no
checking for symlinkat... no
checking for sysctl... no
checking for truncate... yes
checking for ttyname_r... no
checking for uname... no
checking for unlinkat... no
checking for unlockpt... no
checking for unsetenv... no
checking for usleep... yes
checking for utimensat... no
checking for vsnprintf... yes
checking for wait... no
checking for wait3... no
checking for wait4... no
checking for waitpid... no
checking for warn... no
checking for warnx... no
checking for realpath... (cached) no
checking for dirname... yes
checking for stresep... no
checking for strlcpy... no
checking for emalloc in -lutil... no
checking whether stat file-mode macros are broken... no
checking for struct stat.st_rdev... yes
checking if compiler supports __func__
checking if diff -u works... yes
checking for MACHINE & MACHINE_ARCH...
defaults: MACHINE=mingw64_nt-6.3-96003, MACHINE_ARCH=x86_64
Using: MACHINE=mingw64_nt-6.3-96003, MACHINE_ARCH=x86_64
Using: MKSRC=${srcdir}/mk
configure: creating ./config.status
config.status: creating makefile
config.status: creating Makefile.config
config.status: creating make-bootstrap.sh
config.status: creating unit-tests/Makefile
config.status: creating config.h
config.status: config.h is unchanged

You can now run

        sh ./make-bootstrap.sh

to produce a fully functional bmake.

gcc -c -g -O2 -I. -I/home/ofry/bmake -DHAVE_CONFIG_H -I/home/ofry/bmake/missing -DNEED_HOST_CDEFS_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -DNO_REGEX -DMAKE_VERSION="20181221" -DMACHINE="mingw64_nt-6.3-96003" -DMACHINE_ARCH="x86_64" -D_PATH_DEFSYSPATH="/home/ofry/mingw64_nt-6.3-96003-x86_64/share/mk" -o main.o /home/ofry/bmake/main.c
In file included from C:/msys64/home/ofry/bmake/main.c:151:
C:/msys64/home/ofry/bmake/headers-mingw/stdlib.h:52:1: warning: useless storage class specifier in empty declaration
   52 | };
      | ^
In file included from C:/msys64/home/ofry/bmake/pathnames.h:36,
                 from C:/msys64/home/ofry/bmake/main.c:160:
C:/msys64/home/ofry/bmake/main.c: In function 'Cmd_Exec':
./config.h:642:15: warning: implicit declaration of function 'fork' [-Wimplicit-function-declaration]
  642 | #define vfork fork
      |               ^~~~
C:/msys64/home/ofry/bmake/make.h:455:40: note: in expansion of macro 'vfork'
  455 | #define vFork() ((getpid() == myPid) ? vfork() : fork())
      |                                        ^~~~~
C:/msys64/home/ofry/bmake/main.c:1681:20: note: in expansion of macro 'vFork'
 1681 |     switch (cpid = vFork()) {
      |                    ^~~~~
C:/msys64/home/ofry/bmake/main.c: In function 'PrintAddr':
C:/msys64/home/ofry/bmake/main.c:2049:20: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
 2049 |     printf("%lx ", (unsigned long) a);
      |                    ^
gcc -c -g -O2 -I. -I/home/ofry/bmake -DHAVE_CONFIG_H -I/home/ofry/bmake/missing -DNEED_HOST_CDEFS_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -DNO_REGEX -o arch.o /home/ofry/bmake/arch.c
In file included from C:/msys64/home/ofry/bmake/make.h:98,
                 from C:/msys64/home/ofry/bmake/arch.c:167:
C:/msys64/home/ofry/bmake/headers-mingw/stdlib.h:52:1: warning: useless storage class specifier in empty declaration
   52 | };
      | ^
C:/msys64/home/ofry/bmake/arch.c: In function 'ArchFindMember':
C:/msys64/home/ofry/bmake/arch.c:964:19: warning: overflow in conversion from 'long long unsigned int' to 'long int' changes value from '18446744073709551556' to '-60' [-Woverflow]
  964 |   if (fseek(arch, -sizeof(struct ar_hdr), SEEK_CUR) != 0) {
      |                   ^~~~~~~~~~~~~~~~~~~~~~
gcc -c -g -O2 -I. -I/home/ofry/bmake -DHAVE_CONFIG_H -I/home/ofry/bmake/missing -DNEED_HOST_CDEFS_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -DNO_REGEX -o buf.o /home/ofry/bmake/buf.c
In file included from C:/msys64/home/ofry/bmake/make.h:98,
                 from C:/msys64/home/ofry/bmake/buf.c:90:
C:/msys64/home/ofry/bmake/headers-mingw/stdlib.h:52:1: warning: useless storage class specifier in empty declaration
   52 | };
      | ^
gcc -c -g -O2 -I. -I/home/ofry/bmake -DHAVE_CONFIG_H -I/home/ofry/bmake/missing -DNEED_HOST_CDEFS_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -DNO_REGEX -o compat.o /home/ofry/bmake/compat.c
In file included from C:/msys64/home/ofry/bmake/make.h:98,
                 from C:/msys64/home/ofry/bmake/compat.c:119:
C:/msys64/home/ofry/bmake/headers-mingw/stdlib.h:52:1: warning: useless storage class specifier in empty declaration
   52 | };
      | ^
In file included from C:/msys64/home/ofry/bmake/compat.c:119:
C:/msys64/home/ofry/bmake/compat.c: In function 'CompatInterrupt':
C:/msys64/home/ofry/bmake/make.h:559:26: warning: implicit declaration of function 'killpg'; did you mean 'kill'? [-Wimplicit-function-declaration]
  559 | #define KILLPG(pid, sig) killpg((pid), (sig))
      |                          ^~~~~~
C:/msys64/home/ofry/bmake/compat.c:195:2: note: in expansion of macro 'KILLPG'
  195 |  KILLPG(compatChild, signo);
      |  ^~~~~~
In file included from C:/msys64/home/ofry/bmake/pathnames.h:36,
                 from C:/msys64/home/ofry/bmake/compat.c:124:
C:/msys64/home/ofry/bmake/compat.c: In function 'CompatRunCommand':
./config.h:642:15: warning: implicit declaration of function 'fork' [-Wimplicit-function-declaration]
  642 | #define vfork fork
      |               ^~~~
C:/msys64/home/ofry/bmake/make.h:455:40: note: in expansion of macro 'vfork'
  455 | #define vFork() ((getpid() == myPid) ? vfork() : fork())
      |                                        ^~~~~
C:/msys64/home/ofry/bmake/compat.c:392:26: note: in expansion of macro 'vFork'
  392 |     compatChild = cpid = vFork();
      |                          ^~~~~
C:/msys64/home/ofry/bmake/compat.c:427:20: warning: implicit declaration of function 'wait'; did you mean 'cwait'? [-Wimplicit-function-declaration]
  427 |  while ((retstat = wait(&reason)) != cpid) {
      |                    ^~~~
      |                    cwait
gcc -c -g -O2 -I. -I/home/ofry/bmake -DHAVE_CONFIG_H -I/home/ofry/bmake/missing -DNEED_HOST_CDEFS_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -DNO_REGEX -o cond.o /home/ofry/bmake/cond.c
In file included from C:/msys64/home/ofry/bmake/make.h:98,
                 from C:/msys64/home/ofry/bmake/cond.c:98:
C:/msys64/home/ofry/bmake/headers-mingw/stdlib.h:52:1: warning: useless storage class specifier in empty declaration
   52 | };
      | ^
gcc -c -g -O2 -I. -I/home/ofry/bmake -DHAVE_CONFIG_H -I/home/ofry/bmake/missing -DNEED_HOST_CDEFS_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -DNO_REGEX -o dir.o /home/ofry/bmake/dir.c
In file included from C:/msys64/home/ofry/bmake/make.h:98,
                 from C:/msys64/home/ofry/bmake/dir.c:148:
C:/msys64/home/ofry/bmake/headers-mingw/stdlib.h:52:1: warning: useless storage class specifier in empty declaration
   52 | };
      | ^
gcc -c -g -O2 -I. -I/home/ofry/bmake -DHAVE_CONFIG_H -I/home/ofry/bmake/missing -DNEED_HOST_CDEFS_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -DNO_REGEX -o for.o /home/ofry/bmake/for.c
In file included from C:/msys64/home/ofry/bmake/make.h:98,
                 from C:/msys64/home/ofry/bmake/for.c:58:
C:/msys64/home/ofry/bmake/headers-mingw/stdlib.h:52:1: warning: useless storage class specifier in empty declaration
   52 | };
      | ^
gcc -c -g -O2 -I. -I/home/ofry/bmake -DHAVE_CONFIG_H -I/home/ofry/bmake/missing -DNEED_HOST_CDEFS_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -DNO_REGEX -o getopt /home/ofry/bmake/getopt.c
gcc -c -g -O2 -I. -I/home/ofry/bmake -DHAVE_CONFIG_H -I/home/ofry/bmake/missing -DNEED_HOST_CDEFS_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -DNO_REGEX -o hash.o /home/ofry/bmake/hash.c
In file included from C:/msys64/home/ofry/bmake/make.h:98,
                 from C:/msys64/home/ofry/bmake/hash.c:93:
C:/msys64/home/ofry/bmake/headers-mingw/stdlib.h:52:1: warning: useless storage class specifier in empty declaration
   52 | };
      | ^
gcc -c -g -O2 -I. -I/home/ofry/bmake -DHAVE_CONFIG_H -I/home/ofry/bmake/missing -DNEED_HOST_CDEFS_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -DNO_REGEX -o job.o /home/ofry/bmake/job.c
In file included from C:/msys64/home/ofry/bmake/make.h:98,
                 from C:/msys64/home/ofry/bmake/job.c:178:
C:/msys64/home/ofry/bmake/headers-mingw/stdlib.h:52:1: warning: useless storage class specifier in empty declaration
   52 | };
      | ^
In file included from C:/msys64/home/ofry/bmake/job.c:178:
C:/msys64/home/ofry/bmake/job.c: In function 'JobCondPassSig':
C:/msys64/home/ofry/bmake/make.h:559:26: warning: implicit declaration of function 'killpg'; did you mean 'kill'? [-Wimplicit-function-declaration]
  559 | #define KILLPG(pid, sig) killpg((pid), (sig))
      |                          ^~~~~~
C:/msys64/home/ofry/bmake/make.h:559:26: note: in definition of macro 'KILLPG'
  559 | #define KILLPG(pid, sig) killpg((pid), (sig))
      |                          ^~~~~~
In file included from C:/msys64/home/ofry/bmake/pathnames.h:36,
                 from C:/msys64/home/ofry/bmake/job.c:182:
C:/msys64/home/ofry/bmake/job.c: In function 'JobExec':
./config.h:642:15: warning: implicit declaration of function 'fork' [-Wimplicit-function-declaration]
  642 | #define vfork fork
      |               ^~~~
./config.h:642:15: note: in definition of macro 'vfork'
  642 | #define vfork fork
      |               ^~~~
C:/msys64/home/ofry/bmake/job.c:1370:12: note: in expansion of macro 'vFork'
 1370 |     cpid = vFork();
      |            ^~~~~
gcc -c -g -O2 -I. -I/home/ofry/bmake -DHAVE_CONFIG_H -I/home/ofry/bmake/missing -DNEED_HOST_CDEFS_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -DNO_REGEX -o make.o /home/ofry/bmake/make.c
In file included from C:/msys64/home/ofry/bmake/make.h:98,
                 from C:/msys64/home/ofry/bmake/make.c:118:
C:/msys64/home/ofry/bmake/headers-mingw/stdlib.h:52:1: warning: useless storage class specifier in empty declaration
   52 | };
      | ^
gcc -c -g -O2 -I. -I/home/ofry/bmake -DHAVE_CONFIG_H -I/home/ofry/bmake/missing -DNEED_HOST_CDEFS_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -DNO_REGEX -o make_malloc.o /home/ofry/bmake/make_malloc.c
In file included from C:/msys64/home/ofry/bmake/make.h:98,
                 from C:/msys64/home/ofry/bmake/make_malloc.c:39:
C:/msys64/home/ofry/bmake/headers-mingw/stdlib.h:52:1: warning: useless storage class specifier in empty declaration
   52 | };
      | ^
gcc -c -g -O2 -I. -I/home/ofry/bmake -DHAVE_CONFIG_H -I/home/ofry/bmake/missing -DNEED_HOST_CDEFS_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -DNO_REGEX -o metachar.o /home/ofry/bmake/metachar.c
gcc -c -g -O2 -I. -I/home/ofry/bmake -DHAVE_CONFIG_H -I/home/ofry/bmake/missing -DNEED_HOST_CDEFS_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -DNO_REGEX -o parse.o /home/ofry/bmake/parse.c
In file included from C:/msys64/home/ofry/bmake/make.h:98,
                 from C:/msys64/home/ofry/bmake/parse.c:137:
C:/msys64/home/ofry/bmake/headers-mingw/stdlib.h:52:1: warning: useless storage class specifier in empty declaration
   52 | };
      | ^
gcc -c -g -O2 -I. -I/home/ofry/bmake -DHAVE_CONFIG_H -I/home/ofry/bmake/missing -DNEED_HOST_CDEFS_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -DNO_REGEX -o sigcompat.o /home/ofry/bmake/sigcompat.c
gcc -c -g -O2 -I. -I/home/ofry/bmake -DHAVE_CONFIG_H -I/home/ofry/bmake/missing -DNEED_HOST_CDEFS_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -DNO_REGEX -o str.o /home/ofry/bmake/str.c
In file included from C:/msys64/home/ofry/bmake/make.h:98,
                 from C:/msys64/home/ofry/bmake/str.c:84:
C:/msys64/home/ofry/bmake/headers-mingw/stdlib.h:52:1: warning: useless storage class specifier in empty declaration
   52 | };
      | ^
gcc -c -g -O2 -I. -I/home/ofry/bmake -DHAVE_CONFIG_H -I/home/ofry/bmake/missing -DNEED_HOST_CDEFS_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -DNO_REGEX -o strlist.o /home/ofry/bmake/strlist.c
gcc -c -g -O2 -I. -I/home/ofry/bmake -DHAVE_CONFIG_H -I/home/ofry/bmake/missing -DNEED_HOST_CDEFS_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -DNO_REGEX -o suff.o /home/ofry/bmake/suff.c
In file included from C:/msys64/home/ofry/bmake/make.h:98,
                 from C:/msys64/home/ofry/bmake/suff.c:140:
C:/msys64/home/ofry/bmake/headers-mingw/stdlib.h:52:1: warning: useless storage class specifier in empty declaration
   52 | };
      | ^
C:/msys64/home/ofry/bmake/suff.c: In function 'SuffPrintSuff':
C:/msys64/home/ofry/bmake/suff.c:2626:19: warning: implicit declaration of function 'ffs' [-Wimplicit-function-declaration]
 2626 |      flag = 1 << (ffs(flags) - 1);
      |                   ^~~
gcc -c -g -O2 -I. -I/home/ofry/bmake -DHAVE_CONFIG_H -I/home/ofry/bmake/missing -DNEED_HOST_CDEFS_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -DNO_REGEX -o targ.o /home/ofry/bmake/targ.c
In file included from C:/msys64/home/ofry/bmake/make.h:98,
                 from C:/msys64/home/ofry/bmake/targ.c:135:
C:/msys64/home/ofry/bmake/headers-mingw/stdlib.h:52:1: warning: useless storage class specifier in empty declaration
   52 | };
      | ^
C:/msys64/home/ofry/bmake/targ.c: In function 'Targ_PrintType':
C:/msys64/home/ofry/bmake/targ.c:578:15: warning: implicit declaration of function 'ffs' [-Wimplicit-function-declaration]
  578 |  tbit = 1 << (ffs(type) - 1);
      |               ^~~
gcc -c -g -O2 -I. -I/home/ofry/bmake -DHAVE_CONFIG_H -I/home/ofry/bmake/missing -DNEED_HOST_CDEFS_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -DNO_REGEX -o trace.o /home/ofry/bmake/trace.c
In file included from C:/msys64/home/ofry/bmake/make.h:98,
                 from C:/msys64/home/ofry/bmake/trace.c:63:
C:/msys64/home/ofry/bmake/headers-mingw/stdlib.h:52:1: warning: useless storage class specifier in empty declaration
   52 | };
      | ^
gcc -c -g -O2 -I. -I/home/ofry/bmake -DHAVE_CONFIG_H -I/home/ofry/bmake/missing -DNEED_HOST_CDEFS_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -DNO_REGEX -o var.o /home/ofry/bmake/var.c
In file included from C:/msys64/home/ofry/bmake/make.h:98,
                 from C:/msys64/home/ofry/bmake/var.c:139:
C:/msys64/home/ofry/bmake/headers-mingw/stdlib.h:52:1: warning: useless storage class specifier in empty declaration
   52 | };
      | ^
gcc -c -g -O2 -I. -I/home/ofry/bmake -DHAVE_CONFIG_H -I/home/ofry/bmake/missing -DNEED_HOST_CDEFS_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -DNO_REGEX -o util.o /home/ofry/bmake/util.c
In file included from C:/msys64/home/ofry/bmake/make.h:98,
                 from C:/msys64/home/ofry/bmake/util.c:18:
C:/msys64/home/ofry/bmake/headers-mingw/stdlib.h:52:1: warning: useless storage class specifier in empty declaration
   52 | };
      | ^
C:/msys64/home/ofry/bmake/util.c:460:7: warning: conflicting types for built-in function 'fork'; expected 'int(void)' [-Wbuiltin-declaration-mismatch]
  460 | pid_t fork(void)
      |       ^~~~
C:/msys64/home/ofry/bmake/util.c: In function 'fork':
C:/msys64/home/ofry/bmake/util.c:483:8: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
  483 |   pi = (DWORD)process_info.ClientId.UniqueProcess;
      |        ^
C:/msys64/home/ofry/bmake/util.c:484:8: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
  484 |   ti = (DWORD)process_info.ClientId.UniqueThread;
      |        ^
C:/msys64/home/ofry/bmake/util.c: In function '__srandom':
C:/msys64/home/ofry/bmake/util.c:1064:12: warning: implicit declaration of function '__srandom_r'; did you mean '__srandom'? [-Wimplicit-function-declaration]
 1064 |     (void) __srandom_r (x, &unsafe_state);
      |            ^~~~~~~~~~~
      |            __srandom
C:/msys64/home/ofry/bmake/util.c: In function '__initstate':
C:/msys64/home/ofry/bmake/util.c:1101:11: warning: implicit declaration of function '__initstate_r'; did you mean '__initstate'? [-Wimplicit-function-declaration]
 1101 |     ret = __initstate_r (seed, arg_state, n, &unsafe_state);
      |           ^~~~~~~~~~~~~
      |           __initstate
C:/msys64/home/ofry/bmake/util.c: In function '__setstate':
C:/msys64/home/ofry/bmake/util.c:1131:9: warning: implicit declaration of function '__setstate_r'; did you mean '__setstate'? [-Wimplicit-function-declaration]
 1131 |     if (__setstate_r (arg_state, &unsafe_state) < 0)
      |         ^~~~~~~~~~~~
      |         __setstate
C:/msys64/home/ofry/bmake/util.c: In function '__random':
C:/msys64/home/ofry/bmake/util.c:1163:12: warning: implicit declaration of function '__random_r'; did you mean '__random'? [-Wimplicit-function-declaration]
 1163 |     (void) __random_r (&unsafe_state, &retval);
      |            ^~~~~~~~~~
      |            __random
gcc -c -g -O2 -I. -I/home/ofry/bmake -DHAVE_CONFIG_H -I/home/ofry/bmake/missing -DNEED_HOST_CDEFS_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -DNO_REGEX -o lstAppend.o /home/ofry/bmake/lst.lib/lstAppend.c
gcc -c -g -O2 -I. -I/home/ofry/bmake -DHAVE_CONFIG_H -I/home/ofry/bmake/missing -DNEED_HOST_CDEFS_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -DNO_REGEX -o lstDupl.o /home/ofry/bmake/lst.lib/lstDupl.c
gcc -c -g -O2 -I. -I/home/ofry/bmake -DHAVE_CONFIG_H -I/home/ofry/bmake/missing -DNEED_HOST_CDEFS_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -DNO_REGEX -o lstInit.o /home/ofry/bmake/lst.lib/lstInit.c
gcc -c -g -O2 -I. -I/home/ofry/bmake -DHAVE_CONFIG_H -I/home/ofry/bmake/missing -DNEED_HOST_CDEFS_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -DNO_REGEX -o lstOpen.o /home/ofry/bmake/lst.lib/lstOpen.c
gcc -c -g -O2 -I. -I/home/ofry/bmake -DHAVE_CONFIG_H -I/home/ofry/bmake/missing -DNEED_HOST_CDEFS_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -DNO_REGEX -o lstAtEnd.o /home/ofry/bmake/lst.lib/lstAtEnd.c
gcc -c -g -O2 -I. -I/home/ofry/bmake -DHAVE_CONFIG_H -I/home/ofry/bmake/missing -DNEED_HOST_CDEFS_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -DNO_REGEX -o lstEnQueue.o /home/ofry/bmake/lst.lib/lstEnQueue.c
gcc -c -g -O2 -I. -I/home/ofry/bmake -DHAVE_CONFIG_H -I/home/ofry/bmake/missing -DNEED_HOST_CDEFS_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -DNO_REGEX -o lstInsert.o /home/ofry/bmake/lst.lib/lstInsert.c
gcc -c -g -O2 -I. -I/home/ofry/bmake -DHAVE_CONFIG_H -I/home/ofry/bmake/missing -DNEED_HOST_CDEFS_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -DNO_REGEX -o lstAtFront.o /home/ofry/bmake/lst.lib/lstAtFront.c
gcc -c -g -O2 -I. -I/home/ofry/bmake -DHAVE_CONFIG_H -I/home/ofry/bmake/missing -DNEED_HOST_CDEFS_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -DNO_REGEX -o lstIsAtEnd.o /home/ofry/bmake/lst.lib/lstIsAtEnd.c
gcc -c -g -O2 -I. -I/home/ofry/bmake -DHAVE_CONFIG_H -I/home/ofry/bmake/missing -DNEED_HOST_CDEFS_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -DNO_REGEX -o lstClose.o /home/ofry/bmake/lst.lib/lstClose.c
gcc -c -g -O2 -I. -I/home/ofry/bmake -DHAVE_CONFIG_H -I/home/ofry/bmake/missing -DNEED_HOST_CDEFS_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -DNO_REGEX -o lstFind.o /home/ofry/bmake/lst.lib/lstFind.c
gcc -c -g -O2 -I. -I/home/ofry/bmake -DHAVE_CONFIG_H -I/home/ofry/bmake/missing -DNEED_HOST_CDEFS_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -DNO_REGEX -o lstIsEmpty.o /home/ofry/bmake/lst.lib/lstIsEmpty.c
gcc -c -g -O2 -I. -I/home/ofry/bmake -DHAVE_CONFIG_H -I/home/ofry/bmake/missing -DNEED_HOST_CDEFS_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -DNO_REGEX -o lstRemove.o /home/ofry/bmake/lst.lib/lstRemove.c
gcc -c -g -O2 -I. -I/home/ofry/bmake -DHAVE_CONFIG_H -I/home/ofry/bmake/missing -DNEED_HOST_CDEFS_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -DNO_REGEX -o lstConcat.o /home/ofry/bmake/lst.lib/lstConcat.c
gcc -c -g -O2 -I. -I/home/ofry/bmake -DHAVE_CONFIG_H -I/home/ofry/bmake/missing -DNEED_HOST_CDEFS_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -DNO_REGEX -o lstFindFrom.o /home/ofry/bmake/lst.lib/lstFindFrom.c
gcc -c -g -O2 -I. -I/home/ofry/bmake -DHAVE_CONFIG_H -I/home/ofry/bmake/missing -DNEED_HOST_CDEFS_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -DNO_REGEX -o lstLast.o /home/ofry/bmake/lst.lib/lstLast.c
gcc -c -g -O2 -I. -I/home/ofry/bmake -DHAVE_CONFIG_H -I/home/ofry/bmake/missing -DNEED_HOST_CDEFS_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -DNO_REGEX -o lstReplace.o /home/ofry/bmake/lst.lib/lstReplace.c
gcc -c -g -O2 -I. -I/home/ofry/bmake -DHAVE_CONFIG_H -I/home/ofry/bmake/missing -DNEED_HOST_CDEFS_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -DNO_REGEX -o lstFirst.o /home/ofry/bmake/lst.lib/lstFirst.c
gcc -c -g -O2 -I. -I/home/ofry/bmake -DHAVE_CONFIG_H -I/home/ofry/bmake/missing -DNEED_HOST_CDEFS_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -DNO_REGEX -o lstDatum.o /home/ofry/bmake/lst.lib/lstDatum.c
gcc -c -g -O2 -I. -I/home/ofry/bmake -DHAVE_CONFIG_H -I/home/ofry/bmake/missing -DNEED_HOST_CDEFS_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -DNO_REGEX -o lstForEach.o /home/ofry/bmake/lst.lib/lstForEach.c
gcc -c -g -O2 -I. -I/home/ofry/bmake -DHAVE_CONFIG_H -I/home/ofry/bmake/missing -DNEED_HOST_CDEFS_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -DNO_REGEX -o lstMember.o /home/ofry/bmake/lst.lib/lstMember.c
gcc -c -g -O2 -I. -I/home/ofry/bmake -DHAVE_CONFIG_H -I/home/ofry/bmake/missing -DNEED_HOST_CDEFS_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -DNO_REGEX -o lstSucc.o /home/ofry/bmake/lst.lib/lstSucc.c
gcc -c -g -O2 -I. -I/home/ofry/bmake -DHAVE_CONFIG_H -I/home/ofry/bmake/missing -DNEED_HOST_CDEFS_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -DNO_REGEX -o lstDeQueue.o /home/ofry/bmake/lst.lib/lstDeQueue.c
gcc -c -g -O2 -I. -I/home/ofry/bmake -DHAVE_CONFIG_H -I/home/ofry/bmake/missing -DNEED_HOST_CDEFS_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -DNO_REGEX -o lstForEachFrom.o /home/ofry/bmake/lst.lib/lstForEachFrom.c
gcc -c -g -O2 -I. -I/home/ofry/bmake -DHAVE_CONFIG_H -I/home/ofry/bmake/missing -DNEED_HOST_CDEFS_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -DNO_REGEX -o lstDestroy.o /home/ofry/bmake/lst.lib/lstDestroy.c
gcc -c -g -O2 -I. -I/home/ofry/bmake -DHAVE_CONFIG_H -I/home/ofry/bmake/missing -DNEED_HOST_CDEFS_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -DNO_REGEX -o lstNext.o /home/ofry/bmake/lst.lib/lstNext.c
gcc -c -g -O2 -I. -I/home/ofry/bmake -DHAVE_CONFIG_H -I/home/ofry/bmake/missing -DNEED_HOST_CDEFS_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -DNO_REGEX -o lstPrev.o /home/ofry/bmake/lst.lib/lstPrev.c
gcc -c -g -O2 -I. -I/home/ofry/bmake -DHAVE_CONFIG_H -I/home/ofry/bmake/missing -DNEED_HOST_CDEFS_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -DNO_REGEX -o realpath.o /home/ofry/bmake/realpath.c
gcc -c -g -O2 -I. -I/home/ofry/bmake -DHAVE_CONFIG_H -I/home/ofry/bmake/missing -DNEED_HOST_CDEFS_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -DNO_REGEX -o stresep.o /home/ofry/bmake/stresep.c
gcc -c -g -O2 -I. -I/home/ofry/bmake -DHAVE_CONFIG_H -I/home/ofry/bmake/missing -DNEED_HOST_CDEFS_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -DNO_REGEX -o strlcpy.o /home/ofry/bmake/strlcpy.c
gcc -c -g -O2 -I. -I/home/ofry/bmake -DHAVE_CONFIG_H -I/home/ofry/bmake/missing -DNEED_HOST_CDEFS_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -DNO_REGEX -o meta.o /home/ofry/bmake/meta.c
In file included from C:/msys64/home/ofry/bmake/make.h:98,
                 from C:/msys64/home/ofry/bmake/meta.c:57:
C:/msys64/home/ofry/bmake/headers-mingw/stdlib.h:52:1: warning: useless storage class specifier in empty declaration
   52 | };
      | ^
C:/msys64/home/ofry/bmake/meta.c: In function 'meta_create':
C:/msys64/home/ofry/bmake/meta.c:528:2: warning: implicit declaration of function 'err' [-Wimplicit-function-declaration]
  528 |  err(1, "Could not open meta file '%s'", fname);
      |  ^~~
C:/msys64/home/ofry/bmake/meta.c: In function 'meta_oodate':
C:/msys64/home/ofry/bmake/meta.c:1129:3: warning: implicit declaration of function 'warnx' [-Wimplicit-function-declaration]
 1129 |   warnx("%s: %d: line truncated at %u", fname, lineno, x);
      |   ^~~~~
C:/msys64/home/ofry/bmake/meta.c:110:23: warning: implicit declaration of function 'stresep'; did you mean 'strsep'? [-Wimplicit-function-declaration]
  110 | # define strsep(s, d) stresep((s), (d), 0)
      |                       ^~~~~~~
C:/msys64/home/ofry/bmake/meta.c:1153:6: note: in expansion of macro 'strsep'
 1153 |      strsep(&p, " ");
      |      ^~~~~~
C:/msys64/home/ofry/bmake/meta.c:1216:27: warning: comparison between pointer and integer
 1216 |       if (strsep(&p, " ") == NULL)
      |                           ^~
C:/msys64/home/ofry/bmake/meta.c:1278:27: warning: comparison between pointer and integer
 1278 |       if (strsep(&p, " ") == NULL)
      |                           ^~
C:/msys64/home/ofry/bmake/meta.c:1323:27: warning: comparison between pointer and integer
 1323 |       if (strsep(&p, " ") == NULL)
      |                           ^~
gcc -o bmake main.o meta.o arch.o buf.o compat.o cond.o dir.o for.o getopt hash.o job.o make.o make_malloc.o metachar.o parse.o sigcompat.o str.o strlist.o suff.o targ.o trace.o var.o util.o lstAppend.o lstDupl.o lstInit.o lstOpen.o lstAtEnd.o lstEnQueue.o lstInsert.o lstAtFront.o lstIsAtEnd.o lstClose.o lstFind.o lstIsEmpty.o lstRemove.o lstConcat.o lstFindFrom.o lstLast.o lstReplace.o lstFirst.o lstDatum.o lstForEach.o lstMember.o lstSucc.o lstDeQueue.o lstForEachFrom.o lstDestroy.o lstNext.o lstPrev.o realpath.o stresep.o strlcpy.o -lws2_32 -lwsock32
./boot-strap: строка 389:  7478 Segmentation fault      MAKESYSPATH=$mksrc SRCTOP=$Mydir OBJTOP=$objdir MAKEOBJDIR='${.CURDIR:S,${SRCTOP:tA},${OBJTOP:tA},}' ${BMAKE:-$objdir/bmake} -f $Mydir/Makefile "$@"

@ofry
Copy link
Contributor Author

ofry commented Dec 19, 2019

GDB log:

ofry@games MINGW64 ~/bmake
$ gdb ./bmake
GNU gdb (GDB) 8.3.1
Copyright (C) 2019 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-w64-mingw32".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./bmake...
(gdb) run
Starting program: C:\msys64\home\ofry\bmake\bmake.exe

Program received signal SIGSEGV, Segmentation fault.
0x0000000000409c71 in DirMatchFiles (pattern=pattern@entry=0x42c9bf "sys.mk",
    p=0x0, expansions=expansions@entry=0x8f9fe0)
    at C:/msys64/home/ofry/bmake/dir.c:619
619         isDot = (*p->name == '.' && p->name[1] == '\0');
(gdb) bt full
#0  0x0000000000409c71 in DirMatchFiles (
    pattern=pattern@entry=0x42c9bf "sys.mk", p=0x0,
    expansions=expansions@entry=0x8f9fe0)
    at C:/msys64/home/ofry/bmake/dir.c:619
        search = {tablePtr = 0x30, nextIndex = 4430528,
          hashEntryPtr = 0x42c3da}
        entry = <optimized out>
        isDot = <optimized out>
#1  0x000000000040b1f2 in Dir_Expand (word=0x42c9bf "sys.mk", path=0x8f4f60,
    expansions=0x8f9fe0) at C:/msys64/home/ofry/bmake/dir.c:916
        cp = <optimized out>
#2  0x000000000042a27b in main (argc=1, argv=<optimized out>)
    at C:/msys64/home/ofry/bmake/main.c:1384
        ln = <optimized out>
        outOfDate = <optimized out>
        sb = {st_dev = 2, st_ino = 0, st_mode = 16895, st_nlink = 1,
          st_uid = 0, st_gid = 0, st_rdev = 2, st_size = 0,
          st_atime = 1576727635, st_mtime = 1576727635, st_ctime = 1570778959}
        sa = {st_dev = 2, st_ino = 0, st_mode = 16895, st_nlink = 1,
          st_uid = 0, st_gid = 0, st_rdev = 2, st_size = 0,
          st_atime = 1576727635, st_mtime = 1576727635, st_ctime = 1570778959}
        p1 = 0x0
        path = <optimized out>
        mdpath = "\001\000\000\001\000\000\000\000▒\001\004▒\000\000\000\000▒\003", '\000' <repeats 14 times>, " ▒b\000\000\000\000\000IƢ▒\001\000\000\000\004\000\000\000\177\000\000\000▒\004\000\000\000\000\000\000▒\001\000\000\000\000\000\000 ▒b\000\000\000\000\000J\000\000\000\000\000\000\000▒\002▒\000\000\000\000\000▒\001\000\000\000\000\000\000\177\000\000\000\000\000\000\000\004\000\000\000\000\000\000\000~\000\000\000\000\000\000\000▒\001\004▒\000\000\000\000.2▒▒▒\177\000\000\002\000\004\006\000\000\000\000\070\006\000\000\000\000\000\000P\027▒", '\000' <repeats 13 times>, "~\000\000\000\000\000\000\000~\000\000\000\000\000\000\000\000\026▒", '\000' <repeats 14 times>...
        machine = <optimized out>
        machine_arch = <optimized out>
        syspath = <optimized out>
        sysMkPath = 0x8f9fe0
        cp = <optimized out>
        start = <optimized out>
        defsyspath = "C\000/msys64/share/mk"
        found_path = "\000\000\000\000\000\000\000\000▒\026▒\000\001\000\000\000▒▒b\000\000\000\000\000@\000\000\000\000\000\000\000\060▒b\000\000\000\000\000\020\027▒\000\000\000\000\000P\001b\000\000\000\000\000▒\035\000\000\000\000\000\000\177\000\000\000\000\000\000\000▒\001\004▒\001\000\000\000p▒▒▒-\000\000\000▒\001\004▒\000\000\000\000▒\001\004▒\000\000\000\000H\000\000\000\000\000\000\000\006\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000x\000\000\000\000\000\000\000▒Ƣ▒▒\177\000\000x\000\000\000\000\000\000\000▒\002▒\000\000\000\000\000c\001\000P\000\000\000\000\000\000▒\000\000\000\000\000\006\000\000\000\000\000\000\000x\000\000\000\000\000\000\000▒\027▒\000\000\000\000\000"...
        rightnow = {tv_sec = 1576727838, tv_usec = 667055}
        utsname = {
          nodename = "localhost\000\000\000\000\000\000\000▒\026▒\000\000\000\000\000\000\000▒", '\000' <repeats 13 times>, "\020\020▒▒▒\177\000\000\000\000▒\000\000\000\000\000\062;▒▒▒\177\000\000\000\000▒", '\000' <repeats 15 times>, "▒\000\000\000\000\000c\000\000P", '\000' <repeats 38 times>, "▒\000\000\000\000\000\004\000\a\003▒\177\000\000$", '\000' <repeats 17 times>, "▒\000\000\000\000\000c\001\000P\000\000\000\000b\000\000@\000\000\000\000`\000\000@\000\000\000\000`\027▒\000\000\000\000\000"...,
          sysname = "MINGW32_NT-6.3\000\000\003\000\000\000\000\000\000\000𛪿▒\177\000\000\000\000▒\000\000\000\000\000c\001\000P\000\000\000\000\000\000▒\000\000\000\000\000\060\000\000\000\000\000\000\000\000\000▒\000\000\000\000\000c\000\000P", '\000' <repeats 32 times>, "▒\177", '\000' <repeats 66 times>, "H", '\000' <repeats 15 times>, "p\004\000\000\000\000\000\000"...,
          release = "Windows 6.3\000▒\177", '\000' <repeats 18 times>, "\033\000\020\000▒\037\000\000\063\000\000\000\000\000\000\000\060\000\000\000\000\000\000\000x▒#\000\000\000\000\000\020▒#\000\000\000\000\000J2ļ▒\177", '\000' <repeats 26 times>, "\060\000\000\000\000\000\000\000\032\002", '\000' <repeats 16 times>, "@\000\000\000\000\000▒\000\000\000\000\000\000\001\000 \027\000\000\000\000\000▒_▒▒▒\177\000\000\000\000\000\000\000\000\000\000\020\020▒▒▒\177\000\000p>B", '\000' <repeats 21 times>...,
          version = "\000\000@\000\000\000\000\000\000 \027\000\000\000\000\000\000\000\000\001\000\000\000\000p\000r\000\000\000\000\000\070▒#\000\000\000\000\000\\\000D\000e\000v\000i\000c\000e\000\\\000H\000a\000r\000d\000d\000i\000s\000k\000V\000o\000l\000u\000m\000e\000\064\000\\\000m\000s\000y\000s\000\000\000▒\000\000\000\000\000▒\023▒\000\000\000\000\000\000\001\000\000\000\000\000\000@▒▒▒▒\177\000\000k\000e\000\\\000b\000m\000a\000k\000e\000.\000e\000x\000e\000\000\000▒▒▒\177\000\000\000\000▒\000\000\000\000\000▒\023▒\000\000\000\000\000\000\001\000\000\000\000\000\000@▒▒▒▒\177\000\000▒\022▒\000\000\000\000\000"...,
          machine = "x86_64\000\000a\000\000P\000\000\000\000\000\000▒\000\000\000\000\000\030\000\000\000\000\000\000\000\000\000▒\000\000\000\000\000\023\000\a\024\000\000\000\000\000\001\000\000\000\000\000\000▒8▒▒▒\177\000\000\000\000▒", '\000' <repeats 21 times>, "▒=▒▒▒\177\000\000\001\000▒\000\000\000\000\000\000\001\000\000\000\000\000\000▒\022▒", '\000' <repeats 13 times>, "▒\022▒\000\000\000\000\000▒\031▒▒▒\177\000\000\000\000▒\000\000\000\000\000▒=▒▒▒\177\000\000\000\000▒\000\000\000\000\000\020\000\000\000\000\000\000\000\002\000\000\000\000\000\000\000▒CB", '\000' <repeats 21 times>...}

@ofry
Copy link
Contributor Author

ofry commented Dec 19, 2019

@Biswa96 I making MinGW package, not MSYS2. So it should build in MinGW environment. Now I'm porting bmake package in MinGW. My code repo: https://github.com/ofry/bmake/commits/port-20181221

@Biswa96
Copy link
Member

Biswa96 commented Dec 19, 2019

It may not be possible to "port" bmake to mingw because it uses posix function like fork etc.

@StarWolf3000
Copy link
Contributor

I know @oscarfv alread mentioned it, but you're better off with building it on Visual Studio, as most POSIX functionality isn't available on MINGW (and it will never be, it's not the goal of MINGW), and BSD Make and the toolchain you want to use (the mentioned libs) don't not serve any purpose on Windows (besides being unable to compile properly).

@ofry
Copy link
Contributor Author

ofry commented Dec 19, 2019

@Biswa96 I think I already solved this. See the source code in my branch, I included such POSIX functions into it already.

@StarWolf3000
Copy link
Contributor

Then it should not segfault when invoking with no arguments given, which is clearly does (it did too on my end after compiling your code).

@ofry
Copy link
Contributor Author

ofry commented Dec 19, 2019

@StarWolf3000 I already fixed that segfault. You should fetch latest commit :)

Current state:

ofry@games MINGW64 ~/bmake
$ ./bmake
C:\msys64\home\ofry\bmake\bmake.exe: no system rules (sys.mk).

C:\msys64\home\ofry\bmake\bmake.exe: stopped in C:/msys64/home/ofry/bmake

@StarWolf3000
Copy link
Contributor

If that's the case, then you know what your next steps are:

  1. Provide a PKGBUILD and optional patches
  2. Do a PR

@ofry
Copy link
Contributor Author

ofry commented Jan 3, 2020

@Biswa96 I made new commit in my branch. Now Cmd_Exec() function should work properly.

But still need additional porting:

ofry@games MINGW64 ~/bmake
$ ./boot-strap
NOTE: default prefix=/home/ofry/mingw64_nt-6.3-96003-x86_64
configure: loading site script /mingw64/etc/config.site
checking for gcc... gcc
checking for C compiler default output file name... a.exe
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... .exe
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking whether gcc needs -traditional... no
checking for a BSD-compatible install... /usr/bin/install -c
Using: BMAKE_PATH_MAX=1024
checking for ANSI C header files... (cached) yes
checking for sys/wait.h that is POSIX.1 compatible... no
checking for dirent.h that defines DIR... yes
checking for library containing opendir... none required
checking sys/param.h usability... yes
checking sys/param.h presence... yes
checking for sys/param.h... yes
checking for sys/sysctl.h... no
checking ar.h usability... no
checking ar.h presence... no
checking for ar.h... no
checking err.h usability... no
checking err.h presence... no
checking for err.h... no
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking libgen.h usability... yes
checking libgen.h presence... yes
checking for libgen.h... yes
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking paths.h usability... no
checking paths.h presence... no
checking for paths.h... no
checking poll.h usability... no
checking poll.h presence... no
checking for poll.h... no
checking ranlib.h usability... no
checking ranlib.h presence... no
checking for ranlib.h... no
checking for string.h... (cached) yes
checking sys/mman.h usability... no
checking sys/mman.h presence... no
checking for sys/mman.h... no
checking sys/resource.h usability... no
checking sys/resource.h presence... no
checking for sys/resource.h... no
checking sys/select.h usability... no
checking sys/select.h presence... no
checking for sys/select.h... no
checking sys/socket.h usability... no
checking sys/socket.h presence... no
checking for sys/socket.h... no
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking sys/uio.h usability... no
checking sys/uio.h presence... no
checking for sys/uio.h... no
checking sys/utsname.h usability... no
checking sys/utsname.h presence... no
checking for sys/utsname.h... no
checking for sys/wait.h... (cached) no
checking for unistd.h... (cached) yes
checking utime.h usability... yes
checking utime.h presence... yes
checking for utime.h... yes
checking sys/cdefs.h usability... yes
checking sys/cdefs.h presence... yes
checking for sys/cdefs.h... yes
checking whether sys/cdefs.h is compatible... no
checking for __attribute__... yes
checking whether byte ordering is bigendian... no
checking for an ANSI C-conforming const... yes
checking for mode_t... yes
checking for off_t... yes
checking for pid_t... yes
checking for size_t... yes
checking for int32_t... no
checking for uint32_t... yes
checking whether sys_siglist is declared... no
checking whether time.h and sys/time.h may both be included... yes
checking whether struct tm is in sys/time.h or time.h... time.h
checking return type of signal handlers... void
checking vfork.h usability... no
checking vfork.h presence... no
checking for vfork.h... no
checking for fork... no
checking for vfork... no
checking for vprintf... yes
checking for _doprnt... no
checking for wait3 that fills in rusage... no
checking for _Exit... yes
checking for atoll... yes
checking for canonicalize_file_name... no
checking for chown... no
checking for dup2... yes
checking for dup3... no
checking for endusershell... no
checking for err... no
checking for errx... no
checking for euidaccess... no
checking for faccessat... no
checking for fchdir... no
checking for fchmodat... no
checking for fchownat... no
checking for fcntl... no
checking for fdatasync... no
checking for fstatat... no
checking for fsync... no
checking for ftruncate... yes
checking for futimens... no
checking for getcwd... yes
checking for getdomainname... no
checking for getdtablesize... no
checking for getenv... yes
checking for getgroups... no
checking for gethostname... no
checking for getloadavg... no
checking for getlogin... yes
checking for getlogin_r... no
checking for getopt... yes
checking for getpass... no
checking for getppid... no
checking for getrusage... no
checking for getsubopt... no
checking for getusershell... no
checking for getwd... no
checking for grantpt... no
checking for group_member... no
checking for initstate... no
checking for initstate_r... no
checking for kill... no
checking for killpg... no
checking for lchmod... no
checking for lchown... no
checking for link... no
checking for linkat... no
checking for lstat... no
checking for mkdirat... no
checking for mkdtemp... no
checking for mkfifo... no
checking for mkfifoat... no
checking for mknod... no
checking for mknodat... no
checking for mkostemp... no
checking for mkostemps... no
checking for mkstemp... yes
checking for mkstemps... no
checking for mmap... no
checking for openat... no
checking for pipe... no
checking for pipe2... no
checking for poll... no
checking for posix_openpt... no
checking for pread... no
checking for pthread_sigmask... no
checking for ptsname... no
checking for ptsname_r... no
checking for putenv... yes
checking for pwrite... no
checking for qsort_r... no
checking for raise... yes
checking for random... no
checking for random_r... no
checking for readlink... no
checking for readlinkat... no
checking for reallocarray... no
checking for realpath... no
checking for rpmatch... no
checking for secure_getenv... no
checking for select... no
checking for setenv... no
checking for sethostname... no
checking for setpgid... no
checking for setpgrp... no
checking for setsid... no
checking for setstate... no
checking for setstate_r... no
checking for setusershell... no
checking for sigaction... no
checking for sigaddset... no
checking for sigdelset... no
checking for sigemptyset... no
checking for sigfillset... no
checking for sigismember... no
checking for signal... yes
checking for sigpending... no
checking for sigprocmask... no
checking for sigvec... no
checking for sleep... yes
checking for snprintf... yes
checking for srandom... no
checking for srandom_r... no
checking for strerror... yes
checking for strftime... yes
checking for strsep... no
checking for strtod... yes
checking for strtol... yes
checking for strtoll... yes
checking for strtoull... yes
checking for symlink... no
checking for symlinkat... no
checking for sysctl... no
checking for truncate... yes
checking for ttyname_r... no
checking for uname... no
checking for unlinkat... no
checking for unlockpt... no
checking for unsetenv... no
checking for usleep... yes
checking for utimensat... no
checking for vsnprintf... yes
checking for wait... no
checking for wait3... no
checking for wait4... no
checking for waitpid... no
checking for warn... no
checking for warnx... no
checking for realpath... (cached) no
checking for dirname... yes
checking for stresep... no
checking for strlcpy... no
checking for emalloc in -lutil... no
checking whether stat file-mode macros are broken... no
checking for struct stat.st_rdev... yes
checking if compiler supports __func__
checking if diff -u works... yes
checking for MACHINE & MACHINE_ARCH...
defaults: MACHINE=mingw64_nt-6.3-96003, MACHINE_ARCH=x86_64
Using: MACHINE=mingw64_nt-6.3-96003, MACHINE_ARCH=x86_64
Using: MKSRC=${srcdir}/mk
configure: creating ./config.status
config.status: creating makefile
config.status: creating Makefile.config
config.status: creating make-bootstrap.sh
config.status: creating unit-tests/Makefile
config.status: creating config.h
config.status: config.h is unchanged

You can now run

        sh ./make-bootstrap.sh

to produce a fully functional bmake.

gcc -c -g -O2 -I. -I/home/ofry/bmake -DHAVE_CONFIG_H -I/home/ofry/bmake/missing -DNEED_HOST_CDEFS_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -DNO_REGEX -DMAKE_VERSION="20181221" -DMACHINE="mingw64_nt-6.3-96003" -DMACHINE_ARCH="x86_64" -D_PATH_DEFSYSPATH="/home/ofry/mingw64_nt-6.3-96003-x86_64/share/mk" -o main.o /home/ofry/bmake/main.c
In file included from C:/msys64/home/ofry/bmake/main.c:151:
C:/msys64/home/ofry/bmake/headers-mingw/stdlib.h:52:1: warning: useless storage class specifier in empty declaration
   52 | };
      | ^
C:/msys64/home/ofry/bmake/main.c: In function 'PrintAddr':
C:/msys64/home/ofry/bmake/main.c:2111:20: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
 2111 |     printf("%lx ", (unsigned long) a);
      |                    ^
gcc -c -g -O2 -I. -I/home/ofry/bmake -DHAVE_CONFIG_H -I/home/ofry/bmake/missing -DNEED_HOST_CDEFS_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -DNO_REGEX -o arch.o /home/ofry/bmake/arch.c
In file included from C:/msys64/home/ofry/bmake/make.h:98,
                 from C:/msys64/home/ofry/bmake/arch.c:167:
C:/msys64/home/ofry/bmake/headers-mingw/stdlib.h:52:1: warning: useless storage class specifier in empty declaration
   52 | };
      | ^
C:/msys64/home/ofry/bmake/arch.c: In function 'ArchFindMember':
C:/msys64/home/ofry/bmake/arch.c:964:19: warning: overflow in conversion from 'long long unsigned int' to 'long int' changes value from '18446744073709551556' to '-60' [-Woverflow]
  964 |   if (fseek(arch, -sizeof(struct ar_hdr), SEEK_CUR) != 0) {
      |                   ^~~~~~~~~~~~~~~~~~~~~~
gcc -c -g -O2 -I. -I/home/ofry/bmake -DHAVE_CONFIG_H -I/home/ofry/bmake/missing -DNEED_HOST_CDEFS_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -DNO_REGEX -o buf.o /home/ofry/bmake/buf.c
In file included from C:/msys64/home/ofry/bmake/make.h:98,
                 from C:/msys64/home/ofry/bmake/buf.c:90:
C:/msys64/home/ofry/bmake/headers-mingw/stdlib.h:52:1: warning: useless storage class specifier in empty declaration
   52 | };
      | ^
gcc -c -g -O2 -I. -I/home/ofry/bmake -DHAVE_CONFIG_H -I/home/ofry/bmake/missing -DNEED_HOST_CDEFS_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -DNO_REGEX -o compat.o /home/ofry/bmake/compat.c
In file included from C:/msys64/home/ofry/bmake/make.h:98,
                 from C:/msys64/home/ofry/bmake/compat.c:119:
C:/msys64/home/ofry/bmake/headers-mingw/stdlib.h:52:1: warning: useless storage class specifier in empty declaration
   52 | };
      | ^
In file included from C:/msys64/home/ofry/bmake/compat.c:119:
C:/msys64/home/ofry/bmake/compat.c: In function 'CompatInterrupt':
C:/msys64/home/ofry/bmake/make.h:559:26: warning: implicit declaration of function 'killpg'; did you mean 'kill'? [-Wimplicit-function-declaration]
  559 | #define KILLPG(pid, sig) killpg((pid), (sig))
      |                          ^~~~~~
C:/msys64/home/ofry/bmake/compat.c:195:2: note: in expansion of macro 'KILLPG'
  195 |  KILLPG(compatChild, signo);
      |  ^~~~~~
In file included from C:/msys64/home/ofry/bmake/pathnames.h:36,
                 from C:/msys64/home/ofry/bmake/compat.c:124:
C:/msys64/home/ofry/bmake/compat.c: In function 'CompatRunCommand':
./config.h:642:15: warning: implicit declaration of function 'fork' [-Wimplicit-function-declaration]
  642 | #define vfork fork
      |               ^~~~
C:/msys64/home/ofry/bmake/make.h:455:40: note: in expansion of macro 'vfork'
  455 | #define vFork() ((getpid() == myPid) ? vfork() : fork())
      |                                        ^~~~~
C:/msys64/home/ofry/bmake/compat.c:392:26: note: in expansion of macro 'vFork'
  392 |     compatChild = cpid = vFork();
      |                          ^~~~~
C:/msys64/home/ofry/bmake/compat.c:427:20: warning: implicit declaration of function 'wait'; did you mean 'cwait'? [-Wimplicit-function-declaration]
  427 |  while ((retstat = wait(&reason)) != cpid) {
      |                    ^~~~
      |                    cwait
gcc -c -g -O2 -I. -I/home/ofry/bmake -DHAVE_CONFIG_H -I/home/ofry/bmake/missing -DNEED_HOST_CDEFS_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -DNO_REGEX -o cond.o /home/ofry/bmake/cond.c
In file included from C:/msys64/home/ofry/bmake/make.h:98,
                 from C:/msys64/home/ofry/bmake/cond.c:98:
C:/msys64/home/ofry/bmake/headers-mingw/stdlib.h:52:1: warning: useless storage class specifier in empty declaration
   52 | };
      | ^
gcc -c -g -O2 -I. -I/home/ofry/bmake -DHAVE_CONFIG_H -I/home/ofry/bmake/missing -DNEED_HOST_CDEFS_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -DNO_REGEX -o dir.o /home/ofry/bmake/dir.c
In file included from C:/msys64/home/ofry/bmake/make.h:98,
                 from C:/msys64/home/ofry/bmake/dir.c:148:
C:/msys64/home/ofry/bmake/headers-mingw/stdlib.h:52:1: warning: useless storage class specifier in empty declaration
   52 | };
      | ^
gcc -c -g -O2 -I. -I/home/ofry/bmake -DHAVE_CONFIG_H -I/home/ofry/bmake/missing -DNEED_HOST_CDEFS_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -DNO_REGEX -o for.o /home/ofry/bmake/for.c
In file included from C:/msys64/home/ofry/bmake/make.h:98,
                 from C:/msys64/home/ofry/bmake/for.c:58:
C:/msys64/home/ofry/bmake/headers-mingw/stdlib.h:52:1: warning: useless storage class specifier in empty declaration
   52 | };
      | ^
gcc -c -g -O2 -I. -I/home/ofry/bmake -DHAVE_CONFIG_H -I/home/ofry/bmake/missing -DNEED_HOST_CDEFS_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -DNO_REGEX -o getopt /home/ofry/bmake/getopt.c
gcc -c -g -O2 -I. -I/home/ofry/bmake -DHAVE_CONFIG_H -I/home/ofry/bmake/missing -DNEED_HOST_CDEFS_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -DNO_REGEX -o hash.o /home/ofry/bmake/hash.c
In file included from C:/msys64/home/ofry/bmake/make.h:98,
                 from C:/msys64/home/ofry/bmake/hash.c:93:
C:/msys64/home/ofry/bmake/headers-mingw/stdlib.h:52:1: warning: useless storage class specifier in empty declaration
   52 | };
      | ^
gcc -c -g -O2 -I. -I/home/ofry/bmake -DHAVE_CONFIG_H -I/home/ofry/bmake/missing -DNEED_HOST_CDEFS_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -DNO_REGEX -o job.o /home/ofry/bmake/job.c
In file included from C:/msys64/home/ofry/bmake/make.h:98,
                 from C:/msys64/home/ofry/bmake/job.c:178:
C:/msys64/home/ofry/bmake/headers-mingw/stdlib.h:52:1: warning: useless storage class specifier in empty declaration
   52 | };
      | ^
In file included from C:/msys64/home/ofry/bmake/job.c:178:
C:/msys64/home/ofry/bmake/job.c: In function 'JobCondPassSig':
C:/msys64/home/ofry/bmake/make.h:559:26: warning: implicit declaration of function 'killpg'; did you mean 'kill'? [-Wimplicit-function-declaration]
  559 | #define KILLPG(pid, sig) killpg((pid), (sig))
      |                          ^~~~~~
C:/msys64/home/ofry/bmake/make.h:559:26: note: in definition of macro 'KILLPG'
  559 | #define KILLPG(pid, sig) killpg((pid), (sig))
      |                          ^~~~~~
In file included from C:/msys64/home/ofry/bmake/pathnames.h:36,
                 from C:/msys64/home/ofry/bmake/job.c:182:
C:/msys64/home/ofry/bmake/job.c: In function 'JobExec':
./config.h:642:15: warning: implicit declaration of function 'fork' [-Wimplicit-function-declaration]
  642 | #define vfork fork
      |               ^~~~
./config.h:642:15: note: in definition of macro 'vfork'
  642 | #define vfork fork
      |               ^~~~
C:/msys64/home/ofry/bmake/job.c:1374:12: note: in expansion of macro 'vFork'
 1374 |     cpid = vFork();
      |            ^~~~~
C:/msys64/home/ofry/bmake/job.c: In function 'Shell_Init':
C:/msys64/home/ofry/bmake/job.c:2220:24: warning: implicit declaration of function 'getShellLaunchPrefix' [-Wimplicit-function-declaration]
 2220 |         shellExecCmd = getShellLaunchPrefix();
      |                        ^~~~~~~~~~~~~~~~~~~~
C:/msys64/home/ofry/bmake/job.c:2220:22: warning: assignment to 'const char *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
 2220 |         shellExecCmd = getShellLaunchPrefix();
      |                      ^
gcc -c -g -O2 -I. -I/home/ofry/bmake -DHAVE_CONFIG_H -I/home/ofry/bmake/missing -DNEED_HOST_CDEFS_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -DNO_REGEX -o make.o /home/ofry/bmake/make.c
In file included from C:/msys64/home/ofry/bmake/make.h:98,
                 from C:/msys64/home/ofry/bmake/make.c:118:
C:/msys64/home/ofry/bmake/headers-mingw/stdlib.h:52:1: warning: useless storage class specifier in empty declaration
   52 | };
      | ^
gcc -c -g -O2 -I. -I/home/ofry/bmake -DHAVE_CONFIG_H -I/home/ofry/bmake/missing -DNEED_HOST_CDEFS_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -DNO_REGEX -o make_malloc.o /home/ofry/bmake/make_malloc.c
In file included from C:/msys64/home/ofry/bmake/make.h:98,
                 from C:/msys64/home/ofry/bmake/make_malloc.c:39:
C:/msys64/home/ofry/bmake/headers-mingw/stdlib.h:52:1: warning: useless storage class specifier in empty declaration
   52 | };
      | ^
gcc -c -g -O2 -I. -I/home/ofry/bmake -DHAVE_CONFIG_H -I/home/ofry/bmake/missing -DNEED_HOST_CDEFS_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -DNO_REGEX -o metachar.o /home/ofry/bmake/metachar.c
gcc -c -g -O2 -I. -I/home/ofry/bmake -DHAVE_CONFIG_H -I/home/ofry/bmake/missing -DNEED_HOST_CDEFS_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -DNO_REGEX -o parse.o /home/ofry/bmake/parse.c
In file included from C:/msys64/home/ofry/bmake/make.h:98,
                 from C:/msys64/home/ofry/bmake/parse.c:137:
C:/msys64/home/ofry/bmake/headers-mingw/stdlib.h:52:1: warning: useless storage class specifier in empty declaration
   52 | };
      | ^
gcc -c -g -O2 -I. -I/home/ofry/bmake -DHAVE_CONFIG_H -I/home/ofry/bmake/missing -DNEED_HOST_CDEFS_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -DNO_REGEX -o sigcompat.o /home/ofry/bmake/sigcompat.c
gcc -c -g -O2 -I. -I/home/ofry/bmake -DHAVE_CONFIG_H -I/home/ofry/bmake/missing -DNEED_HOST_CDEFS_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -DNO_REGEX -o str.o /home/ofry/bmake/str.c
In file included from C:/msys64/home/ofry/bmake/make.h:98,
                 from C:/msys64/home/ofry/bmake/str.c:84:
C:/msys64/home/ofry/bmake/headers-mingw/stdlib.h:52:1: warning: useless storage class specifier in empty declaration
   52 | };
      | ^
gcc -c -g -O2 -I. -I/home/ofry/bmake -DHAVE_CONFIG_H -I/home/ofry/bmake/missing -DNEED_HOST_CDEFS_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -DNO_REGEX -o strlist.o /home/ofry/bmake/strlist.c
gcc -c -g -O2 -I. -I/home/ofry/bmake -DHAVE_CONFIG_H -I/home/ofry/bmake/missing -DNEED_HOST_CDEFS_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -DNO_REGEX -o suff.o /home/ofry/bmake/suff.c
In file included from C:/msys64/home/ofry/bmake/make.h:98,
                 from C:/msys64/home/ofry/bmake/suff.c:140:
C:/msys64/home/ofry/bmake/headers-mingw/stdlib.h:52:1: warning: useless storage class specifier in empty declaration
   52 | };
      | ^
C:/msys64/home/ofry/bmake/suff.c: In function 'SuffPrintSuff':
C:/msys64/home/ofry/bmake/suff.c:2626:19: warning: implicit declaration of function 'ffs' [-Wimplicit-function-declaration]
 2626 |      flag = 1 << (ffs(flags) - 1);
      |                   ^~~
gcc -c -g -O2 -I. -I/home/ofry/bmake -DHAVE_CONFIG_H -I/home/ofry/bmake/missing -DNEED_HOST_CDEFS_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -DNO_REGEX -o targ.o /home/ofry/bmake/targ.c
In file included from C:/msys64/home/ofry/bmake/make.h:98,
                 from C:/msys64/home/ofry/bmake/targ.c:135:
C:/msys64/home/ofry/bmake/headers-mingw/stdlib.h:52:1: warning: useless storage class specifier in empty declaration
   52 | };
      | ^
C:/msys64/home/ofry/bmake/targ.c: In function 'Targ_PrintType':
C:/msys64/home/ofry/bmake/targ.c:578:15: warning: implicit declaration of function 'ffs' [-Wimplicit-function-declaration]
  578 |  tbit = 1 << (ffs(type) - 1);
      |               ^~~
gcc -c -g -O2 -I. -I/home/ofry/bmake -DHAVE_CONFIG_H -I/home/ofry/bmake/missing -DNEED_HOST_CDEFS_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -DNO_REGEX -o trace.o /home/ofry/bmake/trace.c
In file included from C:/msys64/home/ofry/bmake/make.h:98,
                 from C:/msys64/home/ofry/bmake/trace.c:63:
C:/msys64/home/ofry/bmake/headers-mingw/stdlib.h:52:1: warning: useless storage class specifier in empty declaration
   52 | };
      | ^
gcc -c -g -O2 -I. -I/home/ofry/bmake -DHAVE_CONFIG_H -I/home/ofry/bmake/missing -DNEED_HOST_CDEFS_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -DNO_REGEX -o var.o /home/ofry/bmake/var.c
In file included from C:/msys64/home/ofry/bmake/make.h:98,
                 from C:/msys64/home/ofry/bmake/var.c:139:
C:/msys64/home/ofry/bmake/headers-mingw/stdlib.h:52:1: warning: useless storage class specifier in empty declaration
   52 | };
      | ^
gcc -c -g -O2 -I. -I/home/ofry/bmake -DHAVE_CONFIG_H -I/home/ofry/bmake/missing -DNEED_HOST_CDEFS_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -DNO_REGEX -o util.o /home/ofry/bmake/util.c
In file included from C:/msys64/home/ofry/bmake/make.h:98,
                 from C:/msys64/home/ofry/bmake/util.c:18:
C:/msys64/home/ofry/bmake/headers-mingw/stdlib.h:52:1: warning: useless storage class specifier in empty declaration
   52 | };
      | ^
C:/msys64/home/ofry/bmake/util.c:460:7: warning: conflicting types for built-in function 'fork'; expected 'int(void)' [-Wbuiltin-declaration-mismatch]
  460 | pid_t fork(void)
      |       ^~~~
C:/msys64/home/ofry/bmake/util.c: In function 'fork':
C:/msys64/home/ofry/bmake/util.c:483:8: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
  483 |   pi = (DWORD)process_info.ClientId.UniqueProcess;
      |        ^
C:/msys64/home/ofry/bmake/util.c:484:8: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
  484 |   ti = (DWORD)process_info.ClientId.UniqueThread;
      |        ^
C:/msys64/home/ofry/bmake/util.c: In function '__srandom':
C:/msys64/home/ofry/bmake/util.c:1064:12: warning: implicit declaration of function '__srandom_r'; did you mean '__srandom'? [-Wimplicit-function-declaration]
 1064 |     (void) __srandom_r (x, &unsafe_state);
      |            ^~~~~~~~~~~
      |            __srandom
C:/msys64/home/ofry/bmake/util.c: In function '__initstate':
C:/msys64/home/ofry/bmake/util.c:1101:11: warning: implicit declaration of function '__initstate_r'; did you mean '__initstate'? [-Wimplicit-function-declaration]
 1101 |     ret = __initstate_r (seed, arg_state, n, &unsafe_state);
      |           ^~~~~~~~~~~~~
      |           __initstate
C:/msys64/home/ofry/bmake/util.c: In function '__setstate':
C:/msys64/home/ofry/bmake/util.c:1131:9: warning: implicit declaration of function '__setstate_r'; did you mean '__setstate'? [-Wimplicit-function-declaration]
 1131 |     if (__setstate_r (arg_state, &unsafe_state) < 0)
      |         ^~~~~~~~~~~~
      |         __setstate
C:/msys64/home/ofry/bmake/util.c: In function '__random':
C:/msys64/home/ofry/bmake/util.c:1163:12: warning: implicit declaration of function '__random_r'; did you mean '__random'? [-Wimplicit-function-declaration]
 1163 |     (void) __random_r (&unsafe_state, &retval);
      |            ^~~~~~~~~~
      |            __random
gcc -c -g -O2 -I. -I/home/ofry/bmake -DHAVE_CONFIG_H -I/home/ofry/bmake/missing -DNEED_HOST_CDEFS_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -DNO_REGEX -o lstAppend.o /home/ofry/bmake/lst.lib/lstAppend.c
gcc -c -g -O2 -I. -I/home/ofry/bmake -DHAVE_CONFIG_H -I/home/ofry/bmake/missing -DNEED_HOST_CDEFS_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -DNO_REGEX -o lstDupl.o /home/ofry/bmake/lst.lib/lstDupl.c
gcc -c -g -O2 -I. -I/home/ofry/bmake -DHAVE_CONFIG_H -I/home/ofry/bmake/missing -DNEED_HOST_CDEFS_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -DNO_REGEX -o lstInit.o /home/ofry/bmake/lst.lib/lstInit.c
gcc -c -g -O2 -I. -I/home/ofry/bmake -DHAVE_CONFIG_H -I/home/ofry/bmake/missing -DNEED_HOST_CDEFS_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -DNO_REGEX -o lstOpen.o /home/ofry/bmake/lst.lib/lstOpen.c
gcc -c -g -O2 -I. -I/home/ofry/bmake -DHAVE_CONFIG_H -I/home/ofry/bmake/missing -DNEED_HOST_CDEFS_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -DNO_REGEX -o lstAtEnd.o /home/ofry/bmake/lst.lib/lstAtEnd.c
gcc -c -g -O2 -I. -I/home/ofry/bmake -DHAVE_CONFIG_H -I/home/ofry/bmake/missing -DNEED_HOST_CDEFS_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -DNO_REGEX -o lstEnQueue.o /home/ofry/bmake/lst.lib/lstEnQueue.c
gcc -c -g -O2 -I. -I/home/ofry/bmake -DHAVE_CONFIG_H -I/home/ofry/bmake/missing -DNEED_HOST_CDEFS_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -DNO_REGEX -o lstInsert.o /home/ofry/bmake/lst.lib/lstInsert.c
gcc -c -g -O2 -I. -I/home/ofry/bmake -DHAVE_CONFIG_H -I/home/ofry/bmake/missing -DNEED_HOST_CDEFS_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -DNO_REGEX -o lstAtFront.o /home/ofry/bmake/lst.lib/lstAtFront.c
gcc -c -g -O2 -I. -I/home/ofry/bmake -DHAVE_CONFIG_H -I/home/ofry/bmake/missing -DNEED_HOST_CDEFS_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -DNO_REGEX -o lstIsAtEnd.o /home/ofry/bmake/lst.lib/lstIsAtEnd.c
gcc -c -g -O2 -I. -I/home/ofry/bmake -DHAVE_CONFIG_H -I/home/ofry/bmake/missing -DNEED_HOST_CDEFS_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -DNO_REGEX -o lstClose.o /home/ofry/bmake/lst.lib/lstClose.c
gcc -c -g -O2 -I. -I/home/ofry/bmake -DHAVE_CONFIG_H -I/home/ofry/bmake/missing -DNEED_HOST_CDEFS_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -DNO_REGEX -o lstFind.o /home/ofry/bmake/lst.lib/lstFind.c
gcc -c -g -O2 -I. -I/home/ofry/bmake -DHAVE_CONFIG_H -I/home/ofry/bmake/missing -DNEED_HOST_CDEFS_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -DNO_REGEX -o lstIsEmpty.o /home/ofry/bmake/lst.lib/lstIsEmpty.c
gcc -c -g -O2 -I. -I/home/ofry/bmake -DHAVE_CONFIG_H -I/home/ofry/bmake/missing -DNEED_HOST_CDEFS_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -DNO_REGEX -o lstRemove.o /home/ofry/bmake/lst.lib/lstRemove.c
gcc -c -g -O2 -I. -I/home/ofry/bmake -DHAVE_CONFIG_H -I/home/ofry/bmake/missing -DNEED_HOST_CDEFS_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -DNO_REGEX -o lstConcat.o /home/ofry/bmake/lst.lib/lstConcat.c
gcc -c -g -O2 -I. -I/home/ofry/bmake -DHAVE_CONFIG_H -I/home/ofry/bmake/missing -DNEED_HOST_CDEFS_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -DNO_REGEX -o lstFindFrom.o /home/ofry/bmake/lst.lib/lstFindFrom.c
gcc -c -g -O2 -I. -I/home/ofry/bmake -DHAVE_CONFIG_H -I/home/ofry/bmake/missing -DNEED_HOST_CDEFS_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -DNO_REGEX -o lstLast.o /home/ofry/bmake/lst.lib/lstLast.c
gcc -c -g -O2 -I. -I/home/ofry/bmake -DHAVE_CONFIG_H -I/home/ofry/bmake/missing -DNEED_HOST_CDEFS_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -DNO_REGEX -o lstReplace.o /home/ofry/bmake/lst.lib/lstReplace.c
gcc -c -g -O2 -I. -I/home/ofry/bmake -DHAVE_CONFIG_H -I/home/ofry/bmake/missing -DNEED_HOST_CDEFS_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -DNO_REGEX -o lstFirst.o /home/ofry/bmake/lst.lib/lstFirst.c
gcc -c -g -O2 -I. -I/home/ofry/bmake -DHAVE_CONFIG_H -I/home/ofry/bmake/missing -DNEED_HOST_CDEFS_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -DNO_REGEX -o lstDatum.o /home/ofry/bmake/lst.lib/lstDatum.c
gcc -c -g -O2 -I. -I/home/ofry/bmake -DHAVE_CONFIG_H -I/home/ofry/bmake/missing -DNEED_HOST_CDEFS_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -DNO_REGEX -o lstForEach.o /home/ofry/bmake/lst.lib/lstForEach.c
gcc -c -g -O2 -I. -I/home/ofry/bmake -DHAVE_CONFIG_H -I/home/ofry/bmake/missing -DNEED_HOST_CDEFS_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -DNO_REGEX -o lstMember.o /home/ofry/bmake/lst.lib/lstMember.c
gcc -c -g -O2 -I. -I/home/ofry/bmake -DHAVE_CONFIG_H -I/home/ofry/bmake/missing -DNEED_HOST_CDEFS_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -DNO_REGEX -o lstSucc.o /home/ofry/bmake/lst.lib/lstSucc.c
gcc -c -g -O2 -I. -I/home/ofry/bmake -DHAVE_CONFIG_H -I/home/ofry/bmake/missing -DNEED_HOST_CDEFS_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -DNO_REGEX -o lstDeQueue.o /home/ofry/bmake/lst.lib/lstDeQueue.c
gcc -c -g -O2 -I. -I/home/ofry/bmake -DHAVE_CONFIG_H -I/home/ofry/bmake/missing -DNEED_HOST_CDEFS_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -DNO_REGEX -o lstForEachFrom.o /home/ofry/bmake/lst.lib/lstForEachFrom.c
gcc -c -g -O2 -I. -I/home/ofry/bmake -DHAVE_CONFIG_H -I/home/ofry/bmake/missing -DNEED_HOST_CDEFS_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -DNO_REGEX -o lstDestroy.o /home/ofry/bmake/lst.lib/lstDestroy.c
gcc -c -g -O2 -I. -I/home/ofry/bmake -DHAVE_CONFIG_H -I/home/ofry/bmake/missing -DNEED_HOST_CDEFS_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -DNO_REGEX -o lstNext.o /home/ofry/bmake/lst.lib/lstNext.c
gcc -c -g -O2 -I. -I/home/ofry/bmake -DHAVE_CONFIG_H -I/home/ofry/bmake/missing -DNEED_HOST_CDEFS_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -DNO_REGEX -o lstPrev.o /home/ofry/bmake/lst.lib/lstPrev.c
gcc -c -g -O2 -I. -I/home/ofry/bmake -DHAVE_CONFIG_H -I/home/ofry/bmake/missing -DNEED_HOST_CDEFS_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -DNO_REGEX -o realpath.o /home/ofry/bmake/realpath.c
gcc -c -g -O2 -I. -I/home/ofry/bmake -DHAVE_CONFIG_H -I/home/ofry/bmake/missing -DNEED_HOST_CDEFS_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -DNO_REGEX -o stresep.o /home/ofry/bmake/stresep.c
gcc -c -g -O2 -I. -I/home/ofry/bmake -DHAVE_CONFIG_H -I/home/ofry/bmake/missing -DNEED_HOST_CDEFS_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -DNO_REGEX -o strlcpy.o /home/ofry/bmake/strlcpy.c
gcc -c -g -O2 -I. -I/home/ofry/bmake -DHAVE_CONFIG_H -I/home/ofry/bmake/missing -DNEED_HOST_CDEFS_H -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1024 -DNO_REGEX -o meta.o /home/ofry/bmake/meta.c
In file included from C:/msys64/home/ofry/bmake/make.h:98,
                 from C:/msys64/home/ofry/bmake/meta.c:57:
C:/msys64/home/ofry/bmake/headers-mingw/stdlib.h:52:1: warning: useless storage class specifier in empty declaration
   52 | };
      | ^
C:/msys64/home/ofry/bmake/meta.c: In function 'meta_create':
C:/msys64/home/ofry/bmake/meta.c:528:2: warning: implicit declaration of function 'err' [-Wimplicit-function-declaration]
  528 |  err(1, "Could not open meta file '%s'", fname);
      |  ^~~
C:/msys64/home/ofry/bmake/meta.c: In function 'meta_oodate':
C:/msys64/home/ofry/bmake/meta.c:1129:3: warning: implicit declaration of function 'warnx' [-Wimplicit-function-declaration]
 1129 |   warnx("%s: %d: line truncated at %u", fname, lineno, x);
      |   ^~~~~
C:/msys64/home/ofry/bmake/meta.c:110:23: warning: implicit declaration of function 'stresep'; did you mean 'strsep'? [-Wimplicit-function-declaration]
  110 | # define strsep(s, d) stresep((s), (d), 0)
      |                       ^~~~~~~
C:/msys64/home/ofry/bmake/meta.c:1153:6: note: in expansion of macro 'strsep'
 1153 |      strsep(&p, " ");
      |      ^~~~~~
C:/msys64/home/ofry/bmake/meta.c:1216:27: warning: comparison between pointer and integer
 1216 |       if (strsep(&p, " ") == NULL)
      |                           ^~
C:/msys64/home/ofry/bmake/meta.c:1278:27: warning: comparison between pointer and integer
 1278 |       if (strsep(&p, " ") == NULL)
      |                           ^~
C:/msys64/home/ofry/bmake/meta.c:1323:27: warning: comparison between pointer and integer
 1323 |       if (strsep(&p, " ") == NULL)
      |                           ^~
gcc -o bmake main.o meta.o arch.o buf.o compat.o cond.o dir.o for.o getopt hash.o job.o make.o make_malloc.o metachar.o parse.o sigcompat.o str.o strlist.o suff.o targ.o trace.o var.o util.o lstAppend.o lstDupl.o lstInit.o lstOpen.o lstAtEnd.o lstEnQueue.o lstInsert.o lstAtFront.o lstIsAtEnd.o lstClose.o lstFind.o lstIsEmpty.o lstRemove.o lstConcat.o lstFindFrom.o lstLast.o lstReplace.o lstFirst.o lstDatum.o lstForEach.o lstMember.o lstSucc.o lstDeQueue.o lstForEachFrom.o lstDestroy.o lstNext.o lstPrev.o realpath.o stresep.o strlcpy.o -lws2_32 -lwsock32
C:\msys64\home\ofry\mingw64_nt-6.3-96003-x86_64\bmake.exe: Unknown modifier 'C'
C:\msys64\home\ofry\mingw64_nt-6.3-96003-x86_64\bmake.exe: "/msys64/home/ofry/bmake/mk/host-target.mk" line 35: Undefined variable "${_HOST_OSREL:C/[^0-9].*//}"
C:\msys64\home\ofry\mingw64_nt-6.3-96003-x86_64\bmake.exe: Unknown modifier 'C'
C:\msys64\home\ofry\mingw64_nt-6.3-96003-x86_64\bmake.exe: "/msys64/home/ofry/bmake/mk/host-target.mk" line 36: Undefined variable "${_HOST_OSREL:C/\([^\)]*\)//}"
C:\msys64\home\ofry\mingw64_nt-6.3-96003-x86_64\bmake.exe: Unknown modifier 'C'
C:\msys64\home\ofry\mingw64_nt-6.3-96003-x86_64\bmake.exe: Unknown modifier 'C'
C:\msys64\home\ofry\mingw64_nt-6.3-96003-x86_64\bmake.exe: Unknown modifier 'C'
C:\msys64\home\ofry\mingw64_nt-6.3-96003-x86_64\bmake.exe: Unknown modifier 'C'
sed: невозможно прочитать /etc/group: No such file or directory
C:\msys64\home\ofry\mingw64_nt-6.3-96003-x86_64\bmake.exe: "/msys64/home/ofry/bmake/mk/sys.mk" line 113: warning: "sed -n /:0:/s/:.*//p /etc/group" returned non-zero status

C:\msys64\home\ofry\mingw64_nt-6.3-96003-x86_64\bmake.exe: stopped in C:\msys64\home\ofry\bmake
C:\msys64\home\ofry\mingw64_nt-6.3-96003-x86_64\bmake.exe: Fatal errors encountered -- cannot continue

@ofry
Copy link
Contributor Author

ofry commented Jan 10, 2020

I made new commit in my branch. I add working regexp support, so variable assignment modifier :C works properly.

Current state:

ofry@games MINGW64 ~/bmake
$ gdb --args ./bmake -dcCdepvg2 -m "./mk"
GNU gdb (GDB) 8.3.1
Copyright (C) 2019 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-w64-mingw32".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./bmake...
(gdb) break _exit
Breakpoint 1 at 0x435c28: file C:/msys64/home/ofry/bmake/main.c, line 2303.
(gdb) run
Starting program: C:\msys64\home\ofry\bmake\bmake.exe -dcCdepvg2 -m ./mk
warning: Invalid parameter passed to C runtime function.
Caching ./mk ...done
Global:.MAKEFLAGS =  -d cCdepvg2 -m
Global:.MAKEFLAGS =  -d cCdepvg2 -m ./mk
Global:.CURDIR = C:/msys64/home/ofry/bmake
Caching C:/msys64/home/ofry/bmake ...done
Global:.OBJDIR = C:/msys64/home/ofry/bmake
Caching . ...done
Global:delete .PATH (not found)
Global:.PATH = .
Global:.PATH = . C:/msys64/home/ofry/bmake
Global:.TARGETS =
Caching C ...done
Caching /msys64/share/mk ...done
Expanding "sys.mk"... ./mk/sys.mk
Internal:MAKEFILE = ./mk/sys.mk
Global:.MAKE.MAKEFILES = ./mk/sys.mk
Parse_SetInput: file ./mk/sys.mk, line 0, fd -1, nextbuf 00000000004120A0, arg 00000000003006C0
Global:.PARSEDIR = ./mk
Global:.PARSEFILE = sys.mk
ParseSetParseFile: ${.PARSEDIR} = `./mk' ${.PARSEFILE} = `sys.mk'
ParseReadLine (19): '.include <sys.debug.mk>'
Searching for sys.debug.mk ...
   ./mk ...
   returning ./mk/sys.debug.mk
Global:.INCLUDEDFROMFILE = sys.mk
Global:.INCLUDEDFROMDIR = ./mk
ParseSetIncludedFile: ${.INCLUDEDFROMDIR} = `./mk' ${.INCLUDEDFROMFILE} = `sys.mk'
Global:.MAKE.MAKEFILES = ./mk/sys.mk ./mk/sys.debug.mk
Parse_SetInput: file ./mk/sys.debug.mk, line 0, fd -1, nextbuf 00000000004120A0, arg 0000000000301BB0
Global:.PARSEDIR = ./mk
Global:.PARSEFILE = sys.debug.mk
ParseSetParseFile: ${.PARSEDIR} = `./mk' ${.PARSEFILE} = `sys.debug.mk'
Applying[.MAKE.LEVEL] :U to "0"
Result[.MAKE.LEVEL] of :U is "0"
left = 0.000000, right = 0.000000, op = ==
ParseReadLine (26): '_DEBUG_MAKE_FLAGS = ${DEBUG_MAKE_FLAGS0}'
Global:_DEBUG_MAKE_FLAGS = ${DEBUG_MAKE_FLAGS0}
ParseReadLine (27): '_DEBUG_MAKE_SYS_DIRS = ${DEBUG_MAKE_SYS_DIRS0:U${DEBUG_MAKE_SYS_DIRS}}'
Global:_DEBUG_MAKE_SYS_DIRS = ${DEBUG_MAKE_SYS_DIRS0:U${DEBUG_MAKE_SYS_DIRS}}
ParseReadLine (28): '_DEBUG_MAKE_DIRS = ${DEBUG_MAKE_DIRS0:U${DEBUG_MAKE_DIRS}}'
Global:_DEBUG_MAKE_DIRS = ${DEBUG_MAKE_DIRS0:U${DEBUG_MAKE_DIRS}}
ParseEOF: returning to file ./mk/sys.mk, line 19
Global:.PARSEDIR = ./mk
Global:.PARSEFILE = sys.mk
ParseSetParseFile: ${.PARSEDIR} = `./mk' ${.PARSEFILE} = `sys.mk'
ParseReadLine (28): '.include <sys.vars.mk>'
Searching for sys.vars.mk ...
   ./mk ...
   returning ./mk/sys.vars.mk
Global:.INCLUDEDFROMFILE = sys.mk
Global:.INCLUDEDFROMDIR = ./mk
ParseSetIncludedFile: ${.INCLUDEDFROMDIR} = `./mk' ${.INCLUDEDFROMFILE} = `sys.mk'
Global:.MAKE.MAKEFILES = ./mk/sys.mk ./mk/sys.debug.mk ./mk/sys.vars.mk
Parse_SetInput: file ./mk/sys.vars.mk, line 0, fd -1, nextbuf 00000000004120A0, arg 0000000000302370
Global:.PARSEDIR = ./mk
Global:.PARSEFILE = sys.vars.mk
ParseSetParseFile: ${.PARSEDIR} = `./mk' ${.PARSEFILE} = `sys.vars.mk'
Applying[MAKE_VERSION] :U to "20181221"
Result[MAKE_VERSION] of :U is "20181221"
left = 20181221.000000, right = 20100408.000000, op = >
ParseReadLine (25): '_this = ${.PARSEDIR:tA}/${.PARSEFILE}'
Global:_this = ${.PARSEDIR:tA}/${.PARSEFILE}
ParseReadLine (31): 'MAKE_VERSION ?= 0'
Applying[MAKE_VERSION] :M to "20181221"
Pattern[MAKE_VERSION] for [20181221] is [*make-*]
VarMatch [20181221] [*make-*]
Result[MAKE_VERSION] of :M is ""
ParseReadLine (42): 'M_ListToMatch = L:@m@$${V:M$$m}@'
Global:M_ListToMatch = L:@m@$${V:M$$m}@
ParseReadLine (44): 'M_L_TARGETS = ${M_ListToMatch:S,V,_TARGETS,}'
Global:M_L_TARGETS = ${M_ListToMatch:S,V,_TARGETS,}
ParseReadLine (48): 'M_ListToSkip= O:u:S,^,N,:ts:'
Global:M_ListToSkip = O:u:S,^,N,:ts:
Applying[.MAKE.OS] :U to "MINGW32_NT-6.3"
Result[.MAKE.OS] of :U is "MINGW32_NT-6.3"
Applying[.MAKE.OS] :N to "MINGW32_NT-6.3"
Pattern[.MAKE.OS] for [MINGW32_NT-6.3] is [BSD/OS]
Result[.MAKE.OS] of :N is "MINGW32_NT-6.3"
lhs = "MINGW32_NT-6.3", rhs = "", op = ==
ParseReadLine (57): 'M_type = @x@(${_type_sh:Utype} $$x) 2> /dev/null; echo;@:sh:[0]:N* found*:[@]:C,[()],,g'
Global:M_type = @x@(${_type_sh:Utype} $$x) 2> /dev/null; echo;@:sh:[0]:N* found*:[@]:C,[()],,g
ParseReadLine (58): 'M_whence = ${M_type}:M/*:[1]'
Global:M_whence = ${M_type}:M/*:[1]
ParseReadLine (61): 'M_P2V = tu:C,[./-],_,g'
Global:M_P2V = tu:C,[./-],_,g
Applying[MAKE_VERSION] :U to "20181221"
Result[MAKE_VERSION] of :U is "20181221"
left = 20181221.000000, right = 20100408.000000, op = >
ParseReadLine (65): 'M_tA = tA'
Global:M_tA = tA
Applying[MAKE_VERSION] :U to "20181221"
Result[MAKE_VERSION] of :U is "20181221"
left = 20181221.000000, right = 20170130.000000, op = >=
ParseReadLine (75): 'M_cmpv.units = 1 1000 1000000'
Global:M_cmpv.units = 1 1000 1000000
ParseReadLine (76): 'M_cmpv = S,., ,g:_:range:@i@+ $${_:[-$$i]} \* $${M_cmpv.units:[$$i]}@:S,^,expr 0 ,1:sh'
Global:M_cmpv = S,., ,g:_:range:@i@+ $${_:[-$$i]} \* $${M_cmpv.units:[$$i]}@:S,^,expr 0 ,1:sh
ParseReadLine (80): '_PARSEDIR = ${.PARSEDIR:${M_tA}}'
Global:_PARSEDIR = ${.PARSEDIR:${M_tA}}
ParseEOF: returning to file ./mk/sys.mk, line 28
Global:.PARSEDIR = ./mk
Global:.PARSEFILE = sys.mk
ParseSetParseFile: ${.PARSEDIR} = `./mk' ${.PARSEFILE} = `sys.mk'
ParseReadLine (33): '_TARGETS := ${.TARGETS}'
Global:_TARGETS =
Global:_TARGETS =
ParseReadLine (34): '.-include <sys.env.mk>'
Searching for sys.env.mk ...
   ./mk ...
   failed.
ParseReadLine (38): '.include <host-target.mk>'
Searching for host-target.mk ...
   ./mk ...
   returning ./mk/host-target.mk
Global:.INCLUDEDFROMFILE = sys.mk
Global:.INCLUDEDFROMDIR = ./mk
ParseSetIncludedFile: ${.INCLUDEDFROMDIR} = `./mk' ${.INCLUDEDFROMFILE} = `sys.mk'
Global:.MAKE.MAKEFILES = ./mk/sys.mk ./mk/sys.debug.mk ./mk/sys.vars.mk ./mk/host-target.mk
Parse_SetInput: file ./mk/host-target.mk, line 0, fd -1, nextbuf 00000000004120A0, arg 0000000000303EB0
Global:.PARSEDIR = ./mk
Global:.PARSEFILE = host-target.mk
ParseSetParseFile: ${.PARSEDIR} = `./mk' ${.PARSEFILE} = `host-target.mk'
ParseReadLine (6): '_HOST_OSNAME !=     uname -s | cut -d_ -f1'
warning: Application "\??\C:\Windows\system32\cmd.exe" found in cache
Global:_HOST_OSNAME = MINGW64
ParseReadLine (7): '.export _HOST_OSNAME'
Global:.MAKE.EXPORTED = _HOST_OSNAME
ParseReadLine (10): '_HOST_OSREL  !=    uname -r'
Applying[.MAKE.EXPORTED] :O to "_HOST_OSNAME"
Result[.MAKE.EXPORTED] of :O is "_HOST_OSNAME"
Applying[.MAKE.EXPORTED] :u to "_HOST_OSNAME"
Result[.MAKE.EXPORTED] of :u is "_HOST_OSNAME"
warning: Application "\??\C:\Windows\system32\cmd.exe" found in cache
Global:_HOST_OSREL = 3.0.7-338.x86_64
ParseReadLine (11): '.export _HOST_OSREL'
Global:.MAKE.EXPORTED = _HOST_OSNAME _HOST_OSREL
ParseReadLine (14): '_HOST_MACHINE != uname -m'
Applying[.MAKE.EXPORTED] :O to "_HOST_OSNAME _HOST_OSREL"
Result[.MAKE.EXPORTED] of :O is "_HOST_OSNAME _HOST_OSREL"
Applying[.MAKE.EXPORTED] :u to "_HOST_OSNAME _HOST_OSREL"
Result[.MAKE.EXPORTED] of :u is "_HOST_OSNAME _HOST_OSREL"
warning: Application "\??\C:\Windows\system32\cmd.exe" found in cache
Global:_HOST_MACHINE = x86_64
ParseReadLine (15): '.export _HOST_MACHINE'
Global:.MAKE.EXPORTED = _HOST_OSNAME _HOST_OSREL _HOST_MACHINE
Applying[_HOST_OSNAME] :N to "MINGW64"
Pattern[_HOST_OSNAME] for [MINGW64] is [NetBSD]
Result[_HOST_OSNAME] of :N is "MINGW64"
lhs = "MINGW64", rhs = "", op = ==
ParseReadLine (22): '_HOST_ARCH != uname -p 2> /dev/null || uname -m'
Applying[.MAKE.EXPORTED] :O to "_HOST_OSNAME _HOST_OSREL _HOST_MACHINE"
Result[.MAKE.EXPORTED] of :O is "_HOST_MACHINE _HOST_OSNAME _HOST_OSREL"
Applying[.MAKE.EXPORTED] :u to "_HOST_MACHINE _HOST_OSNAME _HOST_OSREL"
Result[.MAKE.EXPORTED] of :u is "_HOST_MACHINE _HOST_OSNAME _HOST_OSREL"
warning: Application "\??\C:\Windows\system32\cmd.exe" found in cache
Global:_HOST_ARCH = unknown
Applying[_HOST_ARCH] :[ to "unknown"
Modifier pattern: "#"
Result[_HOST_ARCH] of :[ is "1"
left = 1.000000, right = 1.000000, op = >
Applying[_HOST_ARCH] :N to "unknown"
Pattern[_HOST_ARCH] for [unknown] is [unknown]
Result[_HOST_ARCH] of :N is ""
lhs = "", rhs = "", op = ==
ParseReadLine (25): '_HOST_ARCH := ${_HOST_MACHINE}'
Global:_HOST_ARCH = x86_64
ParseReadLine (28): '.export _HOST_ARCH'
Global:.MAKE.EXPORTED = _HOST_OSNAME _HOST_OSREL _HOST_MACHINE _HOST_ARCH
ParseReadLine (31): 'HOST_MACHINE := ${_HOST_MACHINE}'
Global:HOST_MACHINE =
Global:HOST_MACHINE = x86_64
ParseReadLine (32): '.export HOST_MACHINE'
Global:.MAKE.EXPORTED = _HOST_OSNAME _HOST_OSREL _HOST_MACHINE _HOST_ARCH HOST_MACHINE
ParseReadLine (35): 'HOST_OSMAJOR := ${_HOST_OSREL:C/[^0-9].*//}'
Global:HOST_OSMAJOR =
Applying[_HOST_OSREL] :C to "3.0.7-338.x86_64"
Modifier pattern: "[^0-9].*"
Modifier pattern: ""
Result[_HOST_OSREL] of :C is "3"
Global:HOST_OSMAJOR = 3
ParseReadLine (36): 'HOST_OSTYPE  :=    ${_HOST_OSNAME:S,/,,g}-${_HOST_OSREL:C/\([^\)]*\)//}-${_HOST_ARCH}'
Global:HOST_OSTYPE =
Applying[_HOST_OSNAME] :S to "MINGW64"
Modifier pattern: "/"
Modifier pattern: ""
Result[_HOST_OSNAME] of :S is "MINGW64"
Applying[_HOST_OSREL] :C to "3.0.7-338.x86_64"
Modifier pattern: "\([^\)]*\)"
Modifier pattern: ""
Result[_HOST_OSREL] of :C is "3.0.7-338.x86_64"
Global:HOST_OSTYPE = MINGW64-3.0.7-338.x86_64-x86_64
ParseReadLine (37): 'HOST_OS      :=    ${_HOST_OSNAME}'
Global:HOST_OS =
Global:HOST_OS = MINGW64
ParseReadLine (38): 'host_os      :=    ${_HOST_OSNAME:tl}'
Global:host_os =
Applying[_HOST_OSNAME] :t to "MINGW64"
Result[_HOST_OSNAME] of :t is "mingw64"
Global:host_os = mingw64
ParseReadLine (39): 'HOST_TARGET  := ${host_os:S,/,,g}${HOST_OSMAJOR}-${_HOST_ARCH}'
Global:HOST_TARGET =
Applying[host_os] :S to "mingw64"
Modifier pattern: "/"
Modifier pattern: ""
Result[host_os] of :S is "mingw64"
Global:HOST_TARGET = mingw643-x86_64
ParseReadLine (42): 'TR ?= tr'
Global:TR = tr
ParseReadLine (43): 'toLower = ${TR} 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz''
Global:toLower = ${TR} 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'
ParseReadLine (44): 'toUpper = ${TR} 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ''
Global:toUpper = ${TR} 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
ParseEOF: returning to file ./mk/sys.mk, line 38
Global:.PARSEDIR = ./mk
Global:.PARSEFILE = sys.mk
ParseSetParseFile: ${.PARSEDIR} = `./mk' ${.PARSEFILE} = `sys.mk'
ParseReadLine (41): '.-include <local.sys.env.mk>'
Searching for local.sys.env.mk ...
   ./mk ...
   failed.
ParseReadLine (44): 'CXX_SUFFIXES += .cc .cpp .cxx .C'
Global:CXX_SUFFIXES = .cc .cpp .cxx .C
ParseReadLine (45): 'CXX_SUFFIXES := ${CXX_SUFFIXES:O:u}'
Applying[CXX_SUFFIXES] :O to ".cc .cpp .cxx .C"
Result[CXX_SUFFIXES] of :O is ".C .cc .cpp .cxx"
Applying[CXX_SUFFIXES] :u to ".C .cc .cpp .cxx"
Result[CXX_SUFFIXES] of :u is ".C .cc .cpp .cxx"
Global:CXX_SUFFIXES = .C .cc .cpp .cxx
ParseReadLine (51): '_sys_mk ='
Global:_sys_mk =
Parse_SetInput: file ./mk/sys.mk, line 52, fd -1, nextbuf 000000000040BA60, arg 0000000000305FB0
Global:.PARSEDIR = ./mk
Global:.PARSEFILE = sys.mk
ParseSetParseFile: ${.PARSEDIR} = `./mk' ${.PARSEFILE} = `sys.mk'
ParseReadLine (54): '.-include <sys/${:UMINGW64-3.0.7-338.x86_64-x86_64}.mk>'
Applying[] :U to ""
Result[] of :U is "MINGW64-3.0.7-338.x86_64-x86_64"
Searching for sys/MINGW64-3.0.7-338.x86_64-x86_64.mk ...
   Trying subdirectories...
checking sys/MINGW64-3.0.7-338.x86_64-x86_64.mk ...
checking C:/msys64/home/ofry/bmake/sys/MINGW64-3.0.7-338.x86_64-x86_64.mk ...
checking ./mk/sys/MINGW64-3.0.7-338.x86_64-x86_64.mk ...
   Checked . already, returning NULL
ParseReadLine (55): '_sys_mk := ${.MAKE.MAKEFILES:M*/${:UMINGW64-3.0.7-338.x86_64-x86_64}.mk}'
Applying[.MAKE.MAKEFILES] :M to "./mk/sys.mk ./mk/sys.debug.mk ./mk/sys.vars.mk ./mk/host-target.mk"
Applying[] :U to ""
Result[] of :U is "MINGW64-3.0.7-338.x86_64-x86_64"
Pattern[.MAKE.MAKEFILES] for [./mk/sys.mk ./mk/sys.debug.mk ./mk/sys.vars.mk ./mk/host-target.mk] is [*/MINGW64-3.0.7-338.x86_64-x86_64.mk]
VarMatch [./mk/sys.mk] [*/MINGW64-3.0.7-338.x86_64-x86_64.mk]
VarMatch [./mk/sys.debug.mk] [*/MINGW64-3.0.7-338.x86_64-x86_64.mk]
VarMatch [./mk/sys.vars.mk] [*/MINGW64-3.0.7-338.x86_64-x86_64.mk]
VarMatch [./mk/host-target.mk] [*/MINGW64-3.0.7-338.x86_64-x86_64.mk]
Result[.MAKE.MAKEFILES] of :M is ""
Global:_sys_mk =
ParseReadLine (61): '.-include <${:UMINGW64-3.0.7-338.x86_64-x86_64}.sys.mk>'
Applying[] :U to ""
Result[] of :U is "MINGW64-3.0.7-338.x86_64-x86_64"
Searching for MINGW64-3.0.7-338.x86_64-x86_64.sys.mk ...
   ./mk ...
   failed.
ParseReadLine (62): '_sys_mk := ${.MAKE.MAKEFILES:M*/${:UMINGW64-3.0.7-338.x86_64-x86_64}.sys.mk:T}'
Applying[.MAKE.MAKEFILES] :M to "./mk/sys.mk ./mk/sys.debug.mk ./mk/sys.vars.mk ./mk/host-target.mk"
Applying[] :U to ""
Result[] of :U is "MINGW64-3.0.7-338.x86_64-x86_64"
Pattern[.MAKE.MAKEFILES] for [./mk/sys.mk ./mk/sys.debug.mk ./mk/sys.vars.mk ./mk/host-target.mk] is [*/MINGW64-3.0.7-338.x86_64-x86_64.sys.mk]
VarMatch [./mk/sys.mk] [*/MINGW64-3.0.7-338.x86_64-x86_64.sys.mk]
VarMatch [./mk/sys.debug.mk] [*/MINGW64-3.0.7-338.x86_64-x86_64.sys.mk]
VarMatch [./mk/sys.vars.mk] [*/MINGW64-3.0.7-338.x86_64-x86_64.sys.mk]
VarMatch [./mk/host-target.mk] [*/MINGW64-3.0.7-338.x86_64-x86_64.sys.mk]
Result[.MAKE.MAKEFILES] of :M is ""
Applying[.MAKE.MAKEFILES] :T to ""
Result[.MAKE.MAKEFILES] of :T is ""
Global:_sys_mk =
ParseReadLine (54): '.-include <sys/${:Umingw643-x86_64}.mk>'
Applying[] :U to ""
Result[] of :U is "mingw643-x86_64"
Searching for sys/mingw643-x86_64.mk ...
   Trying subdirectories...
checking sys/mingw643-x86_64.mk ...
checking C:/msys64/home/ofry/bmake/sys/mingw643-x86_64.mk ...
checking ./mk/sys/mingw643-x86_64.mk ...
   Checked . already, returning NULL
ParseReadLine (55): '_sys_mk := ${.MAKE.MAKEFILES:M*/${:Umingw643-x86_64}.mk}'
Applying[.MAKE.MAKEFILES] :M to "./mk/sys.mk ./mk/sys.debug.mk ./mk/sys.vars.mk ./mk/host-target.mk"
Applying[] :U to ""
Result[] of :U is "mingw643-x86_64"
Pattern[.MAKE.MAKEFILES] for [./mk/sys.mk ./mk/sys.debug.mk ./mk/sys.vars.mk ./mk/host-target.mk] is [*/mingw643-x86_64.mk]
VarMatch [./mk/sys.mk] [*/mingw643-x86_64.mk]
VarMatch [./mk/sys.debug.mk] [*/mingw643-x86_64.mk]
VarMatch [./mk/sys.vars.mk] [*/mingw643-x86_64.mk]
VarMatch [./mk/host-target.mk] [*/mingw643-x86_64.mk]
Result[.MAKE.MAKEFILES] of :M is ""
Global:_sys_mk =
ParseReadLine (61): '.-include <${:Umingw643-x86_64}.sys.mk>'
Applying[] :U to ""
Result[] of :U is "mingw643-x86_64"
Searching for mingw643-x86_64.sys.mk ...
   ./mk ...
   failed.
ParseReadLine (62): '_sys_mk := ${.MAKE.MAKEFILES:M*/${:Umingw643-x86_64}.sys.mk:T}'
Applying[.MAKE.MAKEFILES] :M to "./mk/sys.mk ./mk/sys.debug.mk ./mk/sys.vars.mk ./mk/host-target.mk"
Applying[] :U to ""
Result[] of :U is "mingw643-x86_64"
Pattern[.MAKE.MAKEFILES] for [./mk/sys.mk ./mk/sys.debug.mk ./mk/sys.vars.mk ./mk/host-target.mk] is [*/mingw643-x86_64.sys.mk]
VarMatch [./mk/sys.mk] [*/mingw643-x86_64.sys.mk]
VarMatch [./mk/sys.debug.mk] [*/mingw643-x86_64.sys.mk]
VarMatch [./mk/sys.vars.mk] [*/mingw643-x86_64.sys.mk]
VarMatch [./mk/host-target.mk] [*/mingw643-x86_64.sys.mk]
Result[.MAKE.MAKEFILES] of :M is ""
Applying[.MAKE.MAKEFILES] :T to ""
Result[.MAKE.MAKEFILES] of :T is ""
Global:_sys_mk =
ParseReadLine (54): '.-include <sys/${:UMINGW64}.mk>'
Applying[] :U to ""
Result[] of :U is "MINGW64"
Searching for sys/MINGW64.mk ...
   Trying subdirectories...
checking sys/MINGW64.mk ...
checking C:/msys64/home/ofry/bmake/sys/MINGW64.mk ...
checking ./mk/sys/MINGW64.mk ...
warning: Invalid parameter passed to C runtime function.
   Caching  for ./mk/sys/MINGW64.mk
Global:.INCLUDEDFROMFILE = sys.mk
Global:.INCLUDEDFROMDIR = ./mk
ParseSetIncludedFile: ${.INCLUDEDFROMDIR} = `./mk' ${.INCLUDEDFROMFILE} = `sys.mk'
Global:.MAKE.MAKEFILES = ./mk/sys.mk ./mk/sys.debug.mk ./mk/sys.vars.mk ./mk/host-target.mk ./mk/sys/MINGW64.mk
Parse_SetInput: file ./mk/sys/MINGW64.mk, line 0, fd -1, nextbuf 00000000004120A0, arg 0000000000306450
Global:.PARSEDIR = ./mk/sys
Global:.PARSEFILE = MINGW64.mk
ParseSetParseFile: ${.PARSEDIR} = `./mk/sys' ${.PARSEFILE} = `MINGW64.mk'
ParseReadLine (5): 'OS?=                Windows'
ParseReadLine (6): 'unix?=              We run ${OS}.'
Global:unix = We run ${OS}.
ParseReadLine (8): 'ROOT_GROUP='
Global:ROOT_GROUP =
ParseReadLine (11): 'LIBCRT0= /dev/null'
Global:LIBCRT0 = /dev/null
ParseReadLine (13): 'NEED_SOLINKS=yes'
Global:NEED_SOLINKS = yes
ParseReadLine (15): '.SUFFIXES: .out .a .ln .o .c ${CXX_SUFFIXES} .F .f .r .y .l .s .S .cl .p .h .sh .m4'
ParseDoDependency(.SUFFIXES: .out .a .ln .o .c .C .cc .cpp .cxx .F .f .r .y .l .s .S .cl .p .h .sh .m4)
ParseReadLine (17): '.LIBS:             .a'
ParseDoDependency(.LIBS:                .a)
ParseReadLine (19): 'AR=                ar'
Global:AR = ar
ParseReadLine (20): 'ARFLAGS=   rl'
Global:ARFLAGS = rl
ParseReadLine (21): 'RANLIB=            ranlib'
Global:RANLIB = ranlib
ParseReadLine (23): 'AS=                as'
Global:AS = as
ParseReadLine (24): 'AFLAGS='
Global:AFLAGS =
ParseReadLine (25): 'COMPILE.s= ${AS} ${AFLAGS}'
Global:COMPILE.s = ${AS} ${AFLAGS}
ParseReadLine (26): 'LINK.s=            ${CC} ${AFLAGS} ${LDFLAGS}'
Global:LINK.s = ${CC} ${AFLAGS} ${LDFLAGS}
ParseReadLine (27): 'COMPILE.S= ${CC} ${AFLAGS} ${CPPFLAGS} -c'
Global:COMPILE.S = ${CC} ${AFLAGS} ${CPPFLAGS} -c
ParseReadLine (28): 'LINK.S=            ${CC} ${AFLAGS} ${CPPFLAGS} ${LDFLAGS}'
Global:LINK.S = ${CC} ${AFLAGS} ${CPPFLAGS} ${LDFLAGS}
ParseReadLine (30): 'CC=                gcc -pipe'
Global:CC = gcc -pipe
ParseReadLine (31): 'DBG=               -O -g'
Global:DBG = -O -g
ParseReadLine (32): 'STATIC?=           -static'
Global:STATIC = -static
ParseReadLine (34): 'CFLAGS=            ${DBG}'
Global:CFLAGS = ${DBG}
ParseReadLine (35): 'COMPILE.c= ${CC} ${CFLAGS} ${CPPFLAGS} -c'
Global:COMPILE.c = ${CC} ${CFLAGS} ${CPPFLAGS} -c
ParseReadLine (36): 'LINK.c=            ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}'
Global:LINK.c = ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}
ParseReadLine (38): 'CXX=               g++'
Global:CXX = g++
ParseReadLine (39): 'CXXFLAGS=  ${CFLAGS}'
Global:CXXFLAGS = ${CFLAGS}
ParseReadLine (40): 'COMPILE.cc=        ${CXX} ${CXXFLAGS} ${CPPFLAGS} -c'
Global:COMPILE.cc = ${CXX} ${CXXFLAGS} ${CPPFLAGS} -c
ParseReadLine (41): 'LINK.cc=   ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${LDFLAGS}'
Global:LINK.cc = ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${LDFLAGS}
ParseReadLine (43): 'CPP=               cpp'
Global:CPP = cpp
ParseReadLine (48): 'MK_DEP=    mkdeps.sh -N'
Global:MK_DEP = mkdeps.sh -N
ParseReadLine (49): 'FC=                f77'
Global:FC = f77
ParseReadLine (50): 'FFLAGS=            -O'
Global:FFLAGS = -O
ParseReadLine (51): 'RFLAGS='
Global:RFLAGS =
ParseReadLine (52): 'COMPILE.f= ${FC} ${FFLAGS} -c'
Global:COMPILE.f = ${FC} ${FFLAGS} -c
ParseReadLine (53): 'LINK.f=            ${FC} ${FFLAGS} ${LDFLAGS}'
Global:LINK.f = ${FC} ${FFLAGS} ${LDFLAGS}
ParseReadLine (54): 'COMPILE.F= ${FC} ${FFLAGS} ${CPPFLAGS} -c'
Global:COMPILE.F = ${FC} ${FFLAGS} ${CPPFLAGS} -c
ParseReadLine (55): 'LINK.F=            ${FC} ${FFLAGS} ${CPPFLAGS} ${LDFLAGS}'
Global:LINK.F = ${FC} ${FFLAGS} ${CPPFLAGS} ${LDFLAGS}
ParseReadLine (56): 'COMPILE.r= ${FC} ${FFLAGS} ${RFLAGS} -c'
Global:COMPILE.r = ${FC} ${FFLAGS} ${RFLAGS} -c
ParseReadLine (57): 'LINK.r=            ${FC} ${FFLAGS} ${RFLAGS} ${LDFLAGS}'
Global:LINK.r = ${FC} ${FFLAGS} ${RFLAGS} ${LDFLAGS}
ParseReadLine (59): 'LEX=               lex'
Global:LEX = lex
ParseReadLine (60): 'LFLAGS='
Global:LFLAGS =
ParseReadLine (61): 'LEX.l=             ${LEX} ${LFLAGS}'
Global:LEX.l = ${LEX} ${LFLAGS}
ParseReadLine (63): 'LD=                ld'
Global:LD = ld
ParseReadLine (64): 'LDFLAGS='
Global:LDFLAGS =
ParseReadLine (66): 'LINT=              lint'
Global:LINT = lint
ParseReadLine (67): 'LINTFLAGS= -chapbx'
Global:LINTFLAGS = -chapbx
ParseReadLine (69): 'PC=                pc'
Global:PC = pc
ParseReadLine (70): 'PFLAGS='
Global:PFLAGS =
ParseReadLine (71): 'COMPILE.p= ${PC} ${PFLAGS} ${CPPFLAGS} -c'
Global:COMPILE.p = ${PC} ${PFLAGS} ${CPPFLAGS} -c
ParseReadLine (72): 'LINK.p=            ${PC} ${PFLAGS} ${CPPFLAGS} ${LDFLAGS}'
Global:LINK.p = ${PC} ${PFLAGS} ${CPPFLAGS} ${LDFLAGS}
ParseReadLine (74): 'SHELL=             sh'
Global:SHELL = sh
ParseReadLine (76): 'YACC=              yacc'
Global:YACC = yacc
ParseReadLine (77): 'YFLAGS=            -d'
Global:YFLAGS = -d
ParseReadLine (78): 'YACC.y=            ${YACC} ${YFLAGS}'
Global:YACC.y = ${YACC} ${YFLAGS}
ParseReadLine (81): '.c:'
ParseDoDependency(.c:)
ParseReadLine (82): '   ${LINK.c} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}'
ParseReadLine (83): '.c.o:'
ParseDoDependency(.c.o:)
ParseReadLine (84): '   ${COMPILE.c} ${.IMPSRC}'
ParseReadLine (85): '.c.a:'
ParseDoDependency(.c.a:)
ParseReadLine (86): '   ${COMPILE.c} ${.IMPSRC}'
ParseReadLine (87): '   ${AR} ${ARFLAGS} $@ $*.o'
ParseReadLine (88): '   rm -f $*.o'
ParseReadLine (91): '${CXX_SUFFIXES}:'
ParseDoDependency(.C .cc .cpp .cxx:)
ParseReadLine (92): '   ${LINK.cc} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}'
ParseReadLine (93): '${CXX_SUFFIXES:%=%.o}:'
Applying[CXX_SUFFIXES] :% to ".C .cc .cpp .cxx"
Modifier pattern: "%"
Modifier pattern: "%.o"
Result[CXX_SUFFIXES] of :% is ".C.o .cc.o .cpp.o .cxx.o"
ParseDoDependency(.C.o .cc.o .cpp.o .cxx.o:)
ParseReadLine (94): '   ${COMPILE.cc} ${.IMPSRC}'
ParseReadLine (95): '${CXX_SUFFIXES:%=%.a}:'
Applying[CXX_SUFFIXES] :% to ".C .cc .cpp .cxx"
Modifier pattern: "%"
Modifier pattern: "%.a"
Result[CXX_SUFFIXES] of :% is ".C.a .cc.a .cpp.a .cxx.a"
ParseDoDependency(.C.a .cc.a .cpp.a .cxx.a:)
ParseReadLine (96): '   ${COMPILE.cc} ${.IMPSRC}'
ParseReadLine (97): '   ${AR} ${ARFLAGS} $@ $*.o'
ParseReadLine (98): '   rm -f $*.o'
ParseReadLine (101): '.f:'
ParseDoDependency(.f:)
ParseReadLine (102): '  ${LINK.f} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}'
ParseReadLine (103): '.f.o:'
ParseDoDependency(.f.o:)
ParseReadLine (104): '  ${COMPILE.f} ${.IMPSRC}'
ParseReadLine (105): '.f.a:'
ParseDoDependency(.f.a:)
ParseReadLine (106): '  ${COMPILE.f} ${.IMPSRC}'
ParseReadLine (107): '  ${AR} ${ARFLAGS} $@ $*.o'
ParseReadLine (108): '  rm -f $*.o'
ParseReadLine (110): '.F:'
ParseDoDependency(.F:)
ParseReadLine (111): '  ${LINK.F} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}'
ParseReadLine (112): '.F.o:'
ParseDoDependency(.F.o:)
ParseReadLine (113): '  ${COMPILE.F} ${.IMPSRC}'
ParseReadLine (114): '.F.a:'
ParseDoDependency(.F.a:)
ParseReadLine (115): '  ${COMPILE.F} ${.IMPSRC}'
ParseReadLine (116): '  ${AR} ${ARFLAGS} $@ $*.o'
ParseReadLine (117): '  rm -f $*.o'
ParseReadLine (119): '.r:'
ParseDoDependency(.r:)
ParseReadLine (120): '  ${LINK.r} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}'
ParseReadLine (121): '.r.o:'
ParseDoDependency(.r.o:)
ParseReadLine (122): '  ${COMPILE.r} ${.IMPSRC}'
ParseReadLine (123): '.r.a:'
ParseDoDependency(.r.a:)
ParseReadLine (124): '  ${COMPILE.r} ${.IMPSRC}'
ParseReadLine (125): '  ${AR} ${ARFLAGS} $@ $*.o'
ParseReadLine (126): '  rm -f $*.o'
ParseReadLine (129): '.p:'
ParseDoDependency(.p:)
ParseReadLine (130): '  ${LINK.p} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}'
ParseReadLine (131): '.p.o:'
ParseDoDependency(.p.o:)
ParseReadLine (132): '  ${COMPILE.p} ${.IMPSRC}'
ParseReadLine (133): '.p.a:'
ParseDoDependency(.p.a:)
ParseReadLine (134): '  ${COMPILE.p} ${.IMPSRC}'
ParseReadLine (135): '  ${AR} ${ARFLAGS} $@ $*.o'
ParseReadLine (136): '  rm -f $*.o'
ParseReadLine (139): '.s:'
ParseDoDependency(.s:)
ParseReadLine (140): '  ${LINK.s} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}'
ParseReadLine (141): '.s.o:'
ParseDoDependency(.s.o:)
ParseReadLine (142): '  ${COMPILE.s} -o ${.TARGET} ${.IMPSRC}'
ParseReadLine (143): '.s.a:'
ParseDoDependency(.s.a:)
ParseReadLine (144): '  ${COMPILE.s} ${.IMPSRC}'
ParseReadLine (145): '  ${AR} ${ARFLAGS} $@ $*.o'
ParseReadLine (146): '  rm -f $*.o'
ParseReadLine (147): '.S:'
ParseDoDependency(.S:)
ParseReadLine (148): '  ${LINK.S} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}'
ParseReadLine (149): '.S.o:'
ParseDoDependency(.S.o:)
ParseReadLine (150): '  ${COMPILE.S} ${.IMPSRC}'
ParseReadLine (151): '.S.a:'
ParseDoDependency(.S.a:)
ParseReadLine (152): '  ${COMPILE.S} ${.IMPSRC}'
ParseReadLine (153): '  ${AR} ${ARFLAGS} $@ $*.o'
ParseReadLine (154): '  rm -f $*.o'
ParseReadLine (157): '.l:'
ParseDoDependency(.l:)
ParseReadLine (158): '  ${LEX.l} ${.IMPSRC}'
ParseReadLine (159): '  ${LINK.c} -o ${.TARGET} lex.yy.c ${LDLIBS} -ll'
ParseReadLine (160): '  rm -f lex.yy.c'
ParseReadLine (161): '.l.c:'
ParseDoDependency(.l.c:)
ParseReadLine (162): '  ${LEX.l} ${.IMPSRC}'
ParseReadLine (163): '  mv lex.yy.c ${.TARGET}'
ParseReadLine (164): '.l.o:'
ParseDoDependency(.l.o:)
ParseReadLine (165): '  ${LEX.l} ${.IMPSRC}'
ParseReadLine (166): '  ${COMPILE.c} -o ${.TARGET} lex.yy.c'
ParseReadLine (167): '  rm -f lex.yy.c'
ParseReadLine (170): '.y:'
ParseDoDependency(.y:)
ParseReadLine (171): '  ${YACC.y} ${.IMPSRC}'
ParseReadLine (172): '  ${LINK.c} -o ${.TARGET} y.tab.c ${LDLIBS}'
ParseReadLine (173): '  rm -f y.tab.c'
ParseReadLine (174): '.y.c:'
ParseDoDependency(.y.c:)
ParseReadLine (175): '  ${YACC.y} ${.IMPSRC}'
ParseReadLine (176): '  mv y.tab.c ${.TARGET}'
ParseReadLine (177): '.y.o:'
ParseDoDependency(.y.o:)
ParseReadLine (178): '  ${YACC.y} ${.IMPSRC}'
ParseReadLine (179): '  ${COMPILE.c} -o ${.TARGET} y.tab.c'
ParseReadLine (180): '  rm -f y.tab.c'
ParseReadLine (183): '.sh:'
ParseDoDependency(.sh:)
ParseReadLine (184): '  rm -f ${.TARGET}'
ParseReadLine (185): '  cp ${.IMPSRC} ${.TARGET}'
ParseEOF: returning to file ./mk/sys.mk, line 54
Global:.PARSEDIR = ./mk
Global:.PARSEFILE = sys.mk
ParseSetParseFile: ${.PARSEDIR} = `./mk' ${.PARSEFILE} = `sys.mk'
ParseReadLine (55): '_sys_mk := ${.MAKE.MAKEFILES:M*/${:UMINGW64}.mk}'
Applying[.MAKE.MAKEFILES] :M to "./mk/sys.mk ./mk/sys.debug.mk ./mk/sys.vars.mk ./mk/host-target.mk ./mk/sys/MINGW64.mk"
Applying[] :U to ""
Result[] of :U is "MINGW64"
Pattern[.MAKE.MAKEFILES] for [./mk/sys.mk ./mk/sys.debug.mk ./mk/sys.vars.mk ./mk/host-target.mk ./mk/sys/MINGW64.mk] is [*/MINGW64.mk]
VarMatch [./mk/sys.mk] [*/MINGW64.mk]
VarMatch [./mk/sys.debug.mk] [*/MINGW64.mk]
VarMatch [./mk/sys.vars.mk] [*/MINGW64.mk]
VarMatch [./mk/host-target.mk] [*/MINGW64.mk]
VarMatch [./mk/sys/MINGW64.mk] [*/MINGW64.mk]
Result[.MAKE.MAKEFILES] of :M is "./mk/sys/MINGW64.mk"
Global:_sys_mk = ./mk/sys/MINGW64.mk
ParseReadLine (57): '_sys_mk := sys/${_sys_mk:T}'
Applying[_sys_mk] :T to "./mk/sys/MINGW64.mk"
Result[_sys_mk] of :T is "MINGW64.mk"
Global:_sys_mk = sys/MINGW64.mk
ParseEOF: returning to file ./mk/sys.mk, line 65
Global:.PARSEDIR = ./mk
Global:.PARSEFILE = sys.mk
ParseSetParseFile: ${.PARSEDIR} = `./mk' ${.PARSEFILE} = `sys.mk'
ParseReadLine (67): 'SYS_OS_MK := ${_sys_mk}'
Global:SYS_OS_MK =
Global:SYS_OS_MK = sys/MINGW64.mk
ParseReadLine (68): '.export SYS_OS_MK'
Global:.MAKE.EXPORTED = _HOST_OSNAME _HOST_OSREL _HOST_MACHINE _HOST_ARCH HOST_MACHINE SYS_OS_MK
ParseReadLine (74): 'OPTIONS_DEFAULT_NO +=  DIRDEPS_BUILD  DIRDEPS_CACHE'
Global:OPTIONS_DEFAULT_NO = DIRDEPS_BUILD  DIRDEPS_CACHE
ParseReadLine (80): 'OPTIONS_DEFAULT_DEPENDENT +=  AUTO_OBJ/DIRDEPS_BUILD  META_MODE/DIRDEPS_BUILD  STAGING/DIRDEPS_BUILD'
Global:OPTIONS_DEFAULT_DEPENDENT = AUTO_OBJ/DIRDEPS_BUILD  META_MODE/DIRDEPS_BUILD  STAGING/DIRDEPS_BUILD
ParseReadLine (81): '.-include <options.mk>'
Searching for options.mk ...
   ./mk ...
   returning ./mk/options.mk
Global:.INCLUDEDFROMFILE = sys.mk
Global:.INCLUDEDFROMDIR = ./mk
ParseSetIncludedFile: ${.INCLUDEDFROMDIR} = `./mk' ${.INCLUDEDFROMFILE} = `sys.mk'
Global:.MAKE.MAKEFILES = ./mk/sys.mk ./mk/sys.debug.mk ./mk/sys.vars.mk ./mk/host-target.mk ./mk/sys/MINGW64.mk ./mk/options.mk
Parse_SetInput: file ./mk/options.mk, line 0, fd -1, nextbuf 00000000004120A0, arg 00000000003060A0
Global:.PARSEDIR = ./mk
Global:.PARSEFILE = options.mk
ParseSetParseFile: ${.PARSEDIR} = `./mk' ${.PARSEFILE} = `options.mk'
ParseReadLine (30): 'OPTIONS_DEFAULT_VALUES +=  ${OPTIONS_DEFAULT_NO:O:u:S,$,/no,}  ${OPTIONS_DEFAULT_YES:O:u:S,$,/yes,}'
Global:OPTIONS_DEFAULT_VALUES = ${OPTIONS_DEFAULT_NO:O:u:S,$,/no,}  ${OPTIONS_DEFAULT_YES:O:u:S,$,/yes,}
ParseReadLine (32): 'OPTION_PREFIX ?= MK_'
Global:OPTION_PREFIX = MK_
Applying[OPTIONS_DEFAULT_NO] :O to "DIRDEPS_BUILD  DIRDEPS_CACHE"
Result[OPTIONS_DEFAULT_NO] of :O is "DIRDEPS_BUILD DIRDEPS_CACHE"
Applying[OPTIONS_DEFAULT_NO] :u to "DIRDEPS_BUILD DIRDEPS_CACHE"
Result[OPTIONS_DEFAULT_NO] of :u is "DIRDEPS_BUILD DIRDEPS_CACHE"
Applying[OPTIONS_DEFAULT_NO] :S to "DIRDEPS_BUILD DIRDEPS_CACHE"
Modifier pattern: ""
Modifier pattern: "/no"
Result[OPTIONS_DEFAULT_NO] of :S is "DIRDEPS_BUILD/no DIRDEPS_CACHE/no"
Applying[OPTIONS_DEFAULT_YES] :O to ""
Result[OPTIONS_DEFAULT_YES] of :O is ""
Applying[OPTIONS_DEFAULT_YES] :u to ""
Result[OPTIONS_DEFAULT_YES] of :u is ""
Applying[OPTIONS_DEFAULT_YES] :S to ""
Modifier pattern: ""
Modifier pattern: "/yes"
Result[OPTIONS_DEFAULT_YES] of :S is "/yes"
Applying[OPTIONS_DEFAULT_VALUES] :M to "DIRDEPS_BUILD/no DIRDEPS_CACHE/no  "
Pattern[OPTIONS_DEFAULT_VALUES] for [DIRDEPS_BUILD/no DIRDEPS_CACHE/no  ] is [*/*]
VarMatch [DIRDEPS_BUILD/no] [*/*]
VarMatch [DIRDEPS_CACHE/no] [*/*]
Result[OPTIONS_DEFAULT_VALUES] of :M is "DIRDEPS_BUILD/no DIRDEPS_CACHE/no"
Parse_SetInput: file ./mk/options.mk, line 38, fd -1, nextbuf 000000000040BA60, arg 0000000000305550
Global:.PARSEDIR = ./mk
Global:.PARSEFILE = options.mk
ParseSetParseFile: ${.PARSEDIR} = `./mk' ${.PARSEFILE} = `options.mk'
Applying[] :U to ""
Result[] of :U is "DIRDEPS_BUILD/no"
Applying[] :H to "DIRDEPS_BUILD/no"
Result[] of :H is "DIRDEPS_BUILD"
Applying[] :U to ""
Result[] of :U is "DIRDEPS_BUILD/no"
Applying[] :H to "DIRDEPS_BUILD/no"
Result[] of :H is "DIRDEPS_BUILD"
Applying[] :U to ""
Result[] of :U is "DIRDEPS_BUILD/no"
Applying[] :H to "DIRDEPS_BUILD/no"
Result[] of :H is "DIRDEPS_BUILD"
Applying[] :U to ""
Result[] of :U is "DIRDEPS_BUILD/no"
Applying[] :H to "DIRDEPS_BUILD/no"
Result[] of :H is "DIRDEPS_BUILD"
Applying[] :U to ""
Result[] of :U is "DIRDEPS_BUILD/no"
Applying[] :T to "DIRDEPS_BUILD/no"
Result[] of :T is "no"
Applying[] :t to "no"
Result[] of :t is "no"
lhs = "no", rhs = "no", op = ==
Applying[] :U to ""
Result[] of :U is "DIRDEPS_BUILD/no"
Applying[] :H to "DIRDEPS_BUILD/no"
Result[] of :H is "DIRDEPS_BUILD"
ParseReadLine (48): '${OPTION_PREFIX}${:UDIRDEPS_BUILD/no:H} ?= no'
Applying[] :U to ""
Result[] of :U is "DIRDEPS_BUILD/no"
Applying[] :H to "DIRDEPS_BUILD/no"
Result[] of :H is "DIRDEPS_BUILD"
Applying[] :U to ""
Result[] of :U is "DIRDEPS_BUILD/no"
Applying[] :H to "DIRDEPS_BUILD/no"
Result[] of :H is "DIRDEPS_BUILD"
Global:MK_DIRDEPS_BUILD = no
Applying[] :U to ""
Result[] of :U is "DIRDEPS_CACHE/no"
Applying[] :H to "DIRDEPS_CACHE/no"
Result[] of :H is "DIRDEPS_CACHE"
Applying[] :U to ""
Result[] of :U is "DIRDEPS_CACHE/no"
Applying[] :H to "DIRDEPS_CACHE/no"
Result[] of :H is "DIRDEPS_CACHE"
Applying[] :U to ""
Result[] of :U is "DIRDEPS_CACHE/no"
Applying[] :H to "DIRDEPS_CACHE/no"
Result[] of :H is "DIRDEPS_CACHE"
Applying[] :U to ""
Result[] of :U is "DIRDEPS_CACHE/no"
Applying[] :H to "DIRDEPS_CACHE/no"
Result[] of :H is "DIRDEPS_CACHE"
Applying[] :U to ""
Result[] of :U is "DIRDEPS_CACHE/no"
Applying[] :T to "DIRDEPS_CACHE/no"
Result[] of :T is "no"
Applying[] :t to "no"
Result[] of :t is "no"
lhs = "no", rhs = "no", op = ==
Applying[] :U to ""
Result[] of :U is "DIRDEPS_CACHE/no"
Applying[] :H to "DIRDEPS_CACHE/no"
Result[] of :H is "DIRDEPS_CACHE"
ParseReadLine (48): '${OPTION_PREFIX}${:UDIRDEPS_CACHE/no:H} ?= no'
Applying[] :U to ""
Result[] of :U is "DIRDEPS_CACHE/no"
Applying[] :H to "DIRDEPS_CACHE/no"
Result[] of :H is "DIRDEPS_CACHE"
Applying[] :U to ""
Result[] of :U is "DIRDEPS_CACHE/no"
Applying[] :H to "DIRDEPS_CACHE/no"
Result[] of :H is "DIRDEPS_CACHE"
Global:MK_DIRDEPS_CACHE = no
ParseEOF: returning to file ./mk/options.mk, line 59
Global:.PARSEDIR = ./mk
Global:.PARSEFILE = options.mk
ParseSetParseFile: ${.PARSEDIR} = `./mk' ${.PARSEFILE} = `options.mk'
Applying[OPTIONS_DEFAULT_DEPENDENT] :M to "AUTO_OBJ/DIRDEPS_BUILD  META_MODE/DIRDEPS_BUILD  STAGING/DIRDEPS_BUILD"
Pattern[OPTIONS_DEFAULT_DEPENDENT] for [AUTO_OBJ/DIRDEPS_BUILD  META_MODE/DIRDEPS_BUILD  STAGING/DIRDEPS_BUILD] is [*/*]
VarMatch [AUTO_OBJ/DIRDEPS_BUILD] [*/*]
VarMatch [META_MODE/DIRDEPS_BUILD] [*/*]
VarMatch [STAGING/DIRDEPS_BUILD] [*/*]
Result[OPTIONS_DEFAULT_DEPENDENT] of :M is "AUTO_OBJ/DIRDEPS_BUILD META_MODE/DIRDEPS_BUILD STAGING/DIRDEPS_BUILD"
Applying[OPTIONS_DEFAULT_DEPENDENT] :O to "AUTO_OBJ/DIRDEPS_BUILD META_MODE/DIRDEPS_BUILD STAGING/DIRDEPS_BUILD"
Result[OPTIONS_DEFAULT_DEPENDENT] of :O is "AUTO_OBJ/DIRDEPS_BUILD META_MODE/DIRDEPS_BUILD STAGING/DIRDEPS_BUILD"
Applying[OPTIONS_DEFAULT_DEPENDENT] :u to "AUTO_OBJ/DIRDEPS_BUILD META_MODE/DIRDEPS_BUILD STAGING/DIRDEPS_BUILD"
Result[OPTIONS_DEFAULT_DEPENDENT] of :u is "AUTO_OBJ/DIRDEPS_BUILD META_MODE/DIRDEPS_BUILD STAGING/DIRDEPS_BUILD"
Parse_SetInput: file ./mk/options.mk, line 64, fd -1, nextbuf 000000000040BA60, arg 000000000031F640
Global:.PARSEDIR = ./mk
Global:.PARSEFILE = options.mk
ParseSetParseFile: ${.PARSEDIR} = `./mk' ${.PARSEFILE} = `options.mk'
Applying[] :U to ""
Result[] of :U is "AUTO_OBJ/DIRDEPS_BUILD"
Applying[] :H to "AUTO_OBJ/DIRDEPS_BUILD"
Result[] of :H is "AUTO_OBJ"
Applying[] :U to ""
Result[] of :U is "AUTO_OBJ/DIRDEPS_BUILD"
Applying[] :H to "AUTO_OBJ/DIRDEPS_BUILD"
Result[] of :H is "AUTO_OBJ"
Applying[] :U to ""
Result[] of :U is "AUTO_OBJ/DIRDEPS_BUILD"
Applying[] :H to "AUTO_OBJ/DIRDEPS_BUILD"
Result[] of :H is "AUTO_OBJ"
Applying[] :U to ""
Result[] of :U is "AUTO_OBJ/DIRDEPS_BUILD"
Applying[] :H to "AUTO_OBJ/DIRDEPS_BUILD"
Result[] of :H is "AUTO_OBJ"
Applying[] :U to ""
Result[] of :U is "AUTO_OBJ/DIRDEPS_BUILD"
Applying[] :H to "AUTO_OBJ/DIRDEPS_BUILD"
Result[] of :H is "AUTO_OBJ"
Applying[] :U to ""
Result[] of :U is "AUTO_OBJ/DIRDEPS_BUILD"
Applying[] :H to "AUTO_OBJ/DIRDEPS_BUILD"
Result[] of :H is "AUTO_OBJ"
ParseReadLine (75): '${OPTION_PREFIX}${:UAUTO_OBJ/DIRDEPS_BUILD:H} ?= ${${OPTION_PREFIX}${:UAUTO_OBJ/DIRDEPS_BUILD:T}}'
Applying[] :U to ""
Result[] of :U is "AUTO_OBJ/DIRDEPS_BUILD"
Applying[] :H to "AUTO_OBJ/DIRDEPS_BUILD"
Result[] of :H is "AUTO_OBJ"
Applying[] :U to ""
Result[] of :U is "AUTO_OBJ/DIRDEPS_BUILD"
Applying[] :H to "AUTO_OBJ/DIRDEPS_BUILD"
Result[] of :H is "AUTO_OBJ"
Global:MK_AUTO_OBJ = ${${OPTION_PREFIX}${:UAUTO_OBJ/DIRDEPS_BUILD:T}}
Applying[] :U to ""
Result[] of :U is "META_MODE/DIRDEPS_BUILD"
Applying[] :H to "META_MODE/DIRDEPS_BUILD"
Result[] of :H is "META_MODE"
Applying[] :U to ""
Result[] of :U is "META_MODE/DIRDEPS_BUILD"
Applying[] :H to "META_MODE/DIRDEPS_BUILD"
Result[] of :H is "META_MODE"
Applying[] :U to ""
Result[] of :U is "META_MODE/DIRDEPS_BUILD"
Applying[] :H to "META_MODE/DIRDEPS_BUILD"
Result[] of :H is "META_MODE"
Applying[] :U to ""
Result[] of :U is "META_MODE/DIRDEPS_BUILD"
Applying[] :H to "META_MODE/DIRDEPS_BUILD"
Result[] of :H is "META_MODE"
Applying[] :U to ""
Result[] of :U is "META_MODE/DIRDEPS_BUILD"
Applying[] :H to "META_MODE/DIRDEPS_BUILD"
Result[] of :H is "META_MODE"
Applying[] :U to ""
Result[] of :U is "META_MODE/DIRDEPS_BUILD"
Applying[] :H to "META_MODE/DIRDEPS_BUILD"
Result[] of :H is "META_MODE"
ParseReadLine (75): '${OPTION_PREFIX}${:UMETA_MODE/DIRDEPS_BUILD:H} ?= ${${OPTION_PREFIX}${:UMETA_MODE/DIRDEPS_BUILD:T}}'
Applying[] :U to ""
Result[] of :U is "META_MODE/DIRDEPS_BUILD"
Applying[] :H to "META_MODE/DIRDEPS_BUILD"
Result[] of :H is "META_MODE"
Applying[] :U to ""
Result[] of :U is "META_MODE/DIRDEPS_BUILD"
Applying[] :H to "META_MODE/DIRDEPS_BUILD"
Result[] of :H is "META_MODE"
Global:MK_META_MODE = ${${OPTION_PREFIX}${:UMETA_MODE/DIRDEPS_BUILD:T}}
Applying[] :U to ""
Result[] of :U is "STAGING/DIRDEPS_BUILD"
Applying[] :H to "STAGING/DIRDEPS_BUILD"
Result[] of :H is "STAGING"
Applying[] :U to ""
Result[] of :U is "STAGING/DIRDEPS_BUILD"
Applying[] :H to "STAGING/DIRDEPS_BUILD"
Result[] of :H is "STAGING"
Applying[] :U to ""
Result[] of :U is "STAGING/DIRDEPS_BUILD"
Applying[] :H to "STAGING/DIRDEPS_BUILD"
Result[] of :H is "STAGING"
Applying[] :U to ""
Result[] of :U is "STAGING/DIRDEPS_BUILD"
Applying[] :H to "STAGING/DIRDEPS_BUILD"
Result[] of :H is "STAGING"
Applying[] :U to ""
Result[] of :U is "STAGING/DIRDEPS_BUILD"
Applying[] :H to "STAGING/DIRDEPS_BUILD"
Result[] of :H is "STAGING"
Applying[] :U to ""
Result[] of :U is "STAGING/DIRDEPS_BUILD"
Applying[] :H to "STAGING/DIRDEPS_BUILD"
Result[] of :H is "STAGING"
ParseReadLine (75): '${OPTION_PREFIX}${:USTAGING/DIRDEPS_BUILD:H} ?= ${${OPTION_PREFIX}${:USTAGING/DIRDEPS_BUILD:T}}'
Applying[] :U to ""
Result[] of :U is "STAGING/DIRDEPS_BUILD"
Applying[] :H to "STAGING/DIRDEPS_BUILD"
Result[] of :H is "STAGING"
Applying[] :U to ""
Result[] of :U is "STAGING/DIRDEPS_BUILD"
Applying[] :H to "STAGING/DIRDEPS_BUILD"
Result[] of :H is "STAGING"
Global:MK_STAGING = ${${OPTION_PREFIX}${:USTAGING/DIRDEPS_BUILD:T}}
ParseEOF: returning to file ./mk/options.mk, line 79
Global:.PARSEDIR = ./mk
Global:.PARSEFILE = options.mk
ParseSetParseFile: ${.PARSEDIR} = `./mk' ${.PARSEFILE} = `options.mk'
ParseEOF: returning to file ./mk/sys.mk, line 81
Global:.PARSEDIR = ./mk
Global:.PARSEFILE = sys.mk
ParseSetParseFile: ${.PARSEDIR} = `./mk' ${.PARSEFILE} = `sys.mk'
Applying[MK_DIRDEPS_BUILD] :U to "no"
Result[MK_DIRDEPS_BUILD] of :U is "no"
lhs = "no", rhs = "yes", op = ==
Applying[] :U to ""
Result[] of :U is "META_MODE/DIRDEPS_BUILD"
Applying[] :T to "META_MODE/DIRDEPS_BUILD"
Result[] of :T is "DIRDEPS_BUILD"
Applying[MK_META_MODE] :U to "no"
Result[MK_META_MODE] of :U is "no"
lhs = "no", rhs = "yes", op = ==
ParseReadLine (90): '.MAKE.MODE ?= normal'
Global:.MAKE.MODE = normal
Applying[] :U to ""
Result[] of :U is "AUTO_OBJ/DIRDEPS_BUILD"
Applying[] :T to "AUTO_OBJ/DIRDEPS_BUILD"
Result[] of :T is "DIRDEPS_BUILD"
Applying[MK_AUTO_OBJ] :U to "no"
Result[MK_AUTO_OBJ] of :U is "no"
lhs = "no", rhs = "yes", op = ==
Applying[MKOBJDIRS] :U to ""
Result[MKOBJDIRS] of :U is "no"
lhs = "no", rhs = "auto", op = ==
ParseReadLine (106): 'MACHINE_ARCH.host ?= ${_HOST_ARCH}'
Global:MACHINE_ARCH.host = ${_HOST_ARCH}
ParseReadLine (107): 'MACHINE_ARCH.${MACHINE} ?= ${MACHINE}'
Global:MACHINE_ARCH.x86_64 = ${MACHINE}
ParseReadLine (117): 'unix ?= We run ${_HOST_OSNAME}.'
ParseReadLine (131): 'Mkdirs= Mkdirs() {  for d in $$*; do  for i in 1 2 3 4 5 6; do  mkdir -p $$d;  test -d $$d && return 0;  done;  mkdir $$d || exit $$?;  done; }'
Global:Mkdirs = Mkdirs() {  for d in $$*; do  for i in 1 2 3 4 5 6; do  mkdir -p $$d;  test -d $$d && return 0;  done;  mkdir $$d || exit $$?;  done; }
ParseReadLine (134): '.SUFFIXES:      .cpp-out'
ParseDoDependency(.SUFFIXES:      .cpp-out)
ParseReadLine (136): '.c.cpp-out:'
ParseDoDependency(.c.cpp-out:)
ParseReadLine (137): '  @${COMPILE.c:N-c} -E ${.IMPSRC} | grep -v '^[   ]*$$''
ParseReadLine (139): '${CXX_SUFFIXES:%=%.cpp-out}:'
Applying[CXX_SUFFIXES] :% to ".C .cc .cpp .cxx"
Modifier pattern: "%"
Modifier pattern: "%.cpp-out"
Result[CXX_SUFFIXES] of :% is ".C.cpp-out .cc.cpp-out .cpp.cpp-out .cxx.cpp-out"
ParseDoDependency(.C.cpp-out .cc.cpp-out .cpp.cpp-out .cxx.cpp-out:)
ParseReadLine (140): '  @${COMPILE.cc:N-c} -E ${.IMPSRC} | grep -v '^[  ]*$$''
ParseReadLine (143): '.-include <local.sys.mk>'
Searching for local.sys.mk ...
   ./mk ...
   failed.
Global:delete .PARSEDIR
Global:delete .PARSEFILE
Global:delete .INCLUDEDFROMDIR
Global:delete .INCLUDEDFROMFILE
Internal:MAKEFILE = makefile
Global:.MAKE.MAKEFILES = ./mk/sys.mk ./mk/sys.debug.mk ./mk/sys.vars.mk ./mk/host-target.mk ./mk/sys/MINGW64.mk ./mk/options.mk makefile
Parse_SetInput: file makefile, line 0, fd -1, nextbuf 00000000004120A0, arg 0000000000302250
Global:.PARSEDIR = C:/msys64/home/ofry/bmake
Global:.PARSEFILE = makefile
ParseSetParseFile: ${.PARSEDIR} = `C:/msys64/home/ofry/bmake' ${.PARSEFILE} = `makefile'
ParseReadLine (6): 'prefix= /mingw64'
Global:prefix = /mingw64
ParseReadLine (7): 'srcdir= /home/ofry/bmake'
Global:srcdir = /home/ofry/bmake
ParseReadLine (9): 'all: build'
ParseDoDependency(all: build)
Global:.ALLTARGETS =  all
Global:.ALLTARGETS =  all build
# ParseLinkSrc: added child all - build
# all, flags 0, type 1, made 0
# build, flags 0, type 0, made 0
ParseReadLine (11): 'build clean install test:'
ParseDoDependency(build clean install test:)
Global:.ALLTARGETS =  all build clean
Global:.ALLTARGETS =  all build clean install
Global:.ALLTARGETS =  all build clean install test
ParseReadLine (12): '   ${srcdir}/boot-strap --prefix=${prefix} -o . op=$@'
Global:delete .PARSEDIR
Global:delete .PARSEFILE
Global:delete .INCLUDEDFROMDIR (not found)
Global:delete .INCLUDEDFROMFILE (not found)
Applying[.MAKE.DEPENDFILE] :T to ".depend"
Result[.MAKE.DEPENDFILE] of :T is ".depend"
Searching for .depend ...
   failed.
Searching for .depend ...
   ./mk ...
   failed.
Applying[.MAKE.MODE] :t to "normal"
Result[.MAKE.MODE] of :t is "normal"
Global:MFLAGS =   -d cCdepvg2 -m ./mk
Applying[.MAKEOVERRIDES] :O to " .MAKE.LEVEL.ENV"
Result[.MAKEOVERRIDES] of :O is ".MAKE.LEVEL.ENV"
Applying[.MAKEOVERRIDES] :u to ".MAKE.LEVEL.ENV"
Result[.MAKEOVERRIDES] of :u is ".MAKE.LEVEL.ENV"
Applying[.MAKEOVERRIDES] :@ to ".MAKE.LEVEL.ENV"
Modifier pattern: "v"
Modifier pattern: "$v=${$v:Q}"
Command:v = .MAKE.LEVEL.ENV
Applying[.MAKE.LEVEL.ENV] :Q to "MAKELEVEL"
QuoteMeta: [MAKELEVEL]
Result[.MAKE.LEVEL.ENV] of :Q is "MAKELEVEL"
Command:delete v
Result[.MAKEOVERRIDES] of :@ is ".MAKE.LEVEL.ENV=MAKELEVEL"
Global:.INCLUDES =
Global:.LIBS =
Global:.TARGETS =  all

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.

Breakpoint 1, 0x00007ffc6072c140 in msvcrt!_exit ()
   from C:\Windows\system32\msvcrt.dll
(gdb) bt full
#0  0x00007ffc6072c140 in msvcrt!_exit () from C:\Windows\system32\msvcrt.dll
No symbol table info available.
#1  0x00007ffc60729a70 in msvcrt!abort () from C:\Windows\system32\msvcrt.dll
No symbol table info available.
#2  0x000000000043702b in sigprocmask.cold ()
    at C:/msys64/home/ofry/bmake/util.c:2433
        received = {0, 0, -818542143, 34067, -564705481, 37633, 2355648, 0,
          0, 0, 1627798935, 32764, 3281376, 0, 4438693, 0, 0, 0, 3146432, 0,
          0, 0, -818542287}
        sig = 2
        new_blocked_set = <optimized out>
        to_unblock = 6334740
        to_block = <optimized out>
#3  0x000000000042db8a in sigaction (sig=<optimized out>, sig@entry=2,
    act=act@entry=0x23f220, oact=oact@entry=0x23f230)
    at C:/msys64/home/ofry/bmake/util.c:2633
        mask = 8388543
        oldmask = 0
        saved_errno = <optimized out>
#4  0x000000000042ddc7 in bmake_signal (s=s@entry=2, a=a@entry=0x1)
    at C:/msys64/home/ofry/bmake/util.c:1495
        sa = {_sa_func = {_sa_handler = 0x1, _sa_sigaction = 0x1},
          sa_mask = 0, sa_flags = 4}
        osa = {_sa_func = {_sa_handler = 0x42bfb0 <blocked_handler>,
            _sa_sigaction = 0x42bfb0 <blocked_handler>}, sa_mask = 0,
          sa_flags = 3}
#5  0x000000000040807d in Compat_Run (targs=targs@entry=0x300440)
    at C:/msys64/home/ofry/bmake/compat.c:720
        gn = 0x0
        errors = <optimized out>
#6  0x0000000000436dd6 in runTargets ()
    at C:/msys64/home/ofry/bmake/main.c:985
        targs = 0x300440
        outOfDate = <optimized out>
        targs = <optimized out>
        outOfDate = <optimized out>
#7  main (argc=4, argv=<optimized out>)
    at C:/msys64/home/ofry/bmake/main.c:1525
        outOfDate = <optimized out>
        sb = {st_dev = 2, st_ino = 0, st_mode = 16895, st_nlink = 1,
          st_uid = 0, st_gid = 0, st_rdev = 2, st_size = 0,
          st_atime = 1578630665, st_mtime = 1578630665, st_ctime = 1570778959}
        sa = {st_dev = 2, st_ino = 0, st_mode = 16895, st_nlink = 1,
          st_uid = 0, st_gid = 0, st_rdev = 2, st_size = 0,
          st_atime = 1578630665, st_mtime = 1578630665, st_ctime = 1570778959}
        p1 = 0x0
        path = <optimized out>
        mdpath = "\001\000\000\001\000\000\000\000▒\001\004▒\000\000\000\000▒\003", '\000' <repeats 14 times>, "▒▒h\000\000\000\000\000▒▒\002a\001\000\000\000\006\000\000\000\177\000\000\000▒\004\000\000\000\000\000\000▒\001\000\000\000\000\000\000▒▒h\000\000\000\000\000J\000\000\000\000\000\000\000▒\002▒\000\000\000\000\000▒\001\000\000\000\000\000\000\177\000\000\000\000\000\000\000\006\000\000\000\000\000\000\000o\000\000\000\000\000\000\000▒\001\004▒\000\000\000\000.2\003a▒\177\000\000\002\000\004\006\000\000\000\000\034\006\000\000\000\000\000\000`\030▒", '\000' <repeats 13 times>, "o\000\000\000\000\000\000\000o\000\000\000\000\000\000\000\000\027▒", '\000' <repeats 14 times>...
        machine = <optimized out>
        machine_arch = <optimized out>
        syspath = <optimized out>
        sysMkPath = <optimized out>
        cp = <optimized out>
        start = <optimized out>
        defsyspath = "C\000/msys64/share/mk"
        found_path = "\000\000\000\000\000\000\000\000▒\027▒\000\001\000\000\000 ▒h\000\000\000\000\000`\000\000\000\000\000\000\000▒▒h\000\000\000\000\000\000\030▒\000\000\000\000\000P\001h\000\000\000\000\000\020\035\000\000\000\000\000\000\177\000\000\000\000\000\000\000▒\001\004▒\001\000\000\000w▒▒▒-\000\000\000▒\001\004▒\000\000\000\000▒\001\004▒\000\000\000\000H\000\000\000\000\000\000\000\004\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000g\000\000\000\000\000\000\000▒▒\002a▒\177\000\000g\000\000\000\000\000\000\000▒\002▒\000\000\000\000\000c\001\000P\000\000\000\000\000\000▒\000\000\000\000\000\004\000\000\000\000\000\000\000g\000\000\000\000\000\000\000▒\030▒\000\000\000\000\000"...
        rightnow = {tv_sec = 1578633712, tv_usec = 579252}
        utsname = {
          nodename = "localhost\000\000\000\000\000\000\000▒\027▒\000\000\000\000\000\000\000▒", '\000' <repeats 13 times>, "\020\020▒`▒\177\000\000\000\000▒\000\000\000\000\000\062;\017a▒\177\000\000\000\000▒", '\000' <repeats 15 times>, "▒\000\000\000\000\000c\000\000P", '\000' <repeats 38 times>, "▒\000\000\000\000\000\004\000\a\003▒\177\000\000\005", '\000' <repeats 17 times>, "▒\000\000\000\000\000c\001\000P\000\000\000\000b\000\000@\000\000\000\000`\000\000@\000\000\000\000▒\030▒\000\000\000\000\000"...,
          sysname = "MINGW32_NT-6.3\000\000\001\000\000\000\000\000\000\000▒\na▒\177\000\000\000\000▒\000\000\000\000\000c\001\000P\000\000\000\000\000\000▒\000\000\000\000\000\020\000\000\000\000\000\000\000\000\000▒\000\000\000\000\000c\000\000P", '\000' <repeats 32 times>, "▒\177", '\000' <repeats 66 times>, "H", '\000' <repeats 15 times>, "p\004\000\000\000\000\000\000"...,
          release = "Windows 6.3\000▒\177", '\000' <repeats 18 times>, "\033\000\020\000▒\037\000\000\063\000\000\000\000\000\000\000\060\000\000\000\000\000\000\000x▒#\000\000\000\000\000\020▒#\000\000\000\000\000J2P^▒\177", '\000' <repeats 26 times>, "\060\000\000\000\000\000\000\000\032\002", '\000' <repeats 16 times>, "@\000\000\000\000\000▒\000\000\000\000\000\000\001\000\000\034\000\000\000\000\000▒_\005a▒\177\000\000\000\000\000\000\000\000\000\000\020\020▒`▒\177\000\000\060\001C", '\000' <repeats 21 times>...,
          version = "\000\000@\000\000\000\000\000\000\000\034\000\000\000\000\000\000\000\000\001\000\000\000\000p\000r\000\000\000\000\000\070▒#\000\000\000\000\000\\\000D\000e\000v\000i\000c\000e\000\\\000H\000a\000r\000d\000d\000i\000s\000k\000V\000o\000l\000u\000m\000e\000\064\000\\\000m\000s\000y\000s\000\000\000▒\000\000\000\000\000▒\023▒\000\000\000\000\000\000\001\000\000\000\000\000\000@▒\ra▒\177\000\000k\000e\000\\\000b\000m\000a\000k\000e\000.\000e\000x\000e\000\000\000▒`▒\177\000\000\000\000▒\000\000\000\000\000▒\023▒\000\000\000\000\000\000\001\000\000\000\000\000\000@▒\ra▒\177\000\000▒\022▒\000\000\000\000\000"...,
          machine = "x86_64\000\000a\000\000P\000\000\000\000\000\000▒\000\000\000\000\000\030\000\000\000\000\000\000\000\000\000▒\000\000\000\000\000\023\000\a\024\000\000\000\000\000\001\000\000\000\000\000\000▒8\017a▒\177\000\000\000\000▒\000\000\000\000\000\003", '\000' <repeats 15 times>, "▒=\006a▒\177\000\000\001\000▒\000\000\000\000\000\000\001\000\000\000\000\000\000▒\022▒", '\000' <repeats 13 times>, "▒\022▒\000\000\000\000\000▒\031\va▒\177\000\000\000\000▒\000\000\000\000\000▒=\006a▒\177\000\000\000\000▒\000\000\000\000\000\020\000\000\000\000\000\000\000\005\000\000\000\000\000\000\000J\006C", '\000' <repeats 21 times>...}
(gdb) q
A debugging session is active.

        Inferior 1 [process 29008] will be killed.

Quit anyway? (y or n) [answered Y; input not from terminal]

ofry@games MINGW64 ~/bmake
$

@ofry
Copy link
Contributor Author

ofry commented Jan 10, 2020

So this bug exists somewhere in signal handling.

@StarWolf3000
Copy link
Contributor

Which you probably will have to rewrite entirely, since Windows doesn't support signals.

https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/signal?view=vs-2019

@oscarfv
Copy link
Contributor

oscarfv commented Jan 10, 2020

@StarWolf3000 : Windows does support some signals. Possibly you are confused by the first paragraph of that page, but that's for Windows Store apps, which are different beasts than your usual Windows program.

@ofry : is it really necessary to report here every advancement or problem on your porting project?

@ofry
Copy link
Contributor Author

ofry commented Jan 13, 2020

I fixed CompatRunCommand() function. The tool doesn't exit with failure now, but it fails to find targets :(

@ofry
Copy link
Contributor Author

ofry commented Apr 7, 2020

I did PR #6358, but it failing at testing stage.

@StarWolf3000
Copy link
Contributor

@ofry You need to tell gcc (ld) to add the library iconv to link against, otherwise this won't work with mingw-w64.

@ofry
Copy link
Contributor Author

ofry commented Apr 8, 2020

@ofry You need to tell gcc (ld) to add the library iconv to link against, otherwise this won't work with mingw-w64.

Where are we need iconv library?

@StarWolf3000
Copy link
Contributor

StarWolf3000 commented Apr 8, 2020

The build stopped because the linker could not resolve the symbol GetACP, and according to several searches on the net you need the libiconv (-liconv for gcc) to fix this.

gcc -pipe -o bmake main.o meta.o arch.o buf.o compat.o cond.o dir.o for.o getopt hash.o job.o make.o make_malloc.o metachar.o parse.o sigcompat.o str.o strlist.o suff.o targ.o trace.o var.o util.o lstAppend.o lstDupl.o lstInit.o lstOpen.o lstAtEnd.o lstEnQueue.o lstInsert.o lstAtFront.o lstIsAtEnd.o lstClose.o lstFind.o lstIsEmpty.o lstRemove.o lstConcat.o lstFindFrom.o lstLast.o lstReplace.o lstFirst.o lstDatum.o lstForEach.o lstMember.o lstSucc.o lstDeQueue.o lstForEachFrom.o lstDestroy.o lstNext.o lstPrev.o realpath.o stresep.o strlcpy.o -lws2_32 -lwsock32
C:/msys64/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.3.0/../../../../i686-w64-mingw32/bin/ld.exe: var.o:var.c:(.text+0xaa51): undefined reference to `GetACP'
collect2.exe: error: ld returned 1 exit status
==> ERROR: A failure occurred in build().
    Aborting...
[MSYS2 CI] FAILURE: mingw-w64-bmake: Building binary failed.
Command exited with code 1

@StarWolf3000
Copy link
Contributor

Cannot view the Azure log due to browser problem, but it also happens on appveyor: https://ci.appveyor.com/project/Alexpux/mingw-packages/builds/32023107/job/37786505m0b649k9#L1078

@ofry
Copy link
Contributor Author

ofry commented Apr 8, 2020

Then it doesn't happen with Azure. But testing stage still failed.

This is log from my machine:
mingw-w64-bmake-20181221-1-x86_64-build.log

@ofry
Copy link
Contributor Author

ofry commented Apr 8, 2020

@StarWolf3000 Added libiconv dependency to PKGBUILD.

@ofry
Copy link
Contributor Author

ofry commented Apr 8, 2020

It failing on test with this command:

gcc -pipe -o bmake main.o meta.o arch.o buf.o compat.o cond.o dir.o for.o getopt hash.o job.o make.o make_malloc.o metachar.o parse.o sigcompat.o str.o strlist.o suff.o targ.o trace.o var.o util.o lstAppend.o lstDupl.o lstInit.o lstOpen.o lstAtEnd.o lstEnQueue.o lstInsert.o lstAtFront.o lstIsAtEnd.o lstClose.o lstFind.o lstIsEmpty.o lstRemove.o lstConcat.o lstFindFrom.o lstLast.o lstReplace.o lstFirst.o lstDatum.o lstForEach.o lstMember.o lstSucc.o lstDeQueue.o lstForEachFrom.o lstDestroy.o lstNext.o lstPrev.o realpath.o stresep.o strlcpy.o -lws2_32 -lwsock32
+ case "$op" in
+ op_test
+ '[' -x bmake ']'
+ Bmake test
+ cd /home/ofry/MINGW-packages/mingw-w64-bmake/src/bmake
+ MAKESYSPATH=/home/ofry/MINGW-packages/mingw-w64-bmake/src/bmake/mk
+ SRCTOP=/home/ofry/MINGW-packages/mingw-w64-bmake/src/bmake
+ OBJTOP=/home/ofry/MINGW-packages/mingw-w64-bmake/src/mingw64_nt-6.3-96003-x86_64
+ MAKEOBJDIR='${.CURDIR:S,${SRCTOP:tA},${OBJTOP:tA},}'
+ /home/ofry/MINGW-packages/mingw-w64-bmake/src/mingw64_nt-6.3-96003-x86_64/bmake -dA -f /home/ofry/MINGW-packages/mingw-w64-bmake/src/bmake/Makefile test

/home/ofry/MINGW-packages/mingw-w64-bmake/src/bmake/Makefile doesn't exist. But exist /home/ofry/MINGW-packages/mingw-w64-bmake/src/bmake/makefile.in

How I can create Makefile from this makefile.in:

# $Id: makefile.in,v 1.1 2012/12/28 21:28:19 sjg Exp $

# a simple makefile for those who don't like anything beyond:
# ./configure; make; make install

prefix= @prefix@
srcdir= @srcdir@

all: build

build clean install test:
	${srcdir}/boot-strap --prefix=${prefix} -o . op=$@

@ofry
Copy link
Contributor Author

ofry commented Apr 10, 2020

@ofry
Copy link
Contributor Author

ofry commented Jun 16, 2020

Now this package presented in repo. Related PR: #6467

@ofry ofry closed this as completed Jun 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants