如何在makefile中列出源?

如何在makefile中列出源?,makefile,Makefile,列出最终以逗号分隔的一系列源文件的最整洁的方法是什么 我对makefiles的了解很差,因此我在使用伪代码后编写了以下内容: sources = array( 'my/file1', 'my/file2', //... 'my/file30' ) executable -source=${implode(',', sources)} 由于以下原因解决: sources = my/file1 \ my/file2 \ my/file3 null := spa

列出最终以逗号分隔的一系列源文件的最整洁的方法是什么

我对makefiles的了解很差,因此我在使用伪代码后编写了以下内容:

sources = array(
    'my/file1',
    'my/file2',
    //...
    'my/file30'
)

executable -source=${implode(',', sources)}
由于以下原因解决:

sources = my/file1 \
my/file2 \
my/file3

null  :=
space := $(null) #
comma := ,

FULL_SOURCES := $(subst $(space),$(comma),$(strip $(sources)))