如何在makefile中添加多行註釋

出處: http://stackoverflow.com/questions/4493291/how-to-add-multi-line-comments-in-makefiles

有沒有辦法註釋掉多行makefiles像C語法/ * * /?
不,在makefile中沒有什麼像C風格/ * * /註釋。正如其他人建議的,你可以通過使用行繼續進行多行註釋。例如:

# This is the first line of a comment \
and this is still part of the comment \
as is this, since I keep ending each line \
with a backslash character

但是,我想你可能想要暫時註釋掉一個你的makefile的一個塊為了調試的原因,並在每行添加一個反斜杠是不切實際。如果你使用GNU make,我建議你使用ifeq偽指令。例如:

ifeq ("x","y")
# here's all your 'commented' makefile content...
endif

希望有幫助。

未經允許不得轉載:GoMCU » 如何在makefile中添加多行註釋