top.mk 565 B

1234567891011121314151617
  1. ifneq ($(lastword a b),b)
  2. $(error This Makefile require make 3.81 or newer)
  3. endif
  4. # Set TOP to be the path to get from the current directory (where make was
  5. # invoked) to the top of the tree. $(lastword $(MAKEFILE_LIST)) returns
  6. # the name of this makefile relative to where make was invoked.
  7. THIS_MAKEFILE := $(lastword $(MAKEFILE_LIST))
  8. TOP := $(patsubst %/tools/top.mk,%,$(THIS_MAKEFILE))
  9. TOP := $(shell realpath $(TOP))
  10. #$(info Top directory is $(TOP))
  11. CURRENT_PATH := $(shell realpath --relative-to=$(TOP) `pwd`)
  12. #$(info Path from top is $(CURRENT_PATH))