2014-12-22 12:35:05 +01:00
|
|
|
# copyright (c) 2010 Espressif System
|
Initial pass at switching to RTOS SDK.
This compiles, links, and starts the RTOS without crashing and burning.
Lua environment does not yet start due to the different task architecture.
Known pain points:
- task implementation needs to be rewritten for RTOS (next up on my TODO)
- secure espconn does not exist, all secure espconn stuff has been #if 0'd
- lwip now built from within the RTOS SDK, but does not appear to include
MDNS support. Investigation needed.
- there is no access to FRC1 NMI, not sure if we ever actually used that
however. Also #if 0'd out for now.
- new timing constraints introduced by the RTOS, all use of ets_delay_us()
and os_delay_us() needs to be reviewed (the tsl2561 driver in particular).
- even more confusion with ets_ vs os_ vs c_ vs non-prefixed versions.
In the long run everything should be switched to non-prefixed versions.
- system_set_os_print() not available, needs to be reimplemented
- all the RTOS rodata is loaded into RAM, as it apparently uses some
constants while the flash isn't mapped, so our exception handler can't
work its magic. This should be narrowed down to the minimum possible
at some point.
- with each task having its own stack in RTOS, we probably need change
flash-page buffers from the stack to the heap in a bunch of places.
A single, shared, page buffer *might* be possible if we limit ourselves
to running NodeMCU in a single task.
- there's a ton of junk in the sdk-overrides now; over time the core code
should be updated to not need those shims
2016-05-24 07:05:01 +02:00
|
|
|
# 2015-2016 NodeMCU team
|
2014-12-22 12:35:05 +01:00
|
|
|
#
|
2015-10-01 07:27:42 +02:00
|
|
|
.NOTPARALLEL:
|
2014-12-22 12:35:05 +01:00
|
|
|
|
2015-10-01 07:04:18 +02:00
|
|
|
# Ensure we search "our" SDK before the tool-chain's SDK (if any)
|
2015-12-20 04:39:17 +01:00
|
|
|
TOP_DIR:=$(abspath $(dir $(lastword $(MAKEFILE_LIST))))
|
Initial pass at switching to RTOS SDK.
This compiles, links, and starts the RTOS without crashing and burning.
Lua environment does not yet start due to the different task architecture.
Known pain points:
- task implementation needs to be rewritten for RTOS (next up on my TODO)
- secure espconn does not exist, all secure espconn stuff has been #if 0'd
- lwip now built from within the RTOS SDK, but does not appear to include
MDNS support. Investigation needed.
- there is no access to FRC1 NMI, not sure if we ever actually used that
however. Also #if 0'd out for now.
- new timing constraints introduced by the RTOS, all use of ets_delay_us()
and os_delay_us() needs to be reviewed (the tsl2561 driver in particular).
- even more confusion with ets_ vs os_ vs c_ vs non-prefixed versions.
In the long run everything should be switched to non-prefixed versions.
- system_set_os_print() not available, needs to be reimplemented
- all the RTOS rodata is loaded into RAM, as it apparently uses some
constants while the flash isn't mapped, so our exception handler can't
work its magic. This should be narrowed down to the minimum possible
at some point.
- with each task having its own stack in RTOS, we probably need change
flash-page buffers from the stack to the heap in a bunch of places.
A single, shared, page buffer *might* be possible if we limit ourselves
to running NodeMCU in a single task.
- there's a ton of junk in the sdk-overrides now; over time the core code
should be updated to not need those shims
2016-05-24 07:05:01 +02:00
|
|
|
SDK_DIR:=$(TOP_DIR)/rtos-sdk
|
|
|
|
|
|
|
|
# This is, sadly, the cleanest way to resolve the different non-standard
|
|
|
|
# conventions for sized integers across the various components.
|
2016-05-26 10:36:20 +02:00
|
|
|
BASIC_TYPES=-Du32_t=uint32_t -Du16_t=uint16_t -Du8_t=uint8_t -Ds32_t=int32_t -Ds16_t=int16_t -Duint32=uint32_t -Duint16=uint16_t -Duint8=uint8_t -Dsint32=int32_t -Dsint16=int16_t -Dsint8=int8_t
|
Initial pass at switching to RTOS SDK.
This compiles, links, and starts the RTOS without crashing and burning.
Lua environment does not yet start due to the different task architecture.
Known pain points:
- task implementation needs to be rewritten for RTOS (next up on my TODO)
- secure espconn does not exist, all secure espconn stuff has been #if 0'd
- lwip now built from within the RTOS SDK, but does not appear to include
MDNS support. Investigation needed.
- there is no access to FRC1 NMI, not sure if we ever actually used that
however. Also #if 0'd out for now.
- new timing constraints introduced by the RTOS, all use of ets_delay_us()
and os_delay_us() needs to be reviewed (the tsl2561 driver in particular).
- even more confusion with ets_ vs os_ vs c_ vs non-prefixed versions.
In the long run everything should be switched to non-prefixed versions.
- system_set_os_print() not available, needs to be reimplemented
- all the RTOS rodata is loaded into RAM, as it apparently uses some
constants while the flash isn't mapped, so our exception handler can't
work its magic. This should be narrowed down to the minimum possible
at some point.
- with each task having its own stack in RTOS, we probably need change
flash-page buffers from the stack to the heap in a bunch of places.
A single, shared, page buffer *might* be possible if we limit ourselves
to running NodeMCU in a single task.
- there's a ton of junk in the sdk-overrides now; over time the core code
should be updated to not need those shims
2016-05-24 07:05:01 +02:00
|
|
|
|
|
|
|
# Include dirs, ensure the overrides come first
|
|
|
|
INCLUDE_DIRS=$(TOP_DIR)/sdk-overrides/include $(SDK_DIR)/include $(SDK_DIR)/include/espressif $(SDK_DIR)/include/lwip $(SDK_DIR)/include/lwip/ipv4 $(SDK_DIR)/include/lwip/ipv6 $(SDK_DIR)/extra_include
|
|
|
|
|
|
|
|
# ... and we have to mark them all as system include dirs rather than the usual
|
|
|
|
# -I for user include dir, or the esp-open-sdk toolchain headers wreak havoc
|
|
|
|
CCFLAGS:=$(addprefix -isystem,$(INCLUDE_DIRS)) $(BASIC_TYPES)
|
|
|
|
|
|
|
|
LDFLAGS:= -L$(SDK_DIR)/lib -L$(SDK_DIR)/ld -L$(SDK_DIR)/third_party/lwip/.output/eagle/debug/lib $(LDFLAGS)
|
|
|
|
|
2015-10-01 07:04:18 +02:00
|
|
|
|
2015-01-05 06:15:59 +01:00
|
|
|
#############################################################
|
Initial pass at switching to RTOS SDK.
This compiles, links, and starts the RTOS without crashing and burning.
Lua environment does not yet start due to the different task architecture.
Known pain points:
- task implementation needs to be rewritten for RTOS (next up on my TODO)
- secure espconn does not exist, all secure espconn stuff has been #if 0'd
- lwip now built from within the RTOS SDK, but does not appear to include
MDNS support. Investigation needed.
- there is no access to FRC1 NMI, not sure if we ever actually used that
however. Also #if 0'd out for now.
- new timing constraints introduced by the RTOS, all use of ets_delay_us()
and os_delay_us() needs to be reviewed (the tsl2561 driver in particular).
- even more confusion with ets_ vs os_ vs c_ vs non-prefixed versions.
In the long run everything should be switched to non-prefixed versions.
- system_set_os_print() not available, needs to be reimplemented
- all the RTOS rodata is loaded into RAM, as it apparently uses some
constants while the flash isn't mapped, so our exception handler can't
work its magic. This should be narrowed down to the minimum possible
at some point.
- with each task having its own stack in RTOS, we probably need change
flash-page buffers from the stack to the heap in a bunch of places.
A single, shared, page buffer *might* be possible if we limit ourselves
to running NodeMCU in a single task.
- there's a ton of junk in the sdk-overrides now; over time the core code
should be updated to not need those shims
2016-05-24 07:05:01 +02:00
|
|
|
ifndef COMPORT
|
|
|
|
ESPPORT = /dev/ttyUSB0
|
2015-01-05 06:15:59 +01:00
|
|
|
else
|
Initial pass at switching to RTOS SDK.
This compiles, links, and starts the RTOS without crashing and burning.
Lua environment does not yet start due to the different task architecture.
Known pain points:
- task implementation needs to be rewritten for RTOS (next up on my TODO)
- secure espconn does not exist, all secure espconn stuff has been #if 0'd
- lwip now built from within the RTOS SDK, but does not appear to include
MDNS support. Investigation needed.
- there is no access to FRC1 NMI, not sure if we ever actually used that
however. Also #if 0'd out for now.
- new timing constraints introduced by the RTOS, all use of ets_delay_us()
and os_delay_us() needs to be reviewed (the tsl2561 driver in particular).
- even more confusion with ets_ vs os_ vs c_ vs non-prefixed versions.
In the long run everything should be switched to non-prefixed versions.
- system_set_os_print() not available, needs to be reimplemented
- all the RTOS rodata is loaded into RAM, as it apparently uses some
constants while the flash isn't mapped, so our exception handler can't
work its magic. This should be narrowed down to the minimum possible
at some point.
- with each task having its own stack in RTOS, we probably need change
flash-page buffers from the stack to the heap in a bunch of places.
A single, shared, page buffer *might* be possible if we limit ourselves
to running NodeMCU in a single task.
- there's a ton of junk in the sdk-overrides now; over time the core code
should be updated to not need those shims
2016-05-24 07:05:01 +02:00
|
|
|
ESPPORT = $(COMPORT)
|
2015-01-05 06:15:59 +01:00
|
|
|
endif
|
Initial pass at switching to RTOS SDK.
This compiles, links, and starts the RTOS without crashing and burning.
Lua environment does not yet start due to the different task architecture.
Known pain points:
- task implementation needs to be rewritten for RTOS (next up on my TODO)
- secure espconn does not exist, all secure espconn stuff has been #if 0'd
- lwip now built from within the RTOS SDK, but does not appear to include
MDNS support. Investigation needed.
- there is no access to FRC1 NMI, not sure if we ever actually used that
however. Also #if 0'd out for now.
- new timing constraints introduced by the RTOS, all use of ets_delay_us()
and os_delay_us() needs to be reviewed (the tsl2561 driver in particular).
- even more confusion with ets_ vs os_ vs c_ vs non-prefixed versions.
In the long run everything should be switched to non-prefixed versions.
- system_set_os_print() not available, needs to be reimplemented
- all the RTOS rodata is loaded into RAM, as it apparently uses some
constants while the flash isn't mapped, so our exception handler can't
work its magic. This should be narrowed down to the minimum possible
at some point.
- with each task having its own stack in RTOS, we probably need change
flash-page buffers from the stack to the heap in a bunch of places.
A single, shared, page buffer *might* be possible if we limit ourselves
to running NodeMCU in a single task.
- there's a ton of junk in the sdk-overrides now; over time the core code
should be updated to not need those shims
2016-05-24 07:05:01 +02:00
|
|
|
CCFLAGS += -Os -ffunction-sections -fno-jump-tables -fdata-sections
|
|
|
|
AR = xtensa-lx106-elf-ar
|
|
|
|
CC = xtensa-lx106-elf-gcc
|
|
|
|
NM = xtensa-lx106-elf-nm
|
|
|
|
CPP = xtensa-lx106-elf-cpp
|
|
|
|
OBJCOPY = xtensa-lx106-elf-objcopy
|
|
|
|
FIRMWAREDIR = ../bin/
|
|
|
|
|
2015-01-05 06:15:59 +01:00
|
|
|
#############################################################
|
2015-02-06 04:41:17 +01:00
|
|
|
ESPTOOL ?= ../tools/esptool.py
|
2015-01-10 22:37:12 +01:00
|
|
|
|
2014-12-22 12:35:05 +01:00
|
|
|
|
|
|
|
CSRCS ?= $(wildcard *.c)
|
|
|
|
ASRCs ?= $(wildcard *.s)
|
|
|
|
ASRCS ?= $(wildcard *.S)
|
Initial pass at switching to RTOS SDK.
This compiles, links, and starts the RTOS without crashing and burning.
Lua environment does not yet start due to the different task architecture.
Known pain points:
- task implementation needs to be rewritten for RTOS (next up on my TODO)
- secure espconn does not exist, all secure espconn stuff has been #if 0'd
- lwip now built from within the RTOS SDK, but does not appear to include
MDNS support. Investigation needed.
- there is no access to FRC1 NMI, not sure if we ever actually used that
however. Also #if 0'd out for now.
- new timing constraints introduced by the RTOS, all use of ets_delay_us()
and os_delay_us() needs to be reviewed (the tsl2561 driver in particular).
- even more confusion with ets_ vs os_ vs c_ vs non-prefixed versions.
In the long run everything should be switched to non-prefixed versions.
- system_set_os_print() not available, needs to be reimplemented
- all the RTOS rodata is loaded into RAM, as it apparently uses some
constants while the flash isn't mapped, so our exception handler can't
work its magic. This should be narrowed down to the minimum possible
at some point.
- with each task having its own stack in RTOS, we probably need change
flash-page buffers from the stack to the heap in a bunch of places.
A single, shared, page buffer *might* be possible if we limit ourselves
to running NodeMCU in a single task.
- there's a ton of junk in the sdk-overrides now; over time the core code
should be updated to not need those shims
2016-05-24 07:05:01 +02:00
|
|
|
SUBDIRS ?= $(filter-out rtos-sdk, $(patsubst %/,%,$(dir $(wildcard */Makefile))))
|
2014-12-22 12:35:05 +01:00
|
|
|
|
|
|
|
ODIR := .output
|
|
|
|
OBJODIR := $(ODIR)/$(TARGET)/$(FLAVOR)/obj
|
|
|
|
|
|
|
|
OBJS := $(CSRCS:%.c=$(OBJODIR)/%.o) \
|
|
|
|
$(ASRCs:%.s=$(OBJODIR)/%.o) \
|
|
|
|
$(ASRCS:%.S=$(OBJODIR)/%.o)
|
|
|
|
|
|
|
|
DEPS := $(CSRCS:%.c=$(OBJODIR)/%.d) \
|
|
|
|
$(ASRCs:%.s=$(OBJODIR)/%.d) \
|
|
|
|
$(ASRCS:%.S=$(OBJODIR)/%.d)
|
|
|
|
|
|
|
|
LIBODIR := $(ODIR)/$(TARGET)/$(FLAVOR)/lib
|
|
|
|
OLIBS := $(GEN_LIBS:%=$(LIBODIR)/%)
|
|
|
|
|
|
|
|
IMAGEODIR := $(ODIR)/$(TARGET)/$(FLAVOR)/image
|
|
|
|
OIMAGES := $(GEN_IMAGES:%=$(IMAGEODIR)/%)
|
|
|
|
|
|
|
|
BINODIR := $(ODIR)/$(TARGET)/$(FLAVOR)/bin
|
|
|
|
OBINS := $(GEN_BINS:%=$(BINODIR)/%)
|
|
|
|
|
2015-05-01 17:39:47 +02:00
|
|
|
#
|
|
|
|
# Note:
|
|
|
|
# https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html
|
|
|
|
# If you add global optimize options like "-O2" here
|
|
|
|
# they will override "-Os" defined above.
|
|
|
|
# "-Os" should be used to reduce code size
|
|
|
|
#
|
2014-12-22 12:35:05 +01:00
|
|
|
CCFLAGS += \
|
|
|
|
-g \
|
|
|
|
-Wpointer-arith \
|
|
|
|
-Wundef \
|
|
|
|
-Werror \
|
|
|
|
-Wl,-EL \
|
|
|
|
-fno-inline-functions \
|
|
|
|
-nostdlib \
|
|
|
|
-mlongcalls \
|
|
|
|
-mtext-section-literals
|
|
|
|
# -Wall
|
|
|
|
|
2016-01-22 00:55:57 +01:00
|
|
|
CFLAGS = $(CCFLAGS) $(DEFINES) $(EXTRA_CCFLAGS) $(STD_CFLAGS) $(INCLUDES)
|
|
|
|
DFLAGS = $(CCFLAGS) $(DDEFINES) $(EXTRA_CCFLAGS) $(STD_CFLAGS) $(INCLUDES)
|
2014-12-22 12:35:05 +01:00
|
|
|
|
|
|
|
|
|
|
|
#############################################################
|
|
|
|
# Functions
|
|
|
|
#
|
|
|
|
|
|
|
|
define ShortcutRule
|
|
|
|
$(1): .subdirs $(2)/$(1)
|
|
|
|
endef
|
|
|
|
|
|
|
|
define MakeLibrary
|
|
|
|
DEP_LIBS_$(1) = $$(foreach lib,$$(filter %.a,$$(COMPONENTS_$(1))),$$(dir $$(lib))$$(LIBODIR)/$$(notdir $$(lib)))
|
|
|
|
DEP_OBJS_$(1) = $$(foreach obj,$$(filter %.o,$$(COMPONENTS_$(1))),$$(dir $$(obj))$$(OBJODIR)/$$(notdir $$(obj)))
|
|
|
|
$$(LIBODIR)/$(1).a: $$(OBJS) $$(DEP_OBJS_$(1)) $$(DEP_LIBS_$(1)) $$(DEPENDS_$(1))
|
|
|
|
@mkdir -p $$(LIBODIR)
|
|
|
|
$$(if $$(filter %.a,$$?),mkdir -p $$(EXTRACT_DIR)_$(1))
|
|
|
|
$$(if $$(filter %.a,$$?),cd $$(EXTRACT_DIR)_$(1); $$(foreach lib,$$(filter %.a,$$?),$$(AR) xo $$(UP_EXTRACT_DIR)/$$(lib);))
|
|
|
|
$$(AR) ru $$@ $$(filter %.o,$$?) $$(if $$(filter %.a,$$?),$$(EXTRACT_DIR)_$(1)/*.o)
|
|
|
|
$$(if $$(filter %.a,$$?),$$(RM) -r $$(EXTRACT_DIR)_$(1))
|
|
|
|
endef
|
|
|
|
|
|
|
|
define MakeImage
|
|
|
|
DEP_LIBS_$(1) = $$(foreach lib,$$(filter %.a,$$(COMPONENTS_$(1))),$$(dir $$(lib))$$(LIBODIR)/$$(notdir $$(lib)))
|
|
|
|
DEP_OBJS_$(1) = $$(foreach obj,$$(filter %.o,$$(COMPONENTS_$(1))),$$(dir $$(obj))$$(OBJODIR)/$$(notdir $$(obj)))
|
|
|
|
$$(IMAGEODIR)/$(1).out: $$(OBJS) $$(DEP_OBJS_$(1)) $$(DEP_LIBS_$(1)) $$(DEPENDS_$(1))
|
|
|
|
@mkdir -p $$(IMAGEODIR)
|
|
|
|
$$(CC) $$(LDFLAGS) $$(if $$(LINKFLAGS_$(1)),$$(LINKFLAGS_$(1)),$$(LINKFLAGS_DEFAULT) $$(OBJS) $$(DEP_OBJS_$(1)) $$(DEP_LIBS_$(1))) -o $$@
|
|
|
|
endef
|
|
|
|
|
|
|
|
$(BINODIR)/%.bin: $(IMAGEODIR)/%.out
|
|
|
|
@mkdir -p $(BINODIR)
|
2015-01-11 12:52:24 +01:00
|
|
|
$(ESPTOOL) elf2image $< -o $(FIRMWAREDIR)
|
2014-12-22 12:35:05 +01:00
|
|
|
|
|
|
|
#############################################################
|
|
|
|
# Rules base
|
|
|
|
# Should be done in top-level makefile only
|
|
|
|
#
|
|
|
|
|
Initial pass at switching to RTOS SDK.
This compiles, links, and starts the RTOS without crashing and burning.
Lua environment does not yet start due to the different task architecture.
Known pain points:
- task implementation needs to be rewritten for RTOS (next up on my TODO)
- secure espconn does not exist, all secure espconn stuff has been #if 0'd
- lwip now built from within the RTOS SDK, but does not appear to include
MDNS support. Investigation needed.
- there is no access to FRC1 NMI, not sure if we ever actually used that
however. Also #if 0'd out for now.
- new timing constraints introduced by the RTOS, all use of ets_delay_us()
and os_delay_us() needs to be reviewed (the tsl2561 driver in particular).
- even more confusion with ets_ vs os_ vs c_ vs non-prefixed versions.
In the long run everything should be switched to non-prefixed versions.
- system_set_os_print() not available, needs to be reimplemented
- all the RTOS rodata is loaded into RAM, as it apparently uses some
constants while the flash isn't mapped, so our exception handler can't
work its magic. This should be narrowed down to the minimum possible
at some point.
- with each task having its own stack in RTOS, we probably need change
flash-page buffers from the stack to the heap in a bunch of places.
A single, shared, page buffer *might* be possible if we limit ourselves
to running NodeMCU in a single task.
- there's a ton of junk in the sdk-overrides now; over time the core code
should be updated to not need those shims
2016-05-24 07:05:01 +02:00
|
|
|
all: sdk_built pre_build .subdirs $(OBJS) $(OLIBS) $(OIMAGES) $(OBINS) $(SPECIAL_MKTARGETS)
|
2015-12-20 04:39:17 +01:00
|
|
|
|
Initial pass at switching to RTOS SDK.
This compiles, links, and starts the RTOS without crashing and burning.
Lua environment does not yet start due to the different task architecture.
Known pain points:
- task implementation needs to be rewritten for RTOS (next up on my TODO)
- secure espconn does not exist, all secure espconn stuff has been #if 0'd
- lwip now built from within the RTOS SDK, but does not appear to include
MDNS support. Investigation needed.
- there is no access to FRC1 NMI, not sure if we ever actually used that
however. Also #if 0'd out for now.
- new timing constraints introduced by the RTOS, all use of ets_delay_us()
and os_delay_us() needs to be reviewed (the tsl2561 driver in particular).
- even more confusion with ets_ vs os_ vs c_ vs non-prefixed versions.
In the long run everything should be switched to non-prefixed versions.
- system_set_os_print() not available, needs to be reimplemented
- all the RTOS rodata is loaded into RAM, as it apparently uses some
constants while the flash isn't mapped, so our exception handler can't
work its magic. This should be narrowed down to the minimum possible
at some point.
- with each task having its own stack in RTOS, we probably need change
flash-page buffers from the stack to the heap in a bunch of places.
A single, shared, page buffer *might* be possible if we limit ourselves
to running NodeMCU in a single task.
- there's a ton of junk in the sdk-overrides now; over time the core code
should be updated to not need those shims
2016-05-24 07:05:01 +02:00
|
|
|
.PHONY: sdk_built
|
|
|
|
sdk_built:
|
|
|
|
$(MAKE) -C $(SDK_DIR)/third_party/lwip SDK_PATH=$(SDK_DIR) -j1
|
2016-01-10 07:57:24 +01:00
|
|
|
|
2014-12-22 12:35:05 +01:00
|
|
|
clean:
|
|
|
|
$(foreach d, $(SUBDIRS), $(MAKE) -C $(d) clean;)
|
|
|
|
$(RM) -r $(ODIR)/$(TARGET)/$(FLAVOR)
|
2015-12-20 04:39:17 +01:00
|
|
|
$(RM) -r "$(TOP_DIR)/sdk"
|
2014-12-22 12:35:05 +01:00
|
|
|
|
|
|
|
clobber: $(SPECIAL_CLOBBER)
|
|
|
|
$(foreach d, $(SUBDIRS), $(MAKE) -C $(d) clobber;)
|
|
|
|
$(RM) -r $(ODIR)
|
|
|
|
|
2015-01-10 21:48:04 +01:00
|
|
|
flash:
|
|
|
|
ifndef PDIR
|
|
|
|
$(MAKE) -C ./app flash
|
|
|
|
else
|
2015-01-11 12:52:24 +01:00
|
|
|
$(ESPTOOL) --port $(ESPPORT) write_flash 0x00000 $(FIRMWAREDIR)0x00000.bin 0x10000 $(FIRMWAREDIR)0x10000.bin
|
2015-01-10 21:48:04 +01:00
|
|
|
endif
|
|
|
|
|
Initial pass at switching to RTOS SDK.
This compiles, links, and starts the RTOS without crashing and burning.
Lua environment does not yet start due to the different task architecture.
Known pain points:
- task implementation needs to be rewritten for RTOS (next up on my TODO)
- secure espconn does not exist, all secure espconn stuff has been #if 0'd
- lwip now built from within the RTOS SDK, but does not appear to include
MDNS support. Investigation needed.
- there is no access to FRC1 NMI, not sure if we ever actually used that
however. Also #if 0'd out for now.
- new timing constraints introduced by the RTOS, all use of ets_delay_us()
and os_delay_us() needs to be reviewed (the tsl2561 driver in particular).
- even more confusion with ets_ vs os_ vs c_ vs non-prefixed versions.
In the long run everything should be switched to non-prefixed versions.
- system_set_os_print() not available, needs to be reimplemented
- all the RTOS rodata is loaded into RAM, as it apparently uses some
constants while the flash isn't mapped, so our exception handler can't
work its magic. This should be narrowed down to the minimum possible
at some point.
- with each task having its own stack in RTOS, we probably need change
flash-page buffers from the stack to the heap in a bunch of places.
A single, shared, page buffer *might* be possible if we limit ourselves
to running NodeMCU in a single task.
- there's a ton of junk in the sdk-overrides now; over time the core code
should be updated to not need those shims
2016-05-24 07:05:01 +02:00
|
|
|
.subdirs: | sdk_built
|
2014-12-22 12:35:05 +01:00
|
|
|
@set -e; $(foreach d, $(SUBDIRS), $(MAKE) -C $(d);)
|
|
|
|
|
|
|
|
ifneq ($(MAKECMDGOALS),clean)
|
|
|
|
ifneq ($(MAKECMDGOALS),clobber)
|
|
|
|
ifdef DEPS
|
|
|
|
sinclude $(DEPS)
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2016-03-07 02:25:05 +01:00
|
|
|
.PHONY: pre_build
|
|
|
|
|
|
|
|
ifneq ($(wildcard $(TOP_DIR)/server-ca.crt),)
|
2016-03-10 04:33:19 +01:00
|
|
|
pre_build:
|
2016-03-07 02:25:05 +01:00
|
|
|
python $(TOP_DIR)/tools/make_server_cert.py $(TOP_DIR)/server-ca.crt > $(TOP_DIR)/app/modules/server-ca.crt.h
|
|
|
|
DEFINES += -DHAVE_SSL_SERVER_CRT=\"server-ca.crt.h\"
|
|
|
|
else
|
2016-03-10 04:33:19 +01:00
|
|
|
pre_build:
|
2016-03-07 02:25:05 +01:00
|
|
|
@-rm -f $(TOP_DIR)/app/modules/server-ca.crt.h
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
2014-12-22 12:35:05 +01:00
|
|
|
$(OBJODIR)/%.o: %.c
|
|
|
|
@mkdir -p $(OBJODIR);
|
|
|
|
$(CC) $(if $(findstring $<,$(DSRCS)),$(DFLAGS),$(CFLAGS)) $(COPTS_$(*F)) -o $@ -c $<
|
|
|
|
|
|
|
|
$(OBJODIR)/%.d: %.c
|
|
|
|
@mkdir -p $(OBJODIR);
|
|
|
|
@echo DEPEND: $(CC) -M $(CFLAGS) $<
|
|
|
|
@set -e; rm -f $@; \
|
|
|
|
$(CC) -M $(CFLAGS) $< > $@.$$$$; \
|
|
|
|
sed 's,\($*\.o\)[ :]*,$(OBJODIR)/\1 $@ : ,g' < $@.$$$$ > $@; \
|
|
|
|
rm -f $@.$$$$
|
|
|
|
|
|
|
|
$(OBJODIR)/%.o: %.s
|
|
|
|
@mkdir -p $(OBJODIR);
|
|
|
|
$(CC) $(CFLAGS) -o $@ -c $<
|
|
|
|
|
|
|
|
$(OBJODIR)/%.d: %.s
|
|
|
|
@mkdir -p $(OBJODIR); \
|
|
|
|
set -e; rm -f $@; \
|
|
|
|
$(CC) -M $(CFLAGS) $< > $@.$$$$; \
|
|
|
|
sed 's,\($*\.o\)[ :]*,$(OBJODIR)/\1 $@ : ,g' < $@.$$$$ > $@; \
|
|
|
|
rm -f $@.$$$$
|
|
|
|
|
|
|
|
$(OBJODIR)/%.o: %.S
|
|
|
|
@mkdir -p $(OBJODIR);
|
|
|
|
$(CC) $(CFLAGS) -D__ASSEMBLER__ -o $@ -c $<
|
|
|
|
|
|
|
|
$(OBJODIR)/%.d: %.S
|
|
|
|
@mkdir -p $(OBJODIR); \
|
|
|
|
set -e; rm -f $@; \
|
|
|
|
$(CC) -M $(CFLAGS) $< > $@.$$$$; \
|
|
|
|
sed 's,\($*\.o\)[ :]*,$(OBJODIR)/\1 $@ : ,g' < $@.$$$$ > $@; \
|
|
|
|
rm -f $@.$$$$
|
|
|
|
|
|
|
|
$(foreach lib,$(GEN_LIBS),$(eval $(call ShortcutRule,$(lib),$(LIBODIR))))
|
|
|
|
|
|
|
|
$(foreach image,$(GEN_IMAGES),$(eval $(call ShortcutRule,$(image),$(IMAGEODIR))))
|
|
|
|
|
|
|
|
$(foreach bin,$(GEN_BINS),$(eval $(call ShortcutRule,$(bin),$(BINODIR))))
|
|
|
|
|
|
|
|
$(foreach lib,$(GEN_LIBS),$(eval $(call MakeLibrary,$(basename $(lib)))))
|
|
|
|
|
|
|
|
$(foreach image,$(GEN_IMAGES),$(eval $(call MakeImage,$(basename $(image)))))
|