我想在Makefile中制作一个自定义函数来检测当前平台并相应地返回正确的文件。这是我的尝试。makefile自定义函数
UNAME := $(shell uname -s)
define platform
ifeq ($(UNAME),Linux)
$1
else ifneq ($(findstring MINGW32_NT, $(UNAME)),)
$2
else ifeq ($(UNAME),Darwin)
$3
endif
endef
all:
@echo $(call platform,linux,windows,mac)
失败,并显示以下错误。
/bin/sh: Syntax error: "(" unexpected
[Finished]make: *** [all] Error 2
我在做什么错?