Skip to content

Fix build issues with MQTT example and python3 #234

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 19 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ ifndef PDIR

endif

MAKEFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
SDKDIR := $(patsubst %/,%,$(dir $(MAKEFILE_PATH)))/
ifndef PYTHON
PYTHON := python
endif

ifeq ($(COMPILE), gcc)
AR = xtensa-lx106-elf-ar
CC = xtensa-lx106-elf-gcc
Expand Down Expand Up @@ -260,14 +266,14 @@ $(BINODIR)/%.bin: $(IMAGEODIR)/%.out
@mkdir -p $(BINODIR)

ifeq ($(APP), 0)
@$(RM) -r ../bin/eagle.S ../bin/eagle.dump
@$(OBJDUMP) -x -s $< > ../bin/eagle.dump
@$(OBJDUMP) -S $< > ../bin/eagle.S
@$(RM) -r $(SDKDIR)bin/eagle.S $(SDKDIR)bin/eagle.dump
@$(OBJDUMP) -x -s $< > $(SDKDIR)bin/eagle.dump
@$(OBJDUMP) -S $< > $(SDKDIR)bin/eagle.S
else
mkdir -p ../bin/upgrade
@$(RM) -r ../bin/upgrade/$(BIN_NAME).S ../bin/upgrade/$(BIN_NAME).dump
@$(OBJDUMP) -x -s $< > ../bin/upgrade/$(BIN_NAME).dump
@$(OBJDUMP) -S $< > ../bin/upgrade/$(BIN_NAME).S
mkdir -p $(SDKDIR)bin/upgrade
@$(RM) -r $(SDKDIR)bin/upgrade/$(BIN_NAME).S $(SDKDIR)bin/upgrade/$(BIN_NAME).dump
@$(OBJDUMP) -x -s $< > $(SDKDIR)bin/upgrade/$(BIN_NAME).dump
@$(OBJDUMP) -S $< > $(SDKDIR)bin/upgrade/$(BIN_NAME).S
endif

@$(OBJCOPY) --only-section .text -O binary $< eagle.app.v6.text.bin
Expand All @@ -279,20 +285,20 @@ endif
@echo "!!!"

ifeq ($(app), 0)
@python ../tools/gen_appbin.py $< 0 $(mode) $(freqdiv) $(size_map) $(app)
@mv eagle.app.flash.bin ../bin/eagle.flash.bin
@mv eagle.app.v6.irom0text.bin ../bin/eagle.irom0text.bin
@$(PYTHON) $(SDKDIR)tools/gen_appbin.py $< 0 $(mode) $(freqdiv) $(size_map) $(app)
@mv eagle.app.flash.bin $(SDKDIR)bin/eagle.flash.bin
@mv eagle.app.v6.irom0text.bin $(SDKDIR)bin/eagle.irom0text.bin
@rm eagle.app.v6.*
@echo "No boot needed."
@echo "Generate eagle.flash.bin and eagle.irom0text.bin successully in folder bin."
@echo "eagle.flash.bin-------->0x00000"
@echo "eagle.irom0text.bin---->0x10000"
else
ifneq ($(boot), new)
@python ../tools/gen_appbin.py $< 1 $(mode) $(freqdiv) $(size_map) $(app)
@$(PYTHON) $(SDKDIR)tools/gen_appbin.py $< 1 $(mode) $(freqdiv) $(size_map) $(app)
@echo "Support boot_v1.1 and +"
else
@python ../tools/gen_appbin.py $< 2 $(mode) $(freqdiv) $(size_map) $(app)
@$(PYTHON) $(SDKDIR)tools/gen_appbin.py $< 2 $(mode) $(freqdiv) $(size_map) $(app)

ifeq ($(size_map), 6)
@echo "Support boot_v1.4 and +"
Expand All @@ -305,7 +311,7 @@ else
endif
endif

@mv eagle.app.flash.bin ../bin/upgrade/$(BIN_NAME).bin
@mv eagle.app.flash.bin $(SDKDIR)bin/upgrade/$(BIN_NAME).bin
@rm eagle.app.v6.*
@echo "Generate $(BIN_NAME).bin successully in folder bin/upgrade."
@echo "boot.bin------------>0x00000"
Expand Down
7 changes: 4 additions & 3 deletions examples/esp_mqtt_proj/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ SUBDIRS= \
endif # } PDIR

APPDIR = .
LDDIR = ../ld
LDDIR = ../../ld

CCFLAGS += -Os

Expand All @@ -53,7 +53,8 @@ COMPONENTS_eagle.app.v6 = \
modules/libmodules.a

LINKFLAGS_eagle.app.v6 = \
-L../lib \
-L../../lib \
-L../../ld \
-nostdlib \
-T$(LD_FILE) \
-Wl,--no-check-sections \
Expand Down Expand Up @@ -123,7 +124,7 @@ DDEFINES += \
#

INCLUDES := $(INCLUDES) -I $(PDIR)include -I $(PDIR)include/mqtt -I $(PDIR)include/modules
PDIR := ../$(PDIR)
PDIR := ../../$(PDIR)
sinclude $(PDIR)Makefile

.PHONY: FORCE
Expand Down