Makefile: improvements

- add BOOTFILE variable to set proper bootfile (1.5 vs 1.4(b1))
- move CFLAGS before "include local.conf"
- add ems to MODULES
- show MODULES in "all"
pull/95/head
susisstrolch 9 years ago
parent 3bf3ba5e0c
commit d6f067fe35
  1. 14
      Makefile

@ -13,6 +13,9 @@
# `VERBOSE=1 make ...` will print debug info # `VERBOSE=1 make ...` will print debug info
# `ESP_HOSTNAME=my.esp.example.com make wiflash` is an easy way to override a variable # `ESP_HOSTNAME=my.esp.example.com make wiflash` is an easy way to override a variable
# CFLAGS may be changed by local.conf
CFLAGS=
# optional local configuration file # optional local configuration file
-include local.conf -include local.conf
@ -31,6 +34,8 @@ XTENSA_TOOLS_ROOT ?= $(abspath ../esp-open-sdk/xtensa-lx106-elf/bin)/
# Base directory of the ESP8266 SDK package, absolute # Base directory of the ESP8266 SDK package, absolute
# Typically you'll download from Espressif's BBS, http://bbs.espressif.com/viewforum.php?f=5 # Typically you'll download from Espressif's BBS, http://bbs.espressif.com/viewforum.php?f=5
SDK_BASE ?= $(abspath ../esp_iot_sdk_v1.5.0) SDK_BASE ?= $(abspath ../esp_iot_sdk_v1.5.0)
# BOOTFILE = /bin/boot_v1.4(b1).bin
BOOTFILE = /bin/boot_v1.5.bin
# Esptool.py path and port, only used for 1-time serial flashing # Esptool.py path and port, only used for 1-time serial flashing
# Typically you'll use https://github.com/themadinventor/esptool # Typically you'll use https://github.com/themadinventor/esptool
@ -72,7 +77,7 @@ LED_SERIAL_PIN ?= 14
CHANGE_TO_STA ?= yes CHANGE_TO_STA ?= yes
# Optional Modules # Optional Modules
MODULES ?= mqtt rest syslog MODULES ?= mqtt rest syslog ems
# --------------- esphttpd config options --------------- # --------------- esphttpd config options ---------------
@ -176,8 +181,6 @@ TARGET = httpd
# espressif tool to concatenate sections for OTA upload using bootloader v1.2+ # espressif tool to concatenate sections for OTA upload using bootloader v1.2+
APPGEN_TOOL ?= gen_appbin.py APPGEN_TOOL ?= gen_appbin.py
CFLAGS=
# set defines for optional modules # set defines for optional modules
ifneq (,$(findstring mqtt,$(MODULES))) ifneq (,$(findstring mqtt,$(MODULES)))
CFLAGS += -DMQTT CFLAGS += -DMQTT
@ -290,6 +293,7 @@ all: echo_version checkdirs $(FW_BASE)/user1.bin $(FW_BASE)/user2.bin
echo_version: echo_version:
@echo VERSION: $(VERSION) @echo VERSION: $(VERSION)
@echo MODULES: $(MODULES)
$(USER1_OUT): $(APP_AR) $(LD_SCRIPT1) $(USER1_OUT): $(APP_AR) $(LD_SCRIPT1)
$(vecho) "LD $@" $(vecho) "LD $@"
@ -346,7 +350,7 @@ baseflash: all
flash: all flash: all
$(Q) $(ESPTOOL) --port $(ESPPORT) --baud $(ESPBAUD) write_flash -fs $(ET_FS) -ff $(ET_FF) \ $(Q) $(ESPTOOL) --port $(ESPPORT) --baud $(ESPBAUD) write_flash -fs $(ET_FS) -ff $(ET_FF) \
0x00000 "$(SDK_BASE)/bin/boot_v1.4(b1).bin" 0x01000 $(FW_BASE)/user1.bin \ 0x00000 "$(SDK_BASE)$(BOOTFILE)" 0x01000 $(FW_BASE)/user1.bin \
$(ET_BLANK) $(SDK_BASE)/bin/blank.bin $(ET_BLANK) $(SDK_BASE)/bin/blank.bin
tools/$(HTML_COMPRESSOR): tools/$(HTML_COMPRESSOR):
@ -426,7 +430,7 @@ release: all
$(Q) egrep -a 'esp-link [a-z0-9.]+ - 201' $(FW_BASE)/user1.bin | cut -b 1-80 $(Q) egrep -a 'esp-link [a-z0-9.]+ - 201' $(FW_BASE)/user1.bin | cut -b 1-80
$(Q) egrep -a 'esp-link [a-z0-9.]+ - 201' $(FW_BASE)/user2.bin | cut -b 1-80 $(Q) egrep -a 'esp-link [a-z0-9.]+ - 201' $(FW_BASE)/user2.bin | cut -b 1-80
$(Q) cp $(FW_BASE)/user1.bin $(FW_BASE)/user2.bin $(SDK_BASE)/bin/blank.bin \ $(Q) cp $(FW_BASE)/user1.bin $(FW_BASE)/user2.bin $(SDK_BASE)/bin/blank.bin \
"$(SDK_BASE)/bin/boot_v1.4(b1).bin" wiflash avrflash release/esp-link-$(BRANCH) "$(SDK_BASE)$(BOOTFILE)" wiflash avrflash release/esp-link-$(BRANCH)
$(Q) tar zcf esp-link-$(BRANCH).tgz -C release esp-link-$(BRANCH) $(Q) tar zcf esp-link-$(BRANCH).tgz -C release esp-link-$(BRANCH)
$(Q) echo "Release file: esp-link-$(BRANCH).tgz" $(Q) echo "Release file: esp-link-$(BRANCH).tgz"
$(Q) rm -rf release $(Q) rm -rf release

Loading…
Cancel
Save