我的 Makefile.am 创建可执行文件 main: "symlerTest" 我想链接文件 "geometry/source/*.o"。目前我像这样链接它:
symplerTest_LDFLAGS = \
...
geometry/source/*.o
这样可行。但现在在下一步中,我只想在文件 *.o 存在时才链接。我试过这个:
if ("$(wildcard $(geometry/source/*.o))","")
symplerTest_LDFLAGS += geometry/source/*.o
endif
但收到以下错误消息:
srcUnittest/Makefile.am:81: error: endif without if
srcUnittest/Makefile.am:79: warning: wildcard $(geometry/source/*.o: non-POSIX variable name
srcUnittest/Makefile.am:79: (probably a GNU make extension)
问题似乎出在 ("$(wildcard $(geometry/source/*.o))","")
谢谢!