1
0
mirror of https://github.com/simh/simh.git synced 2026-01-14 07:39:29 +00:00

makefile: Adjust setup logic to properly detect simh version for MinGW32

The setup logic at the top of this makefile is common with that for the v3
makefile since some components are shared.
This commit is contained in:
Mark Pizzolato 2022-11-29 08:55:45 -10:00
parent 2da54fbacd
commit 0155f60232

View File

@ -131,7 +131,29 @@ ifeq (old,$(shell gmake --version /dev/null 2>&1 | grep 'GNU Make' | awk '{ if (
$(warning *** Warning *** GNU Make Version $(GMAKE_VERSION) is too old to)
$(warning *** Warning *** fully process this makefile)
endif
SIM_MAJOR=$(shell grep SIM_MAJOR sim_rev.h | awk '{ print $$3 }')
ifneq ($(findstring Windows,${OS}),)
$(info *** Warning *** Compiling simh simulators with MinGW or cygwin is deprecated and)
$(info *** Warning *** may not complete successfully or produce working simulators. If)
$(info *** Warning *** building simulators completes, they may not be fully functional.)
$(info *** Warning *** It is recommended to use one of the free Microsoft Visual Studio)
$(info *** Warning *** compilers which provide fully functional simulator capabilities.)
ifeq ($(findstring .exe,${SHELL}),.exe)
# MinGW
WIN32 := 1
# Tests don't run under MinGW
TESTS := 0
else # Msys or cygwin
ifeq (MINGW,$(findstring MINGW,$(shell uname)))
$(info *** This makefile can not be used with the Msys bash shell)
$(error Use build_mingw.bat ${MAKECMDGOALS} from a Windows command prompt)
endif
endif
endif
ifeq ($(WIN32),)
SIM_MAJOR=$(shell grep SIM_MAJOR sim_rev.h | awk '{ print $$3 }')
else
SIM_MAJOR=$(shell for /F "tokens=3" %%i in ('findstr /c:"SIM_MAJOR" sim_rev.h') do echo %%i)
endif
BUILD_SINGLE := ${MAKECMDGOALS} $(BLANK_SUFFIX)
BUILD_MULTIPLE_VERB = is
MAKECMDGOALS_DESCRIPTION = the $(MAKECMDGOALS) simulator
@ -201,24 +223,6 @@ endif
ifneq ($(NOVIDEO),)
VIDEO_USEFUL =
endif
ifneq ($(findstring Windows,${OS}),)
$(info *** Warning *** Compiling simh simulators with MinGW or cygwin is deprecated and)
$(info *** Warning *** may not complete successfully or produce working simulators. If)
$(info *** Warning *** building simulators completes, they may not be fully functional.)
$(info *** Warning *** It is recommended to use one of the free Microsoft Visual Studio)
$(info *** Warning *** compilers which provide fully functional simulator capabilities.)
ifeq ($(findstring .exe,${SHELL}),.exe)
# MinGW
WIN32 := 1
# Tests don't run under MinGW
TESTS := 0
else # Msys or cygwin
ifeq (MINGW,$(findstring MINGW,$(shell uname)))
$(info *** This makefile can not be used with the Msys bash shell)
$(error Use build_mingw.bat ${MAKECMDGOALS} from a Windows command prompt)
endif
endif
endif
find_exe = $(abspath $(strip $(firstword $(foreach dir,$(strip $(subst :, ,${PATH})),$(wildcard $(dir)/$(1))))))
find_lib = $(firstword $(abspath $(strip $(firstword $(foreach dir,$(strip ${LIBPATH}),$(foreach ext,$(strip ${LIBEXT}),$(wildcard $(dir)/lib$(1).$(ext))))))))
@ -1170,18 +1174,20 @@ else
$(info Cloning the windows-build dependencies into $(abspath ..)/windows-build)
$(shell git clone https://github.com/simh/windows-build ../windows-build)
else
$(info ***********************************************************************)
$(info ***********************************************************************)
$(info ** This build is operating without the required windows-build **)
$(info ** components and therefore will produce less than optimal **)
$(info ** simulator operation and features. **)
$(info ** Download the file: **)
$(info ** https://github.com/simh/windows-build/archive/windows-build.zip **)
$(info ** Extract the windows-build-windows-build folder it contains to **)
$(info ** $(abspath ..\) **)
$(info ***********************************************************************)
$(info ***********************************************************************)
$(info .)
ifneq (3,${SIM_MAJOR})
$(info ***********************************************************************)
$(info ***********************************************************************)
$(info ** This build is operating without the required windows-build **)
$(info ** components and therefore will produce less than optimal **)
$(info ** simulator operation and features. **)
$(info ** Download the file: **)
$(info ** https://github.com/simh/windows-build/archive/windows-build.zip **)
$(info ** Extract the windows-build-windows-build folder it contains to **)
$(info ** $(abspath ..\) **)
$(info ***********************************************************************)
$(info ***********************************************************************)
$(info .)
endif
endif
else
# Version check on windows-build