# HG changeset patch # User Oleksandr Gavenko # Date 1630479544 -10800 # Node ID 3bd48b5e12c6c8744dcbc8237d166d06ce2cda7f # Parent db3f92fe32953a0515cb236eaa3d9519dd8811bb Detect platform before including Makefile.config to be able to use variable in the build config. diff -r db3f92fe3295 -r 3bd48b5e12c6 Makefile --- a/Makefile Wed Sep 01 09:55:02 2021 +0300 +++ b/Makefile Wed Sep 01 09:59:04 2021 +0300 @@ -31,6 +31,25 @@ .DEFAULT_GOAL = help ################################################################ +# Determine platform/environment. + +host_os = unix +ifneq '' '$(COMSPEC)' + ifneq '' '$(WINDIR)' + # Probably under Windows. + host_os = windows + ifneq '' '$(wildcard /etc/setup/*cygwin*)' + # Probably under Cygwin. + host_os = cygwin + endif + endif +endif + +ifneq '' '$(wildcard /etc/wsl.conf)' + is_wsl := yes +endif + +################################################################ # Build script definitions. BUILD_SCRIPTS := $(firstword $(MAKEFILE_LIST)) @@ -78,25 +97,6 @@ } >$@ ################################################################ -# Determine platform/environment. - -host_os = unix -ifneq '' '$(COMSPEC)' - ifneq '' '$(WINDIR)' - # Probably under Windows. - host_os = windows - ifneq '' '$(wildcard /etc/setup/*cygwin*)' - # Probably under Cygwin. - host_os = cygwin - endif - endif -endif - -ifneq '' '$(wildcard /etc/wsl.conf)' - is_wsl := yes -endif - -################################################################ # Build tools definition/switches. INSTALL = install