Commit f28efa19 authored by Paul Sokolovsky's avatar Paul Sokolovsky
Browse files

py: Move frozen modules rules from esp8266 port for reuse across ports.

A port now just needs to define FROZEN_DIR var and add $(BUILD)/frozen.c
to SRC_C to support frozen modules.
parent 8ae885a0
......@@ -171,9 +171,7 @@ endif
$(BUILD)/uart.o: $(CONFVARS_FILE)
$(BUILD)/frozen.c: $(wildcard $(FROZEN_DIR)/*) $(CONFVARS_FILE)
$(ECHO) "Generating $@"
$(Q)$(MAKE_FROZEN) $(FROZEN_DIR) > $@
FROZEN_EXTRA_DEPS = $(CONFVARS_FILE)
# to build .mpy files from .py files
$(BUILD)/$(FROZEN_MPY_DIR)/%.mpy: $(FROZEN_MPY_DIR)/%.py
......
......@@ -58,6 +58,8 @@ CXX += -m32
LD += -m32
endif
MAKE_FROZEN = ../tools/make-frozen.py
all:
.PHONY: all
......
......@@ -100,6 +100,12 @@ $(OBJ_DIRS):
$(HEADER_BUILD):
$(MKDIR) -p $@
ifneq ($(FROZEN_DIR),)
$(BUILD)/frozen.c: $(wildcard $(FROZEN_DIR)/*) $(HEADER_BUILD) $(FROZEN_EXTRA_DEPS)
$(ECHO) "Generating $@"
$(Q)$(MAKE_FROZEN) $(FROZEN_DIR) > $@
endif
ifneq ($(PROG),)
# Build a standalone executable (unix does this)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment