From: AceVest Date: Sat, 7 Jul 2018 07:15:48 +0000 (+0800) Subject: ... X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/zpipe.c?a=commitdiff_plain;h=acb19f971111c3253e21512fae6a07b0e8123827;p=acecode.git ... --- diff --git a/.gitignore b/.gitignore index 9d63951..157739f 100644 --- a/.gitignore +++ b/.gitignore @@ -8,4 +8,5 @@ ish *.ef *.conf *.diff +*.d dvwa diff --git a/rtos/build/debug/component_project_vars.mk b/rtos/build/debug/component_project_vars.mk deleted file mode 100644 index 8946b06..0000000 --- a/rtos/build/debug/component_project_vars.mk +++ /dev/null @@ -1,7 +0,0 @@ -# Automatically generated build file. Do not edit. -COMPONENT_INCLUDES += $(PROJECT_PATH)/components/debug/include -COMPONENT_LDFLAGS += -L$(BUILD_DIR_BASE)/debug -ldebug -COMPONENT_LINKER_DEPS += -COMPONENT_SUBMODULES += -COMPONENT_LIBRARIES += debug -component-debug-build: diff --git a/rtos/build/kernel/component_project_vars.mk b/rtos/build/kernel/component_project_vars.mk deleted file mode 100644 index 2bea1a3..0000000 --- a/rtos/build/kernel/component_project_vars.mk +++ /dev/null @@ -1 +0,0 @@ -# COMPONENT_CONFIG_ONLY target sets no variables here diff --git a/rtos/build/main.elf b/rtos/build/main.elf deleted file mode 100755 index 75991a3..0000000 Binary files a/rtos/build/main.elf and /dev/null differ diff --git a/rtos/build/main.map b/rtos/build/main.map deleted file mode 100644 index eb44a53..0000000 --- a/rtos/build/main.map +++ /dev/null @@ -1,295 +0,0 @@ -Archive member included to satisfy reference by file (symbol) - -/Users/ace/workspace/acecode/rtos/build/debug/libdebug.a(entry.o) - (_start) - -Discarded input sections - - .data 0x0000000000000000 0x0 /Users/ace/workspace/acecode/rtos/build/debug/libdebug.a(entry.o) - .bss 0x0000000000000000 0x0 /Users/ace/workspace/acecode/rtos/build/debug/libdebug.a(entry.o) - -Memory Configuration - -Name Origin Length Attributes -*default* 0x0000000000000000 0xffffffffffffffff - -Linker script and memory map - -START GROUP -LOAD /Users/ace/workspace/acecode/rtos/build/debug/libdebug.a -LOAD /Users/ace/workspace/acecode/rtos/build/test/libtest.a -LOAD /Users/ace/workspace/esp/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/5.2.0/libgcc.a -LOAD /Users/ace/workspace/esp/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/5.2.0/../../../../xtensa-esp32-elf/lib/libstdc++.a -LOAD /Users/ace/workspace/esp/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/5.2.0/libgcov.a -END GROUP - [!provide] PROVIDE (__executable_start, 0x400000) - 0x0000000000400054 . = (0x400000 + SIZEOF_HEADERS) - -.interp - *(.interp) - -.note.gnu.build-id - *(.note.gnu.build-id) - -.hash - *(.hash) - -.gnu.hash - *(.gnu.hash) - -.dynsym - *(.dynsym) - -.dynstr - *(.dynstr) - -.gnu.version - *(.gnu.version) - -.gnu.version_d - *(.gnu.version_d) - -.gnu.version_r - *(.gnu.version_r) - -.rela.dyn - *(.rela.init) - *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) - *(.rela.fini) - *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) - *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) - *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) - *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) - *(.rela.ctors) - *(.rela.dtors) - *(.rela.got) - *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) - -.rela.plt - *(.rela.plt) - -.text 0x0000000000400054 0x0 - *(.got.plt* .plt*) - *(.init.literal) - *(SORT(.init)) - *(.literal .text .stub .literal.* .text.* .gnu.linkonce.literal.* .gnu.linkonce.t.*.literal .gnu.linkonce.t.*) - .text 0x0000000000400054 0x0 /Users/ace/workspace/acecode/rtos/build/debug/libdebug.a(entry.o) - 0x0000000000400054 _start - *(.gnu.warning) - *(.fini.literal) - *(SORT(.fini)) - [!provide] PROVIDE (__etext, .) - [!provide] PROVIDE (_etext, .) - [!provide] PROVIDE (etext, .) - -.rodata - *(.rodata .rodata.* .gnu.linkonce.r.*) - -.rodata1 - *(.rodata1) - -.got.loc - *(.got.loc) - -.xt_except_table - *(.xt_except_table .xt_except_table.* .gnu.linkonce.e.*) - -.eh_frame_hdr - *(.eh_frame_hdr) - -.eh_frame - *(.eh_frame) - -.gcc_except_table - *(.gcc_except_table .gcc_except_table.*) - 0x0000000000400054 . = (ALIGN (0x1) + (. & 0x0)) - -.eh_frame - *(.eh_frame) - -.gcc_except_table - *(.gcc_except_table .gcc_except_table.*) - -.tdata - *(.tdata .tdata.* .gnu.linkonce.td.*) - -.tbss - *(.tbss .tbss.* .gnu.linkonce.tb.*) - *(.tcommon) - -.preinit_array 0x0000000000400054 0x0 - [!provide] PROVIDE (__preinit_array_start, .) - *(.preinit_array) - [!provide] PROVIDE (__preinit_array_end, .) - -.init_array 0x0000000000400054 0x0 - [!provide] PROVIDE (__init_array_start, .) - *(SORT(.init_array.*)) - *(.init_array) - [!provide] PROVIDE (__init_array_end, .) - -.fini_array 0x0000000000400054 0x0 - [!provide] PROVIDE (__fini_array_start, .) - *(SORT(.fini_array.*)) - *(.fini_array) - [!provide] PROVIDE (__fini_array_end, .) - -.ctors - *crtbegin.o(.ctors) - *crtbegin?.o(.ctors) - *(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors) - *(SORT(.ctors.*)) - *(.ctors) - -.dtors - *crtbegin.o(.dtors) - *crtbegin?.o(.dtors) - *(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors) - *(SORT(.dtors.*)) - *(.dtors) - -.jcr - *(.jcr) - -.data.rel.ro - *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) - *(.data.rel.ro .data.rel.ro.* .gnu.linkonce.d.rel.ro.*) - -.xt_except_table - *(.xt_except_table .xt_except_table.* .gnu.linkonce.e.*) - -.dynamic - *(.dynamic) - -.got - *(.got) - -.data - *(.data .data.* .gnu.linkonce.d.*) - -.data1 - *(.data1) - -.xt_except_desc - *(.xt_except_desc .xt_except_desc.* .gnu.linkonce.h.*) - *(.xt_except_desc_end) - -.lit4 0x0000000000400054 0x0 - [!provide] PROVIDE (_lit4_start, .) - *(.lit4 .lit4.* .gnu.linkonce.lit4.*) - [!provide] PROVIDE (_lit4_end, .) - 0x0000000000400054 _edata = . - [!provide] PROVIDE (edata, .) - 0x0000000000400054 __bss_start = . - -.bss 0x0000000000400054 0x0 - *(.dynbss) - *(.bss .bss.* .gnu.linkonce.b.*) - *(COMMON) - 0x0000000000400054 . = ALIGN ((. != 0x0)?0x4:0x1) - 0x0000000000400054 . = ALIGN (0x4) - 0x0000000000400054 . = ALIGN (0x4) - 0x0000000000400054 _end = . - [!provide] PROVIDE (end, .) - -.stab - *(.stab) - -.stabstr - *(.stabstr) - -.stab.excl - *(.stab.excl) - -.stab.exclstr - *(.stab.exclstr) - -.stab.index - *(.stab.index) - -.stab.indexstr - *(.stab.indexstr) - -.comment - *(.comment) - -.xtensa.info 0x0000000000000000 0x38 - .xtensa.info 0x0000000000000000 0x38 /Users/ace/workspace/acecode/rtos/build/debug/libdebug.a(entry.o) - -.debug - *(.debug) - -.line - *(.line) - -.debug_srcinfo - *(.debug_srcinfo) - -.debug_sfnames - *(.debug_sfnames) - -.debug_aranges - *(.debug_aranges) - -.debug_pubnames - *(.debug_pubnames) - -.debug_info - *(.debug_info .gnu.linkonce.wi.*) - -.debug_abbrev - *(.debug_abbrev) - -.debug_line - *(.debug_line .debug_line.* .debug_line_end) - -.debug_frame - *(.debug_frame) - -.debug_str - *(.debug_str) - -.debug_loc - *(.debug_loc) - -.debug_macinfo - *(.debug_macinfo) - -.debug_weaknames - *(.debug_weaknames) - -.debug_funcnames - *(.debug_funcnames) - -.debug_typenames - *(.debug_typenames) - -.debug_varnames - *(.debug_varnames) - -.debug_pubtypes - *(.debug_pubtypes) - -.debug_ranges - *(.debug_ranges) - -.debug_macro - *(.debug_macro) - -.gnu.attributes - *(.gnu.attributes) - -.xt.lit - *(.xt.lit .xt.lit.* .gnu.linkonce.p.*) - -.xt.insn - *(.xt.insn .gnu.linkonce.x.*) - -.xt.prop - *(.xt.prop .xt.prop.* .gnu.linkonce.prop.*) - -/DISCARD/ - *(.note.GNU-stack) - *(.gnu_debuglink) - *(.gnu.lto_*) -OUTPUT(/Users/ace/workspace/acecode/rtos/build/main.elf elf32-xtensa-le) diff --git a/rtos/build/test/component_project_vars.mk b/rtos/build/test/component_project_vars.mk deleted file mode 100644 index b426e30..0000000 --- a/rtos/build/test/component_project_vars.mk +++ /dev/null @@ -1,7 +0,0 @@ -# Automatically generated build file. Do not edit. -COMPONENT_INCLUDES += $(PROJECT_PATH)/components/test/include -COMPONENT_LDFLAGS += -L$(BUILD_DIR_BASE)/test -ltest -COMPONENT_LINKER_DEPS += -COMPONENT_SUBMODULES += -COMPONENT_LIBRARIES += test -component-test-build: diff --git a/rtos/make/bak.project.mk b/rtos/make/bak.project.mk deleted file mode 100644 index a7b02b7..0000000 --- a/rtos/make/bak.project.mk +++ /dev/null @@ -1,156 +0,0 @@ -HOSTCC := gcc -HOSTCXX := g++ -HOSTLD := ld -HOSTAR := ar -HOSTOBJCOPY := objcopy -HOSTSIZE := size - -CONFIG_TOOLPREFIX := "xtensa-esp32-elf-" -CC := $(call dequote,$(CONFIG_TOOLPREFIX))gcc -CXX := $(call dequote,$(CONFIG_TOOLPREFIX))c++ -LD := $(call dequote,$(CONFIG_TOOLPREFIX))ld -AR := $(call dequote,$(CONFIG_TOOLPREFIX))ar -OBJCOPY := $(call dequote,$(CONFIG_TOOLPREFIX))objcopy -SIZE := $(call dequote,$(CONFIG_TOOLPREFIX))size -export CC CXX LD AR OBJCOPY SIZE - -.PHONY: all_binaries -all: all_binaries - - # ?= 的意思是如果没有赋值过则赋值?=后面的值 -OS ?= - - # ifeq 的意思是判断是否相等 -ifeq ("$(OS)", "Windows_NT") -$(error "Unsupport build platform") -else - # wildcard 展开通配符 - # realpath 对于名称中的每个文件名返回规范绝对名称。规范名称不包含任何.或..成分,也没有任何重复的路径分隔符(/)或符号链接 -export RTOS_PATH := $(realpath $(wildcard $(RTOS_PATH))) -endif - -ifndef RTOS_PATH -$(error "RTOS_PATH not define") -endif - -ifndef PROJECT_PATH - # MAKEFILE_LIST 列出make用到的所有文件 - # firstword 取第一个单词 - # dir 求路径 - # abspath 求绝对路径 - # export定义一个变量、下级makefile可以访问, export VAR := 'var' <==> VAR := 'var' 和 export VAR 两条命令 -PROJECT_PATH := $(abspath $(dir $(firstword $(MAKEFILE_LIST)))) -export PROJECT_PATH -else -$(error "PROJECT_PATH was polluted") -endif - -ifndef BUILD_DIR_BASE -export BUILD_DIR_BASE := $(PROJECT_PATH)/build -endif - -ifndef COMPONENT_DIRS -export COMPONENT_DIRS := $(RTOS_PATH)/components $(PROJECT_PATH)/components $(PROJECT_PATH)/main -endif - -#ifndef COMPONENTS -COMPONENTS := $(dir $(foreach cd,$(COMPONENT_DIRS), \ - $(wildcard $(cd)/*/component.mk) $(wildcard $(cd)/component.mk))) - -COMPONENTS := $(sort $(foreach comp,$(COMPONENTS),$(lastword $(subst /, ,$(comp))))) -export COMPONENTS -#endif - -COMPONENT_PATHS := $(foreach comp,$(COMPONENTS),$(firstword $(foreach cd,$(COMPONENT_DIRS),$(wildcard $(dir $(cd))$(comp) $(cd)/$(comp))))) -COMPONENT_KCONFIGS := $(foreach component,$(COMPONENT_PATHS),$(wildcard $(component)/Kconfig)) - # COMPONENT_KCONFIGS_PROJBUILD 会在$(RTOS_PATH)/Kconfig里用到 -COMPONENT_KCONFIGS_PROJBUILD := $(foreach component,$(COMPONENT_PATHS),$(wildcard $(component)/Kconfig.projbuild)) - -SDKCONFIG ?= $(PROJECT_PATH)/sdkconfig -KCONFIG_TOOL_DIR=$(RTOS_PATH)/tools/kconfig - -COMMON_MAKEFILES := $(abspath $(RTOS_PATH)/make/project.mk $(firstword $(MAKEFILE_LIST))) -export COMMON_MAKEFILES - -COMPONENT_INCLUDES := -COMPONENT_LDFLAGS := -COMPONENT_SUBMODULES := -COMPONENT_LIBRARIES := -COMPONENT_PROJECT_VARS := $(addsuffix /component_project_vars.mk,$(notdir $(COMPONENT_PATHS) )) -COMPONENT_PROJECT_VARS := $(addprefix $(BUILD_DIR_BASE)/,$(COMPONENT_PROJECT_VARS)) -# this line is -include instead of include to prevent a spurious error message on make 3.81 --include $(COMPONENT_PROJECT_VARS) - - -# Workaround to run make parallel (-j). mconf and conf cannot be made simultaneously -$(KCONFIG_TOOL_DIR)/mconf: $(KCONFIG_TOOL_DIR)/conf - -# reset MAKEFLAGS as the menuconfig makefile uses implicit compile rules -$(KCONFIG_TOOL_DIR)/mconf $(KCONFIG_TOOL_DIR)/conf: $(wildcard $(KCONFIG_TOOL_DIR)/*.c) - MAKEFLAGS="" CC=$(HOSTCC) LD=$(HOSTLD) \ - $(MAKE) -C $(KCONFIG_TOOL_DIR) - - -APP_ELF:=$(BUILD_DIR_BASE)/$(PROJECT_NAME).elf -APP_MAP:=$(APP_ELF:.elf=.map) -APP_BIN:=$(APP_ELF:.elf=.bin) - -all_binaries: $(APP_BIN) $(COMPONENT_PROJECT_VARS) - - - -$(APP_BIN): $(APP_ELF) - cp $(APP_ELF) $(APP_BIN) - - -$(APP_ELF): - - -define RunConf - mkdir -p $(BUILD_DIR_BASE)/include/config - cd $(BUILD_DIR_BASE); KCONFIG_AUTOHEADER=$(abspath $(BUILD_DIR_BASE)/include/sdkconfig.h) \ - COMPONENT_KCONFIGS="$(COMPONENT_KCONFIGS)" KCONFIG_CONFIG=$(SDKCONFIG) \ - COMPONENT_KCONFIGS_PROJBUILD="$(COMPONENT_KCONFIGS_PROJBUILD)" \ - $(KCONFIG_TOOL_DIR)/$(1) $(RTOS_PATH)/Kconfig -endef - -.PHONY: menuconfig -menuconfig: $(KCONFIG_TOOL_DIR)/mconf $(KCONFIG_TOOL_DIR)/conf - $(call RunConf,mconf) - $(call RunConf,conf --silentoldconfig) - - - -# Macro for the recursive sub-make for each component -# $(1) - component directory -# $(2) - component name only -# -# Is recursively expanded by the GenerateComponentTargets macro -define ComponentMake -+$(MAKE) -C $(BUILD_DIR_BASE)/$(2) -f $(RTOS_PATH)/make/component_wrapper.mk COMPONENT_MAKEFILE=$(1)/component.mk COMPONENT_NAME=$(2) -endef - -# Generate top-level component-specific targets for each component -# $(1) - path to component dir -# $(2) - name of component -# -define GenerateComponentTargets -.PHONY: component-$(2)-build component-$(2)-clean - -component-$(2)-build: check-submodules $(call prereq_if_explicit, component-$(2)-clean) | $(BUILD_DIR_BASE)/$(2) - $(call ComponentMake,$(1),$(2)) build - -component-$(2)-clean: | $(BUILD_DIR_BASE)/$(2) $(BUILD_DIR_BASE)/$(2)/component_project_vars.mk - $(call ComponentMake,$(1),$(2)) clean - - -$(BUILD_DIR_BASE)/$(2): - @mkdir -p $(BUILD_DIR_BASE)/$(2) - -$(BUILD_DIR_BASE)/$(2)/lib$(2).a: component-$(2)-build - $(details) "Target '$$^' responsible for '$$@'" # echo which build target built this file - -$(BUILD_DIR_BASE)/$(2)/component_project_vars.mk: $(1)/component.mk $(COMMON_MAKEFILES) $(SDKCONFIG_MAKEFILE) | $(BUILD_DIR_BASE)/$(2) - $(call ComponentMake,$(1),$(2)) component_project_vars.mk -endef -$(foreach component,$(COMPONENT_PATHS),$(eval $(call GenerateComponentTargets,$(component),$(notdir $(component))))) diff --git a/rtos/make/project b/rtos/make/project deleted file mode 100644 index a7b02b7..0000000 --- a/rtos/make/project +++ /dev/null @@ -1,156 +0,0 @@ -HOSTCC := gcc -HOSTCXX := g++ -HOSTLD := ld -HOSTAR := ar -HOSTOBJCOPY := objcopy -HOSTSIZE := size - -CONFIG_TOOLPREFIX := "xtensa-esp32-elf-" -CC := $(call dequote,$(CONFIG_TOOLPREFIX))gcc -CXX := $(call dequote,$(CONFIG_TOOLPREFIX))c++ -LD := $(call dequote,$(CONFIG_TOOLPREFIX))ld -AR := $(call dequote,$(CONFIG_TOOLPREFIX))ar -OBJCOPY := $(call dequote,$(CONFIG_TOOLPREFIX))objcopy -SIZE := $(call dequote,$(CONFIG_TOOLPREFIX))size -export CC CXX LD AR OBJCOPY SIZE - -.PHONY: all_binaries -all: all_binaries - - # ?= 的意思是如果没有赋值过则赋值?=后面的值 -OS ?= - - # ifeq 的意思是判断是否相等 -ifeq ("$(OS)", "Windows_NT") -$(error "Unsupport build platform") -else - # wildcard 展开通配符 - # realpath 对于名称中的每个文件名返回规范绝对名称。规范名称不包含任何.或..成分,也没有任何重复的路径分隔符(/)或符号链接 -export RTOS_PATH := $(realpath $(wildcard $(RTOS_PATH))) -endif - -ifndef RTOS_PATH -$(error "RTOS_PATH not define") -endif - -ifndef PROJECT_PATH - # MAKEFILE_LIST 列出make用到的所有文件 - # firstword 取第一个单词 - # dir 求路径 - # abspath 求绝对路径 - # export定义一个变量、下级makefile可以访问, export VAR := 'var' <==> VAR := 'var' 和 export VAR 两条命令 -PROJECT_PATH := $(abspath $(dir $(firstword $(MAKEFILE_LIST)))) -export PROJECT_PATH -else -$(error "PROJECT_PATH was polluted") -endif - -ifndef BUILD_DIR_BASE -export BUILD_DIR_BASE := $(PROJECT_PATH)/build -endif - -ifndef COMPONENT_DIRS -export COMPONENT_DIRS := $(RTOS_PATH)/components $(PROJECT_PATH)/components $(PROJECT_PATH)/main -endif - -#ifndef COMPONENTS -COMPONENTS := $(dir $(foreach cd,$(COMPONENT_DIRS), \ - $(wildcard $(cd)/*/component.mk) $(wildcard $(cd)/component.mk))) - -COMPONENTS := $(sort $(foreach comp,$(COMPONENTS),$(lastword $(subst /, ,$(comp))))) -export COMPONENTS -#endif - -COMPONENT_PATHS := $(foreach comp,$(COMPONENTS),$(firstword $(foreach cd,$(COMPONENT_DIRS),$(wildcard $(dir $(cd))$(comp) $(cd)/$(comp))))) -COMPONENT_KCONFIGS := $(foreach component,$(COMPONENT_PATHS),$(wildcard $(component)/Kconfig)) - # COMPONENT_KCONFIGS_PROJBUILD 会在$(RTOS_PATH)/Kconfig里用到 -COMPONENT_KCONFIGS_PROJBUILD := $(foreach component,$(COMPONENT_PATHS),$(wildcard $(component)/Kconfig.projbuild)) - -SDKCONFIG ?= $(PROJECT_PATH)/sdkconfig -KCONFIG_TOOL_DIR=$(RTOS_PATH)/tools/kconfig - -COMMON_MAKEFILES := $(abspath $(RTOS_PATH)/make/project.mk $(firstword $(MAKEFILE_LIST))) -export COMMON_MAKEFILES - -COMPONENT_INCLUDES := -COMPONENT_LDFLAGS := -COMPONENT_SUBMODULES := -COMPONENT_LIBRARIES := -COMPONENT_PROJECT_VARS := $(addsuffix /component_project_vars.mk,$(notdir $(COMPONENT_PATHS) )) -COMPONENT_PROJECT_VARS := $(addprefix $(BUILD_DIR_BASE)/,$(COMPONENT_PROJECT_VARS)) -# this line is -include instead of include to prevent a spurious error message on make 3.81 --include $(COMPONENT_PROJECT_VARS) - - -# Workaround to run make parallel (-j). mconf and conf cannot be made simultaneously -$(KCONFIG_TOOL_DIR)/mconf: $(KCONFIG_TOOL_DIR)/conf - -# reset MAKEFLAGS as the menuconfig makefile uses implicit compile rules -$(KCONFIG_TOOL_DIR)/mconf $(KCONFIG_TOOL_DIR)/conf: $(wildcard $(KCONFIG_TOOL_DIR)/*.c) - MAKEFLAGS="" CC=$(HOSTCC) LD=$(HOSTLD) \ - $(MAKE) -C $(KCONFIG_TOOL_DIR) - - -APP_ELF:=$(BUILD_DIR_BASE)/$(PROJECT_NAME).elf -APP_MAP:=$(APP_ELF:.elf=.map) -APP_BIN:=$(APP_ELF:.elf=.bin) - -all_binaries: $(APP_BIN) $(COMPONENT_PROJECT_VARS) - - - -$(APP_BIN): $(APP_ELF) - cp $(APP_ELF) $(APP_BIN) - - -$(APP_ELF): - - -define RunConf - mkdir -p $(BUILD_DIR_BASE)/include/config - cd $(BUILD_DIR_BASE); KCONFIG_AUTOHEADER=$(abspath $(BUILD_DIR_BASE)/include/sdkconfig.h) \ - COMPONENT_KCONFIGS="$(COMPONENT_KCONFIGS)" KCONFIG_CONFIG=$(SDKCONFIG) \ - COMPONENT_KCONFIGS_PROJBUILD="$(COMPONENT_KCONFIGS_PROJBUILD)" \ - $(KCONFIG_TOOL_DIR)/$(1) $(RTOS_PATH)/Kconfig -endef - -.PHONY: menuconfig -menuconfig: $(KCONFIG_TOOL_DIR)/mconf $(KCONFIG_TOOL_DIR)/conf - $(call RunConf,mconf) - $(call RunConf,conf --silentoldconfig) - - - -# Macro for the recursive sub-make for each component -# $(1) - component directory -# $(2) - component name only -# -# Is recursively expanded by the GenerateComponentTargets macro -define ComponentMake -+$(MAKE) -C $(BUILD_DIR_BASE)/$(2) -f $(RTOS_PATH)/make/component_wrapper.mk COMPONENT_MAKEFILE=$(1)/component.mk COMPONENT_NAME=$(2) -endef - -# Generate top-level component-specific targets for each component -# $(1) - path to component dir -# $(2) - name of component -# -define GenerateComponentTargets -.PHONY: component-$(2)-build component-$(2)-clean - -component-$(2)-build: check-submodules $(call prereq_if_explicit, component-$(2)-clean) | $(BUILD_DIR_BASE)/$(2) - $(call ComponentMake,$(1),$(2)) build - -component-$(2)-clean: | $(BUILD_DIR_BASE)/$(2) $(BUILD_DIR_BASE)/$(2)/component_project_vars.mk - $(call ComponentMake,$(1),$(2)) clean - - -$(BUILD_DIR_BASE)/$(2): - @mkdir -p $(BUILD_DIR_BASE)/$(2) - -$(BUILD_DIR_BASE)/$(2)/lib$(2).a: component-$(2)-build - $(details) "Target '$$^' responsible for '$$@'" # echo which build target built this file - -$(BUILD_DIR_BASE)/$(2)/component_project_vars.mk: $(1)/component.mk $(COMMON_MAKEFILES) $(SDKCONFIG_MAKEFILE) | $(BUILD_DIR_BASE)/$(2) - $(call ComponentMake,$(1),$(2)) component_project_vars.mk -endef -$(foreach component,$(COMPONENT_PATHS),$(eval $(call GenerateComponentTargets,$(component),$(notdir $(component))))) diff --git a/rtos/make/project_config.mk b/rtos/make/project_config.mk deleted file mode 100644 index e05ab94..0000000 --- a/rtos/make/project_config.mk +++ /dev/null @@ -1,102 +0,0 @@ -# Makefile support for the menuconfig system - -#Find all Kconfig files for all components -COMPONENT_KCONFIGS := $(foreach component,$(COMPONENT_PATHS),$(wildcard $(component)/Kconfig)) -COMPONENT_KCONFIGS_PROJBUILD := $(foreach component,$(COMPONENT_PATHS),$(wildcard $(component)/Kconfig.projbuild)) - -#For doing make menuconfig etc -KCONFIG_TOOL_DIR=$(RTOS_PATH)/tools/kconfig - -# set SDKCONFIG to the project's sdkconfig, -# unless it's overriden (happens for bootloader) -SDKCONFIG ?= $(PROJECT_PATH)/sdkconfig - -# SDKCONFIG_DEFAULTS is an optional file containing default -# overrides (usually used for esp-idf examples) -SDKCONFIG_DEFAULTS ?= $(PROJECT_PATH)/sdkconfig.defaults - -# Workaround to run make parallel (-j). mconf and conf cannot be made simultaneously -$(KCONFIG_TOOL_DIR)/mconf: $(KCONFIG_TOOL_DIR)/conf - -# reset MAKEFLAGS as the menuconfig makefile uses implicit compile rules -$(KCONFIG_TOOL_DIR)/mconf $(KCONFIG_TOOL_DIR)/conf: $(wildcard $(KCONFIG_TOOL_DIR)/*.c) - MAKEFLAGS="" CC=$(HOSTCC) LD=$(HOSTLD) \ - $(MAKE) -C $(KCONFIG_TOOL_DIR) - -ifeq ("$(wildcard $(SDKCONFIG))","") -# if no configuration file is present we need a rule for it -ifeq ("$(filter $(NON_INTERACTIVE_TARGET), $(MAKECMDGOALS))","") -# if special non-interactive item is not a named target (eg. 'defconfig', 'clean') -# run defconfig then menuconfig to get the initial config -$(SDKCONFIG): menuconfig -menuconfig: defconfig -else -# otherwise, just run defconfig -$(SDKCONFIG): defconfig -endif -endif - -# macro for the commands to run kconfig tools conf or mconf. -# $1 is the name (& args) of the conf tool to run -define RunConf - mkdir -p $(BUILD_DIR_BASE)/include/config - cd $(BUILD_DIR_BASE); KCONFIG_AUTOHEADER=$(abspath $(BUILD_DIR_BASE)/include/sdkconfig.h) \ - COMPONENT_KCONFIGS="$(COMPONENT_KCONFIGS)" KCONFIG_CONFIG=$(SDKCONFIG) \ - COMPONENT_KCONFIGS_PROJBUILD="$(COMPONENT_KCONFIGS_PROJBUILD)" \ - $(KCONFIG_TOOL_DIR)/$1 $(RTOS_PATH)/Kconfig -endef - -ifndef MAKE_RESTARTS -# menuconfig, defconfig and "GENCONFIG" configuration generation only -# ever run on the first make pass, subsequent passes don't run these -# (make often wants to re-run them as the conf tool can regenerate the -# sdkconfig input file as an output file, but this is not what the -# user wants - a single config pass is enough to produce all output -# files.) -# -# To prevent problems missing genconfig, ensure none of these targets -# depend on any prerequisite that may cause a make restart as part of -# the prerequisite's own recipe. - -menuconfig: $(KCONFIG_TOOL_DIR)/mconf - $(summary) MENUCONFIG -ifdef BATCH_BUILD - @echo "Can't run interactive configuration inside non-interactive build process." - @echo "" - @echo "Open a command line terminal and run 'make menuconfig' from there." - @echo "See esp-idf documentation for more details." - @exit 1 -else - $(call RunConf,mconf) -endif - -# defconfig creates a default config, based on SDKCONFIG_DEFAULTS if present -defconfig: $(KCONFIG_TOOL_DIR)/conf - $(summary) DEFCONFIG - @echo "fuck" -ifneq ("$(wildcard $(SDKCONFIG_DEFAULTS))","") - cat $(SDKCONFIG_DEFAULTS) >> $(SDKCONFIG) # append defaults to sdkconfig, will override existing values -endif - $(call RunConf,conf --olddefconfig) - -# if neither defconfig or menuconfig are requested, use the GENCONFIG rule to -# ensure generated config files are up to date -$(SDKCONFIG_MAKEFILE) $(BUILD_DIR_BASE)/include/sdkconfig.h: $(KCONFIG_TOOL_DIR)/conf $(SDKCONFIG) $(COMPONENT_KCONFIGS) $(COMPONENT_KCONFIGS_PROJBUILD) | $(call prereq_if_explicit,defconfig) $(call prereq_if_explicit,menuconfig) - $(summary) GENCONFIG -ifdef BATCH_BUILD # can't prompt for new config values like on terminal - $(call RunConf,conf --olddefconfig) -endif - $(call RunConf,conf --silentoldconfig) - touch $(SDKCONFIG_MAKEFILE) $(BUILD_DIR_BASE)/include/sdkconfig.h # ensure newer than sdkconfig - -else # "$(MAKE_RESTARTS)" != "" -# on subsequent make passes, skip config generation entirely -defconfig: -menuconfig: -endif - -.PHONY: config-clean defconfig menuconfig -config-clean: - $(summary) RM CONFIG - MAKEFLAGS="" $(MAKE) -C $(KCONFIG_TOOL_DIR) clean - rm -rf $(BUILD_DIR_BASE)/include/config $(BUILD_DIR_BASE)/include/sdkconfig.h diff --git a/rtos/sdkconfig.old b/rtos/sdkconfig.old deleted file mode 100644 index 81e86b9..0000000 --- a/rtos/sdkconfig.old +++ /dev/null @@ -1,14 +0,0 @@ -# -# Automatically generated file; DO NOT EDIT. -# Linux Kernel Configuration -# - -# -# RTOS Configuration -# -CONFIG_BLINK_GPIO=2 - -# -# Kernel config -# -CONFIG_KERNEL_NAME="rtos"