Detect platform before including Makefile.config to be able to use variable in the build config.
--- 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