5368210e36
This change makes it so that python3 is required by default to build
MicroPython. Python 2 can be used by specifying make PYTHON=python2.
This comes about due to a recent-ish change to PEP 394 that makes the
python command more optional than before (even with Python 2 installed);
see cd59ec03c8 (diff-1d22f7bd72cbc900670f058b1107d426)
Since the command python is no longer required to be provided by a
distribution we need to use either python2 or python3 as commands. And
python3 seems the obvious choice.
71 lines
1.6 KiB
Makefile
71 lines
1.6 KiB
Makefile
ifneq ($(lastword a b),b)
|
|
$(error These Makefiles require make 3.81 or newer)
|
|
endif
|
|
|
|
# Set TOP to be the path to get from the current directory (where make was
|
|
# invoked) to the top of the tree. $(lastword $(MAKEFILE_LIST)) returns
|
|
# the name of this makefile relative to where make was invoked.
|
|
#
|
|
# We assume that this file is in the py directory so we use $(dir ) twice
|
|
# to get to the top of the tree.
|
|
|
|
THIS_MAKEFILE := $(lastword $(MAKEFILE_LIST))
|
|
TOP := $(patsubst %/py/mkenv.mk,%,$(THIS_MAKEFILE))
|
|
|
|
# Turn on increased build verbosity by defining BUILD_VERBOSE in your main
|
|
# Makefile or in your environment. You can also use V=1 on the make command
|
|
# line.
|
|
|
|
ifeq ("$(origin V)", "command line")
|
|
BUILD_VERBOSE=$(V)
|
|
endif
|
|
ifndef BUILD_VERBOSE
|
|
BUILD_VERBOSE = 0
|
|
endif
|
|
ifeq ($(BUILD_VERBOSE),0)
|
|
Q = @
|
|
else
|
|
Q =
|
|
endif
|
|
# Since this is a new feature, advertise it
|
|
ifeq ($(BUILD_VERBOSE),0)
|
|
$(info Use make V=1 or set BUILD_VERBOSE in your environment to increase build verbosity.)
|
|
endif
|
|
|
|
# default settings; can be overridden in main Makefile
|
|
|
|
PY_SRC ?= $(TOP)/py
|
|
BUILD ?= build
|
|
|
|
RM = rm
|
|
ECHO = @echo
|
|
CP = cp
|
|
MKDIR = mkdir
|
|
SED = sed
|
|
PYTHON = python3
|
|
|
|
AS = $(CROSS_COMPILE)as
|
|
CC = $(CROSS_COMPILE)gcc
|
|
CXX = $(CROSS_COMPILE)g++
|
|
LD = $(CROSS_COMPILE)ld
|
|
OBJCOPY = $(CROSS_COMPILE)objcopy
|
|
SIZE = $(CROSS_COMPILE)size
|
|
STRIP = $(CROSS_COMPILE)strip
|
|
AR = $(CROSS_COMPILE)ar
|
|
ifeq ($(MICROPY_FORCE_32BIT),1)
|
|
CC += -m32
|
|
CXX += -m32
|
|
LD += -m32
|
|
endif
|
|
|
|
MAKE_FROZEN = $(PYTHON) $(TOP)/tools/make-frozen.py
|
|
MPY_CROSS = $(TOP)/mpy-cross/mpy-cross
|
|
MPY_TOOL = $(PYTHON) $(TOP)/tools/mpy-tool.py
|
|
|
|
all:
|
|
.PHONY: all
|
|
|
|
.DELETE_ON_ERROR:
|
|
|
|
MKENV_INCLUDED = 1
|