I would like to know if there is a way to change the rules applied automatically by make when there is no makefile. To give an example, if you write
make foo in a directory containing a file called
foo.cpp it executes
g++ foo.cpp -o foo
even if there is no
makefile in the directory.
I would like to change them to suit my needs, say something like
g++ foo.cpp -o foo --std=c++11 -W -O2 -I ....
but also to add new rules for other extensions such as .c, .java or .tex
I know how to define the new rules, but I don't know where to specify them other than creating a makefile in every directory. I suppose there is some file that holds all these builtin rules but I haven't been able to find it or how to overload it with one of my own.
I'm working mostly with Mingw and cygwin.