I would like to inquire about the method in which one passes compiler optimisations, when compiling large programs such as galeon. I edited a Makefile to reflect my prefrences which were:
-mcpu=athlon -march=athlon -g -O3
These are the relevant optimisations for my AMD Duron 750 Mhz processor but when compiling I noticed it was not using the above optimisations for every thing. I then found out post compile that there were multiple Makefiles. So how would one go about setting default optimisations without editing a large number of Makefiles by hand ?
I have already come across a solution which involved setting environment variables and passing them to make but, the flags in the Makefiles also contain some custom arguements so compilation fails if I just set my optimisations in the shell and pass them to make.
So my question is is there anyway to just append -mcpu=xxx -march=xxx and changing the default -O2 optimisation level to -O3 for multiple Makefiles ?