2011-10-10 29 views
0

列出一系列最終以逗號分隔的源文件的最簡單方法是什麼?如何在makefile中列出源代碼?

我的makefile的知識貧乏,所以我寫了什麼我使用僞代碼之後:

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

executable -source=${implode(',', sources)} 

回答

1

與感謝解決了:Create comma-separated lists in GNU Make

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

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

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