mirror of
https://github.com/esp8266/Arduino.git
synced 2025-06-12 01:53:07 +03:00
move lwIP source to sdk and add a build hook instead of variant
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@ -5,3 +5,6 @@ tools/esptool/
|
||||
tools/mkspiffs/
|
||||
package/versions/
|
||||
exclude.txt
|
||||
tools/sdk/lib/liblwip_src.a
|
||||
tools/sdk/lwip/src/build
|
||||
tools/sdk/lwip/src/liblwip_src.a
|
||||
|
@ -1368,7 +1368,7 @@ wifinfo.menu.UploadSpeed.921600.upload.speed=921600
|
||||
|
||||
|
||||
##############################################################
|
||||
coredev.name=Generic ESP8266 Module
|
||||
coredev.name=Core Development Module
|
||||
|
||||
coredev.upload.tool=esptool
|
||||
coredev.upload.speed=115200
|
||||
@ -1391,18 +1391,17 @@ coredev.build.debug_level=
|
||||
coredev.build.lwip_lib=-llwip
|
||||
coredev.build.lwip_flags=
|
||||
|
||||
|
||||
coredev.menu.LwIPVariant.Espressif=Espressif (xcc)
|
||||
coredev.menu.LwIPVariant.Espressif.build.lwip_lib=-llwip
|
||||
coredev.menu.LwIPVariant.Espressif.build.lwip_flags=
|
||||
coredev.menu.LwIPVariant.Espressif.build.variant=generic
|
||||
coredev.menu.LwIPVariant.Prebuilt=Prebuilt Source (gcc)
|
||||
coredev.menu.LwIPVariant.Prebuilt.build.lwip_lib=-llwip_gcc
|
||||
coredev.menu.LwIPVariant.Prebuilt.build.lwip_flags=-DLWIP_OPEN_SRC
|
||||
coredev.menu.LwIPVariant.Prebuilt.build.variant=generic
|
||||
coredev.menu.LwIPVariant.OpenSource=Open Source (gcc)
|
||||
coredev.menu.LwIPVariant.OpenSource.build.lwip_lib=
|
||||
coredev.menu.LwIPVariant.OpenSource.build.lwip_lib=-llwip_src
|
||||
coredev.menu.LwIPVariant.OpenSource.build.lwip_flags=-DLWIP_OPEN_SRC
|
||||
coredev.menu.LwIPVariant.OpenSource.build.variant=lwip
|
||||
coredev.menu.LwIPVariant.OpenSource.recipe.hooks.sketch.prebuild.1.pattern=make -C "{runtime.platform.path}/tools/sdk/lwip/src" install TOOLS_PATH="{runtime.tools.xtensa-lx106-elf-gcc.path}/bin/xtensa-lx106-elf-"
|
||||
|
||||
coredev.menu.CpuFrequency.80=80 MHz
|
||||
coredev.menu.CpuFrequency.80.build.f_cpu=80000000L
|
||||
|
@ -19,7 +19,7 @@ compiler.warning_flags.all=-Wall -Wextra
|
||||
|
||||
compiler.path={runtime.tools.xtensa-lx106-elf-gcc.path}/bin/
|
||||
compiler.sdk.path={runtime.platform.path}/tools/sdk
|
||||
compiler.cpreprocessor.flags=-D__ets__ -DICACHE_FLASH -U__STRICT_ANSI__ "-I{compiler.sdk.path}/include" "-I{compiler.sdk.path}/lwip"
|
||||
compiler.cpreprocessor.flags=-D__ets__ -DICACHE_FLASH -U__STRICT_ANSI__ "-I{compiler.sdk.path}/include" "-I{compiler.sdk.path}/lwip/include"
|
||||
|
||||
compiler.c.cmd=xtensa-lx106-elf-gcc
|
||||
compiler.c.flags=-c {compiler.warning_flags} -Os -g -Wpointer-arith -Wno-implicit-function-declaration -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -falign-functions=4 -MMD -std=gnu99 -ffunction-sections -fdata-sections
|
||||
|
@ -1,36 +1,32 @@
|
||||
TOOLS_PATH = $(abspath ../../../tools)
|
||||
BUILD_PATH = $(abspath build)
|
||||
LWIP_INCLUDE = -Ibuild -I$(TOOLS_PATH)/sdk/include -I$(TOOLS_PATH)/sdk/lwip
|
||||
LWIP_SRCS = $(patsubst %.c,$(BUILD_PATH)/%.o,$(wildcard */*.c)) $(patsubst %.c,$(BUILD_PATH)/%.o,$(wildcard */*/*.c))
|
||||
LWIP_LIB = $(abspath liblwip_gcc.a)
|
||||
TOOLS_PATH ?= ../../../xtensa-lx106-elf/bin/xtensa-lx106-elf-
|
||||
LWIP_LIB ?= liblwip_src.a
|
||||
SDK_PATH ?= $(abspath ../../)
|
||||
|
||||
BUILD_PATH = build
|
||||
LWIP_SRCS = $(patsubst %.c,$(BUILD_PATH)/%.o,$(wildcard */*.c)) $(patsubst %.c,$(BUILD_PATH)/%.o,$(wildcard */*/*.c))
|
||||
|
||||
LWIP_INCLUDE = -Ibuild -I$(SDK_PATH)/include -I$(SDK_PATH)/lwip/include
|
||||
BUILD_FLAGS = -c -Os -g -Wpointer-arith -Wno-implicit-function-declaration -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -falign-functions=4 -MMD -std=gnu99 -ffunction-sections -fdata-sections
|
||||
BUILD_DEFINES = -D__ets__ -DICACHE_FLASH -U__STRICT_ANSI__ -DLWIP_OPEN_SRC
|
||||
|
||||
CC=$(TOOLS_PATH)/xtensa-lx106-elf/bin/xtensa-lx106-elf-gcc
|
||||
AR=$(TOOLS_PATH)/xtensa-lx106-elf/bin/xtensa-lx106-elf-ar
|
||||
CC=$(TOOLS_PATH)gcc
|
||||
AR=$(TOOLS_PATH)ar
|
||||
|
||||
$(BUILD_PATH)/%.h:
|
||||
@echo "[CR]" $(notdir $@)
|
||||
@mkdir -p $(dir $@)
|
||||
@touch $@
|
||||
|
||||
$(BUILD_PATH)/%.o: %.c
|
||||
@echo "[CC]" $(notdir $@)
|
||||
@mkdir -p $(dir $@)
|
||||
@$(CC) $(BUILD_FLAGS) $(BUILD_DEFINES) $(LWIP_INCLUDE) $< -o $@
|
||||
$(CC) $(BUILD_FLAGS) $(BUILD_DEFINES) $(LWIP_INCLUDE) $< -o $@
|
||||
|
||||
$(LWIP_LIB): $(BUILD_PATH)/user_config.h $(LWIP_SRCS)
|
||||
@echo "[AR]" $(notdir $(LWIP_LIB))
|
||||
@$(AR) cru $(LWIP_LIB) $(LWIP_SRCS)
|
||||
$(AR) cru $(LWIP_LIB) $(LWIP_SRCS)
|
||||
|
||||
all: $(LWIP_LIB)
|
||||
|
||||
install: all
|
||||
@echo Installing $(notdir $(LWIP_LIB)) to $(TOOLS_PATH)/sdk/lib
|
||||
@cp -f $(LWIP_LIB) $(TOOLS_PATH)/sdk/lib/$(notdir $(LWIP_LIB))
|
||||
|
||||
deploy: install clean
|
||||
cp -f $(LWIP_LIB) $(SDK_PATH)/lib/$(LWIP_LIB)
|
||||
|
||||
clean:
|
||||
@rm -rf $(BUILD_PATH) $(LWIP_LIB)
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user