Can all PONIC goals be done? (Gmake)

I have Makefilewhere none of the target link files are, so if this can be done in some loop, it will be convenient.

Is there a way to set each target in a makefile like .PHONY?


The reason I ask for this is because I never want the files in the same directory as the make file to conflict with the targets (where the make file will automatically associate any target with the file directory).

+4
source share
1 answer

You can guarantee that goals are always created by defining one empty "FORCE" target and all other objects depend on it.

target1: FORCE
      ./foobar $@
target2: FORCE
      ./dongle $@
FORCE:

(as suggested in the make guide )

"make -B" "make"?

`-B'
`--always-make'
     Consider all targets out-of-date.  GNU `make' proceeds to consider
     targets and their prerequisites using the normal algorithms;
     however, all these targets are remade, regardless of the status of
     their prerequisites.
+3

Source: https://habr.com/ru/post/1568301/


All Articles