Q:

Make: access argument flags

If I have a, for instance, dbg executable that I compile with: 
make dbg
//outputs: my_exe-dbg

And I make edits to the makefile, I would then like to re-run make dbg.  However, the presence of the my_exe-dbg prevents make from doing anything. 
I would like to write: 
make dbg -f 

Which compiles and replaces the executable.  If I write: 
make dbg -fr 

It would compile and replace everything (r would signify "executable"). How would I check for flags and reason about them within the makefile?
Is there a variable or built in mechanism for capturing or defining flags to look for? 
Is there a work-around for detecting these dash flags? 

A:

You can invoke make (at least GNU make, not sure how portable this is) as
make -B dbg

which disables the timestamp checks and always builds everything. A per-target workaround could instead be
dbg-f: # dependencies only if referred to by $< below
    # command to build dbg

.PHONY: dbg-f

This way, you can force the compilation by
make dbg-f

while
make dbg

works as before and checks for dependencies and their timestamps.

