commit
59a67e543d
13
Makefile
13
Makefile
|
@ -30,6 +30,7 @@ ifeq ($(OS),Windows_NT)
|
|||
OBJCOPY = xtensa-lx106-elf-objcopy
|
||||
endif
|
||||
FIRMWAREDIR = ..\\bin\\
|
||||
ESPPORT = com1
|
||||
ifeq ($(PROCESSOR_ARCHITECTURE),AMD64)
|
||||
# ->AMD64
|
||||
endif
|
||||
|
@ -39,6 +40,7 @@ ifeq ($(OS),Windows_NT)
|
|||
else
|
||||
# We are under other system, may be Linux. Assume using gcc.
|
||||
# Can we use -fdata-sections?
|
||||
ESPPORT = /dev/ttyUSB0
|
||||
CCFLAGS += -Os -ffunction-sections -fno-jump-tables
|
||||
AR = xtensa-lx106-elf-ar
|
||||
CC = xtensa-lx106-elf-gcc
|
||||
|
@ -65,6 +67,8 @@ else
|
|||
endif
|
||||
endif
|
||||
#############################################################
|
||||
ESPTOOL = ../tools/esptool.py
|
||||
|
||||
|
||||
CSRCS ?= $(wildcard *.c)
|
||||
ASRCs ?= $(wildcard *.s)
|
||||
|
@ -137,7 +141,7 @@ endef
|
|||
|
||||
$(BINODIR)/%.bin: $(IMAGEODIR)/%.out
|
||||
@mkdir -p $(BINODIR)
|
||||
../tools/esptool.py elf2image $< -o $(FIRMWAREDIR)
|
||||
$(ESPTOOL) elf2image $< -o $(FIRMWAREDIR)
|
||||
|
||||
#############################################################
|
||||
# Rules base
|
||||
|
@ -154,6 +158,13 @@ clobber: $(SPECIAL_CLOBBER)
|
|||
$(foreach d, $(SUBDIRS), $(MAKE) -C $(d) clobber;)
|
||||
$(RM) -r $(ODIR)
|
||||
|
||||
flash:
|
||||
ifndef PDIR
|
||||
$(MAKE) -C ./app flash
|
||||
else
|
||||
$(ESPTOOL) --port $(ESPPORT) write_flash 0x00000 $(FIRMWAREDIR)0x00000.bin 0x10000 $(FIRMWAREDIR)0x10000.bin
|
||||
endif
|
||||
|
||||
.subdirs:
|
||||
@set -e; $(foreach d, $(SUBDIRS), $(MAKE) -C $(d);)
|
||||
|
||||
|
|
17
app/Makefile
17
app/Makefile
|
@ -152,23 +152,6 @@ INCLUDES += -I ./
|
|||
PDIR := ../$(PDIR)
|
||||
sinclude $(PDIR)Makefile
|
||||
|
||||
#########################################################################
|
||||
#
|
||||
# generate bin file
|
||||
#
|
||||
|
||||
ifeq ($(OS),Windows_NT)
|
||||
PORT = com1
|
||||
else
|
||||
PORT = /dev/ttyUSB0
|
||||
endif
|
||||
|
||||
$(BINODIR)/%.bin: $(IMAGEODIR)/%.out
|
||||
@mkdir -p $(BINODIR)
|
||||
../tools/esptool.py elf2image $< -o $(FIRMWAREDIR)
|
||||
|
||||
flash:
|
||||
../tools/esptool.py -p $(PORT) write_flash 0x00000 ../bin/0x00000.bin 0x10000 ../bin/0x10000.bin
|
||||
|
||||
.PHONY: FORCE
|
||||
FORCE:
|
||||
|
|
Loading…
Reference in New Issue