2016-06-27 15:06:06 +00:00
|
|
|
# Component makefile for extras/spiffs
|
|
|
|
|
|
|
|
SPIFFS_BASE_ADDR ?= 0x300000
|
|
|
|
SPIFFS_SIZE ?= 0x100000
|
|
|
|
|
|
|
|
INC_DIRS += $(spiffs_ROOT)
|
|
|
|
INC_DIRS += $(spiffs_ROOT)spiffs/src
|
|
|
|
|
|
|
|
# args for passing into compile rule generation
|
|
|
|
spiffs_SRC_DIR = $(spiffs_ROOT)spiffs/src
|
|
|
|
spiffs_SRC_DIR += $(spiffs_ROOT)
|
|
|
|
|
|
|
|
spiffs_CFLAGS = $(CFLAGS)
|
|
|
|
spiffs_CFLAGS += -DSPIFFS_BASE_ADDR=$(SPIFFS_BASE_ADDR)
|
|
|
|
spiffs_CFLAGS += -DSPIFFS_SIZE=$(SPIFFS_SIZE)
|
|
|
|
|
2016-07-09 22:33:23 +00:00
|
|
|
|
|
|
|
# Create an SPIFFS image of specified directory and flash it with
|
|
|
|
# the rest of the firmware.
|
|
|
|
#
|
|
|
|
# Argumens:
|
|
|
|
# $(1) - directory with files which go into spiffs image
|
|
|
|
#
|
|
|
|
# Example:
|
|
|
|
# $(eval $(call make_spiffs_image,files))
|
|
|
|
define make_spiffs_image
|
|
|
|
SPIFFS_IMAGE = $(addprefix $(FIRMWARE_DIR),spiffs.bin)
|
|
|
|
MKSPIFFS_DIR = $(ROOT)/extras/spiffs/mkspiffs
|
|
|
|
MKSPIFFS = $$(MKSPIFFS_DIR)/mkspiffs
|
|
|
|
|
|
|
|
all: $$(SPIFFS_IMAGE)
|
|
|
|
|
|
|
|
clean: clean_spiffs_img clean_mkspiffs
|
|
|
|
|
|
|
|
$$(SPIFFS_IMAGE): $$(MKSPIFFS) $(1)
|
|
|
|
$$< $(1) $$@
|
|
|
|
|
|
|
|
$$(MKSPIFFS):
|
|
|
|
$$(MAKE) -C $$(MKSPIFFS_DIR) SPIFFS_SIZE=$(SPIFFS_SIZE)
|
|
|
|
|
|
|
|
clean_spiffs_img:
|
|
|
|
$$(Q) rm -f spiffs.img
|
|
|
|
|
|
|
|
clean_mkspiffs:
|
|
|
|
$$(Q) $$(MAKE) -C $$(MKSPIFFS_DIR) clean
|
|
|
|
|
|
|
|
SPIFFS_ESPTOOL_ARGS = $(SPIFFS_BASE_ADDR) $$(SPIFFS_IMAGE)
|
|
|
|
endef
|
|
|
|
|
2016-06-27 15:06:06 +00:00
|
|
|
$(eval $(call component_compile_rules,spiffs))
|