5

In a Makefile, what is $(NOOP) typically used for?

I see in one particular Makefile, NOOP is set to /bin/sh -c true and it is used in many rules such as this one:

all: pure_all
    $(NOECHO) $(NOOP)

How is this better/different than

all: pure_all
wizurd
  • 3,541
  • 3
  • 33
  • 50

1 Answers1

7

This is likely a verbose (and less efficient, though perhaps more portable I don't know) attempt at an Empty Recipe.

Specifically, without marking a recipe as .PHONY or otherwise giving them a recipe as in the question a target will be subject to Implicit Rule Search.

This search can be slow at times and can do things that aren't desirable.

Aside: The comments on this question cover the topic of .PHONY rules and their FORCE equivalents fairly well I think (though in a round-about fashion as that wasn't the point).

Community
  • 1
  • 1
Etan Reisner
  • 77,877
  • 8
  • 106
  • 148