Commenti in un makefile

Anteporre un simbolo di cancelletto (#) al commento. Tutto il testo a partire dal cancelletto fino al successivo carattere di nuova riga verrà ignorato. Esempi:

# Comment on line by itself
OPTIONS = /MAP  # Comment on macro definition line

all.exe : one.obj two.obj  # Comment on dependency line
    link one.obj two.obj
# Comment in commands block
#   copy *.obj \objects  # Command turned into comment
    copy one.exe \release

.obj.exe:  # Comment on inference rule line
    link $<

my.exe : my.obj ; link my.obj  # Err: cannot comment this
 # Error: # must be the first character
.obj.exe: ; link $<  # Error: cannot comment this

Per specificare un simbolo di cancelletto, anteporre un accento circonflesso (^) come nell'esempio seguente:

DEF = ^#define  #Macro for a C preprocessing directive

Vedere anche

Concetti

Contenuto di un makefile