github.com/cockroachdb/cockroach@v20.2.0-alpha.1+incompatible/pkg/Makefile (about) 1 # This is a convenience Makefile which defers all real work to 2 # ../Makefile. The % rule is run for any target specified on the 3 # command line. We use the builtin MAKECMDGOALS and MAKEFLAGS 4 # variables (the command line targets and flags respectively) to 5 # perform our recursive make invocation. Lastly, we take care to make 6 # any PKG specification relative to "./pkg". 7 # 8 # We use a level of indirection through the "default" rule so that 9 # specifying multiple targets on the command line (e.g. "make test 10 # lint") does not result in multiple invocations of the rule. 11 # 12 # The rule needs an action (i.e. "@true") because reasons (I'm not 13 # really sure why - Peter). 14 %: default 15 @true 16 17 .PHONY: default 18 default: 19 @$(MAKE) -C .. $(MAKECMDGOALS) \ 20 $(patsubst PKG=%,PKG=./pkg/%,$(filter PKG=%,$(MAKEFLAGS)))