浏览代码

[Pal] Makefile.Host: define/export SYS if it's not defined

Makefile.Host can be called with PAL_HOST defined but SYS undefined.
Also export SYS.
Isaku Yamahata 4 年之前
父节点
当前提交
723af03513
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      Pal/src/Makefile.Host

+ 2 - 1
Pal/src/Makefile.Host

@@ -1,7 +1,7 @@
 all_hosts = Skeleton Linux Linux-SGX FreeBSD
 
+SYS ?= $(shell gcc -dumpmachine)
 ifeq ($(PAL_HOST),)
-SYS := $(shell gcc -dumpmachine)
 ifeq ($(findstring x86_64,$(SYS))$(findstring linux,$(SYS)),x86_64linux)
 PAL_HOST := Linux
 else ifeq ($(findstring freebsd,$(SYS)),freebsd)
@@ -23,6 +23,7 @@ ifeq ($(findstring $(PAL_HOST),$(all_hosts)),)
 $(error Unsupported platform: $(PAL_HOST))
 endif
 
+export SYS
 export PAL_HOST
 export PAL_HOST_MACRO = $(shell echo $(PAL_HOST) | tr '[:lower:]' '[:upper:]' | tr '-' '_')