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.
This commit is contained in:
parent
8ae885a0c6
commit
f28efa1971
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in New Issue