mkenv.mk 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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. ifeq ($(MICROPY_FORCE_32BIT),1)
  51. CC += -m32
  52. CXX += -m32
  53. LD += -m32
  54. endif
  55. MAKE_MANIFEST = $(PYTHON) $(TOP)/tools/makemanifest.py
  56. MAKE_FROZEN = $(PYTHON) $(TOP)/tools/make-frozen.py
  57. MPY_CROSS = $(TOP)/mpy-cross/mpy-cross
  58. MPY_TOOL = $(PYTHON) $(TOP)/tools/mpy-tool.py
  59. MPY_LIB_DIR = $(TOP)/../micropython-lib
  60. all:
  61. .PHONY: all
  62. .DELETE_ON_ERROR:
  63. MKENV_INCLUDED = 1