1ifneq ($(lastword a b),b) 2$(error These Makefiles require make 3.81 or newer) 3endif 4 5# Set TOP to be the path to get from the current directory (where make was 6# invoked) to the top of the tree. $(lastword $(MAKEFILE_LIST)) returns 7# the name of this makefile relative to where make was invoked. 8# 9# We assume that this file is in the py directory so we use $(dir ) twice 10# to get to the top of the tree. 11 12THIS_MAKEFILE := $(lastword $(MAKEFILE_LIST)) 13TOP := $(patsubst %/py/mkenv.mk,%,$(THIS_MAKEFILE)) 14 15# Turn on increased build verbosity by defining BUILD_VERBOSE in your main 16# Makefile or in your environment. You can also use V=1 on the make command 17# line. 18 19ifeq ("$(origin V)", "command line") 20BUILD_VERBOSE=$(V) 21endif 22ifndef BUILD_VERBOSE 23$(info Use make V=1 or set BUILD_VERBOSE in your environment to increase build verbosity.) 24BUILD_VERBOSE = 0 25endif 26ifeq ($(BUILD_VERBOSE),0) 27Q = @ 28else 29Q = 30endif 31 32# default settings; can be overridden in main Makefile 33 34PY_SRC ?= $(TOP)/py 35BUILD ?= build 36 37RM = rm 38ECHO = @echo 39CP = cp 40MKDIR = mkdir 41SED = sed 42CAT = cat 43TOUCH = touch 44PYTHON = python3 45 46AS = $(CROSS_COMPILE)as 47CC = $(CROSS_COMPILE)gcc 48CXX = $(CROSS_COMPILE)g++ 49GDB = $(CROSS_COMPILE)gdb 50LD = $(CROSS_COMPILE)ld 51OBJCOPY = $(CROSS_COMPILE)objcopy 52SIZE = $(CROSS_COMPILE)size 53STRIP = $(CROSS_COMPILE)strip 54AR = $(CROSS_COMPILE)ar 55 56MAKE_MANIFEST = $(PYTHON) $(TOP)/tools/makemanifest.py 57MAKE_FROZEN = $(PYTHON) $(TOP)/tools/make-frozen.py 58MPY_TOOL = $(PYTHON) $(TOP)/tools/mpy-tool.py 59 60MPY_LIB_DIR = $(TOP)/../micropython-lib 61 62ifeq ($(MICROPY_MPYCROSS),) 63MICROPY_MPYCROSS = $(TOP)/mpy-cross/mpy-cross 64MICROPY_MPYCROSS_DEPENDENCY = $(MICROPY_MPYCROSS) 65endif 66 67all: 68.PHONY: all 69 70.DELETE_ON_ERROR: 71 72MKENV_INCLUDED = 1 73