More on gnu makefiles

Adding options to an existing makefile at the command prompt

to add options to existing options,

make [-j <n> ] EXTRA="-option1 -option2 ..."

For instance, to compile with realnum set to double:

make [-j <n> ] EXTRA=-DFLT_IS_DBL

Adding option to change the default behavior

To change Makefile so that the default build has other properties:

Edit the third line of the Makefile in sys_gcc to read

<TAB>$(MAKE) -f ../Makefile SRCDIR=.. $(MAKECMDGOALS) options

where options are the options you want to pass on to make. An example might be


debug compile

make [-j <n> ] debug

To turn off inlining, a first step in debugging, do

make [-j <n> ] debug DEBUGOPT=

Return to main wiki page