blob: 14e23e074c6b825f9cc4bc5d48c422e8d9cb36f1 [file] [log] [blame]
Dave Hylandsc89c6812014-01-24 01:05:30 -08001ifneq ($(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
23BUILD_VERBOSE = 0
24endif
25ifeq ($(BUILD_VERBOSE),0)
26Q = @
27else
28Q =
29endif
30# Since this is a new feature, advertise it
31ifeq ($(BUILD_VERBOSE),0)
32$(info Use make V=1 or set BUILD_VERBOSE in your environment to increase build verbosity.)
33endif
34
35# default settings; can be overriden in main Makefile
36
37PY_SRC ?= $(TOP)/py
38BUILD ?= build
39
40RM = rm
41ECHO = @echo
Andrew Scheller902d9552014-04-07 01:35:45 +010042CP = cp
43MKDIR = mkdir
44SED = sed
Damien George109990f2016-04-21 22:25:35 +010045PYTHON = python
Dave Hylandsc89c6812014-01-24 01:05:30 -080046
Damien George82ed3d62014-06-07 13:14:45 +010047AS = $(CROSS_COMPILE)as
48CC = $(CROSS_COMPILE)gcc
Paul Sokolovsky18c22fa2015-08-29 21:13:07 +030049CXX = $(CROSS_COMPILE)g++
Damien George82ed3d62014-06-07 13:14:45 +010050LD = $(CROSS_COMPILE)ld
51OBJCOPY = $(CROSS_COMPILE)objcopy
52SIZE = $(CROSS_COMPILE)size
53STRIP = $(CROSS_COMPILE)strip
Paul Sokolovsky408b74d2015-10-12 14:42:05 +030054AR = $(CROSS_COMPILE)ar
Paul Sokolovsky18c22fa2015-08-29 21:13:07 +030055ifeq ($(MICROPY_FORCE_32BIT),1)
56CC += -m32
57CXX += -m32
58LD += -m32
59endif
Dave Hylandsc89c6812014-01-24 01:05:30 -080060
Paul Sokolovskyf28efa12016-09-17 20:57:43 +030061MAKE_FROZEN = ../tools/make-frozen.py
Damien Georgebdf33bc2016-11-08 14:28:30 +110062MPY_CROSS = ../mpy-cross/mpy-cross
63MPY_TOOL = ../tools/mpy-tool.py
Paul Sokolovskyf28efa12016-09-17 20:57:43 +030064
Dave Hylandsc89c6812014-01-24 01:05:30 -080065all:
66.PHONY: all
67
Dave Hylands1a797ed2014-04-16 08:09:59 -070068.DELETE_ON_ERROR:
69
Dave Hylandsc89c6812014-01-24 01:05:30 -080070MKENV_INCLUDED = 1