Archive for the ‘Makefile’ Category

Variable reassignment in makefiles

August 5, 2006

To change the value of a variable assigned in makefile, inside a rule, use this:

target ... : variable-assignment

on a separate line by itself.


prog: CC=g++
prog: prog.cpp
	${CC} -o prog prog.cpp

Found here:


ignore return values

July 20, 2006

To ignore error return values from a command in a makefile, add a ‘-‘ before command.