summaryrefslogtreecommitdiff
path: root/teensy/Makefile
diff options
context:
space:
mode:
authorDave Hylands <dhylands@gmail.com>2014-01-08 01:00:22 -0800
committerDave Hylands <dhylands@gmail.com>2014-01-11 16:16:20 -0800
commitd80ee8bbfd52fd44f623aabbef4544f9572aca9e (patch)
tree6af7aed612e1e335b47f5e36c5c792c9bb537dda /teensy/Makefile
parentc698d266d1f13fe82a5ac291f7c6642da3dc0bdc (diff)
Added memzip filesystem support for teensy
You can now append a zipfile (containining uncomressed python sources) to the micropython.hex file. Use MEMZIP_DIR=directory when you call make, or set that in your environment to include a different tree of source files. Added sample /boot.py, /src/main.py, /test.py and /src/test.py files. Added run command so that you can execute scripts from REPL (until import is implemented). Added build directory to .gitignore
Diffstat (limited to 'teensy/Makefile')
-rw-r--r--teensy/Makefile17
1 files changed, 13 insertions, 4 deletions
diff --git a/teensy/Makefile b/teensy/Makefile
index ade9b3704..8046f862a 100644
--- a/teensy/Makefile
+++ b/teensy/Makefile
@@ -33,7 +33,8 @@ SRC_C = \
lcd.c \
led.c \
lexerfatfs.c \
- usart.c \
+ lexermemzip.c \
+ memzip.c \
usb.c \
STM_SRC_C = \
@@ -60,9 +61,9 @@ OBJ = $(addprefix $(BUILD)/, $(SRC_C:.c=.o) $(STM_SRC_C:.c=.o) $(STM_SRC_S:.s=.o
#LIB += -ltermcap
all2: $(BUILD) hex
-hex: $(BUILD)/flash.hex
+hex: $(BUILD)/micropython-mz.hex
-post_compile: $(BUILD)/flash.hex
+post_compile: $(BUILD)/micropython-mz.hex
$(ECHO) "Preparing $@ for upload"
$(Q)$(TOOLS_PATH)/teensy_post_compile -file="$(basename $(<F))" -path="$(<D)" -tools="$(TOOLS_PATH)"
@@ -72,11 +73,19 @@ reboot:
upload: post_compile reboot
-$(BUILD)/flash.elf: $(OBJ)
+$(BUILD)/micropython.elf: $(OBJ)
$(ECHO) "LINK $<"
$(Q)$(CC) $(LDFLAGS) -o "$@" -Wl,-Map,$(@:.elf=.map) $(OBJ) $(LIBS)
$(Q)$(SIZE) $@
+ifeq ($(MEMZIP_DIR),)
+MEMZIP_DIR = memzip_files
+endif
+
+$(BUILD)/micropython-mz.hex: $(BUILD)/micropython.hex $(shell find ${MEMZIP_DIR} -type f)
+ @$(ECHO) "Creating $@"
+ $(Q)./add-memzip.sh $< $@ ${MEMZIP_DIR}
+
$(BUILD)/%.hex: $(BUILD)/%.elf
$(ECHO) "HEX $<"
$(Q)$(OBJCOPY) -O ihex -R .eeprom "$<" "$@"