mkenv.mk 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. ifneq ($(lastword a b),b)
  2. $(error These Makefiles 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. #
  8. # We assume that this file is in the py directory so we use $(dir ) twice
  9. # to get to the top of the tree.
  10. THIS_MAKEFILE := $(lastword $(MAKEFILE_LIST))
  11. TOP := $(patsubst %/py/mkenv.mk,%,$(THIS_MAKEFILE))
  12. # Turn on increased build verbosity by defining BUILD_VERBOSE in your main
  13. # Makefile or in your environment. You can also use V=1 on the make command
  14. # line.
  15. ifeq ("$(origin V)", "command line")
  16. BUILD_VERBOSE=$(V)
  17. endif
  18. ifndef BUILD_VERBOSE
  19. BUILD_VERBOSE = 0
  20. endif
  21. ifeq ($(BUILD_VERBOSE),0)
  22. Q = @
  23. else
  24. Q =
  25. endif
  26. # Since this is a new feature, advertise it
  27. ifeq ($(BUILD_VERBOSE),0)
  28. $(info Use make V=1 or set BUILD_VERBOSE in your environment to increase build verbosity.)
  29. endif
  30. # default settings; can be overridden in main Makefile
  31. PY_SRC ?= $(TOP)/py
  32. BUILD ?= build
  33. RM = rm
  34. ECHO = @echo
  35. CP = cp
  36. MKDIR = mkdir
  37. SED = sed
  38. CAT = cat
  39. TOUCH = touch
  40. PYTHON = python3
  41. AS = $(CROSS_COMPILE)as
  42. CC = $(CROSS_COMPILE)gcc
  43. CXX = $(CROSS_COMPILE)g++
  44. GDB = $(CROSS_COMPILE)gdb
  45. LD = $(CROSS_COMPILE)ld
  46. OBJCOPY = $(CROSS_COMPILE)objcopy
  47. SIZE = $(CROSS_COMPILE)size
  48. STRIP = $(CROSS_COMPILE)strip
  49. AR = $(CROSS_COMPILE)ar
  50. MAKE_MANIFEST = $(PYTHON) $(TOP)/tools/makemanifest.py
  51. MAKE_FROZEN = $(PYTHON) $(TOP)/tools/make-frozen.py
  52. MPY_CROSS = $(TOP)/mpy-cross/mpy-cross
  53. MPY_TOOL = $(PYTHON) $(TOP)/tools/mpy-tool.py
  54. MPY_LIB_DIR = $(TOP)/../micropython-lib
  55. all:
  56. .PHONY: all
  57. .DELETE_ON_ERROR:
  58. MKENV_INCLUDED = 1