mkenv.mk 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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. PYTHON = python
  39. AS = $(CROSS_COMPILE)as
  40. CC = $(CROSS_COMPILE)gcc
  41. CXX = $(CROSS_COMPILE)g++
  42. LD = $(CROSS_COMPILE)ld
  43. OBJCOPY = $(CROSS_COMPILE)objcopy
  44. SIZE = $(CROSS_COMPILE)size
  45. STRIP = $(CROSS_COMPILE)strip
  46. AR = $(CROSS_COMPILE)ar
  47. ifeq ($(MICROPY_FORCE_32BIT),1)
  48. CC += -m32
  49. CXX += -m32
  50. LD += -m32
  51. endif
  52. MAKE_FROZEN = $(PYTHON) $(TOP)/tools/make-frozen.py
  53. MPY_CROSS = $(TOP)/mpy-cross/mpy-cross
  54. MPY_TOOL = $(PYTHON) $(TOP)/tools/mpy-tool.py
  55. all:
  56. .PHONY: all
  57. .DELETE_ON_ERROR:
  58. MKENV_INCLUDED = 1