How to make 'make' make

If your Makefile just refuses to do something, you are in luck! I will show you how to fix the problem without even understanding it!

Suppose you want to build a target called 'foo'. Make refuses. It gives some excuses, "Nothing to be done for target foo" or "foo is up to date". What nonsense.

You could try updating the time stamps, but this is getting too close to how 'make' actually is supposed to work. This won't solve your problem, but it is some of the first advice you will get. Ignore it.

Do this:

.PHONY FORCE
FORCE: ;
.PHONY foo
foo: FORCE then whatever deps
recipe for foo...

What this is supposed to mean is that there is a target called 'FORCE' that isn't supposed to be a real file. On the next line, FORCE is specified as having no dependencies. Declare foo as .PHONY to indicate that is is not supposed to be a real file, even if it is. Then specify FORCE as a dependency of foo. Somehow this makes it work, maybe.

If that doesn't work for you, then handle the logic for 'foo' in the shell. Yes, you can do that!

.PHONY FORCE
FORCE: ;
.PHONY foo
foo: FORCE
make then
make whatever
make deps
recipe for foo...

You can also call make with the '-B' option. Such as make -B foo . This is supposed to "unconditionally make all targets" on GNU Make. Try it. It might work for you.

So, yeah, I did this and was able to compile some software, finally.