Detect platform before including Makefile.config to be able to use variable in the build config.
authorOleksandr Gavenko <gavenkoa@gmail.com>
Wed, 01 Sep 2021 09:59:04 +0300
changeset 1314 3bd48b5e12c6
parent 1313 db3f92fe3295
child 1315 6532512bbac4
Detect platform before including Makefile.config to be able to use variable in the build config.
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