aboutsummaryrefslogtreecommitdiff
path: root/minimal/Makefile
diff options
context:
space:
mode:
authorPaul Sokolovsky2015-01-13 03:17:47 +0200
committerPaul Sokolovsky2015-01-13 03:17:47 +0200
commitd511a20a6ba28571b106e714eee8329288de7ba4 (patch)
tree9021fb27be6db7cb1fa744e746f3c0e661f8ade3 /minimal/Makefile
parentbbf5cd01e3587f39600d24fb030f09a4c92bcb46 (diff)
minimal: New port, intended to represent minimal working code.
Unlike bare-arm, which is mostly intended to show raw interpreter size, without library and support code dependencies. This port is intended to be a better base to start new ports, and also will include emulation build to allow debug some aspects of embedded targets on POSIX systems. This initial commit is verbatim copy of bare-arm code.
Diffstat (limited to 'minimal/Makefile')
-rw-r--r--minimal/Makefile48
1 files changed, 48 insertions, 0 deletions
diff --git a/minimal/Makefile b/minimal/Makefile
new file mode 100644
index 000000000..a59bb9f89
--- /dev/null
+++ b/minimal/Makefile
@@ -0,0 +1,48 @@
+include ../py/mkenv.mk
+
+# qstr definitions (must come before including py.mk)
+QSTR_DEFS = qstrdefsport.h
+
+# include py core make definitions
+include ../py/py.mk
+
+CROSS_COMPILE = arm-none-eabi-
+
+INC = -I.
+INC += -I..
+INC += -I$(BUILD)
+
+CFLAGS_CORTEX_M4 = -mthumb -mtune=cortex-m4 -mabi=aapcs-linux -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard -fsingle-precision-constant -Wdouble-promotion
+CFLAGS = $(INC) -Wall -Werror -ansi -std=gnu99 -nostdlib $(CFLAGS_CORTEX_M4) $(COPT)
+
+#Debugging/Optimization
+ifeq ($(DEBUG), 1)
+CFLAGS += -O0 -ggdb
+else
+CFLAGS += -Os -DNDEBUG
+endif
+
+LDFLAGS = -nostdlib -T stm32f405.ld -Map=$@.map --cref
+LIBS =
+
+SRC_C = \
+ main.c \
+# printf.c \
+ string0.c \
+ malloc0.c \
+ gccollect.c \
+
+SRC_S = \
+# startup_stm32f40xx.s \
+ gchelper.s \
+
+OBJ = $(PY_O) $(addprefix $(BUILD)/, $(SRC_C:.c=.o) $(SRC_S:.s=.o))
+
+all: $(BUILD)/firmware.elf
+
+$(BUILD)/firmware.elf: $(OBJ)
+ $(ECHO) "LINK $@"
+ $(Q)$(LD) $(LDFLAGS) -o $@ $(OBJ) $(LIBS)
+ $(Q)$(SIZE) $@
+
+include ../py/mkrules.mk