Dave Hylands | c89c681 | 2014-01-24 01:05:30 -0800 | [diff] [blame] | 1 | ifneq ($(lastword a b),b) |
| 2 | $(error These Makefiles require make 3.81 or newer) |
| 3 | endif |
| 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 | |
| 12 | THIS_MAKEFILE := $(lastword $(MAKEFILE_LIST)) |
| 13 | TOP := $(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 | |
| 19 | ifeq ("$(origin V)", "command line") |
| 20 | BUILD_VERBOSE=$(V) |
| 21 | endif |
| 22 | ifndef BUILD_VERBOSE |
| 23 | BUILD_VERBOSE = 0 |
| 24 | endif |
| 25 | ifeq ($(BUILD_VERBOSE),0) |
| 26 | Q = @ |
| 27 | else |
| 28 | Q = |
| 29 | endif |
| 30 | # Since this is a new feature, advertise it |
| 31 | ifeq ($(BUILD_VERBOSE),0) |
| 32 | $(info Use make V=1 or set BUILD_VERBOSE in your environment to increase build verbosity.) |
| 33 | endif |
| 34 | |
| 35 | # default settings; can be overriden in main Makefile |
| 36 | |
| 37 | PY_SRC ?= $(TOP)/py |
| 38 | BUILD ?= build |
| 39 | |
| 40 | RM = rm |
| 41 | ECHO = @echo |
Andrew Scheller | 902d955 | 2014-04-07 01:35:45 +0100 | [diff] [blame] | 42 | CP = cp |
| 43 | MKDIR = mkdir |
| 44 | SED = sed |
Damien George | 109990f | 2016-04-21 22:25:35 +0100 | [diff] [blame] | 45 | PYTHON = python |
Dave Hylands | c89c681 | 2014-01-24 01:05:30 -0800 | [diff] [blame] | 46 | |
Damien George | 82ed3d6 | 2014-06-07 13:14:45 +0100 | [diff] [blame] | 47 | AS = $(CROSS_COMPILE)as |
| 48 | CC = $(CROSS_COMPILE)gcc |
Paul Sokolovsky | 18c22fa | 2015-08-29 21:13:07 +0300 | [diff] [blame] | 49 | CXX = $(CROSS_COMPILE)g++ |
Damien George | 82ed3d6 | 2014-06-07 13:14:45 +0100 | [diff] [blame] | 50 | LD = $(CROSS_COMPILE)ld |
| 51 | OBJCOPY = $(CROSS_COMPILE)objcopy |
| 52 | SIZE = $(CROSS_COMPILE)size |
| 53 | STRIP = $(CROSS_COMPILE)strip |
Paul Sokolovsky | 408b74d | 2015-10-12 14:42:05 +0300 | [diff] [blame] | 54 | AR = $(CROSS_COMPILE)ar |
Paul Sokolovsky | 18c22fa | 2015-08-29 21:13:07 +0300 | [diff] [blame] | 55 | ifeq ($(MICROPY_FORCE_32BIT),1) |
| 56 | CC += -m32 |
| 57 | CXX += -m32 |
| 58 | LD += -m32 |
| 59 | endif |
Dave Hylands | c89c681 | 2014-01-24 01:05:30 -0800 | [diff] [blame] | 60 | |
Paul Sokolovsky | f28efa1 | 2016-09-17 20:57:43 +0300 | [diff] [blame] | 61 | MAKE_FROZEN = ../tools/make-frozen.py |
Damien George | bdf33bc | 2016-11-08 14:28:30 +1100 | [diff] [blame] | 62 | MPY_CROSS = ../mpy-cross/mpy-cross |
| 63 | MPY_TOOL = ../tools/mpy-tool.py |
Paul Sokolovsky | f28efa1 | 2016-09-17 20:57:43 +0300 | [diff] [blame] | 64 | |
Dave Hylands | c89c681 | 2014-01-24 01:05:30 -0800 | [diff] [blame] | 65 | all: |
| 66 | .PHONY: all |
| 67 | |
Dave Hylands | 1a797ed | 2014-04-16 08:09:59 -0700 | [diff] [blame] | 68 | .DELETE_ON_ERROR: |
| 69 | |
Dave Hylands | c89c681 | 2014-01-24 01:05:30 -0800 | [diff] [blame] | 70 | MKENV_INCLUDED = 1 |