From acb19f971111c3253e21512fae6a07b0e8123827 Mon Sep 17 00:00:00 2001 From: AceVest Date: Sat, 7 Jul 2018 15:15:48 +0800 Subject: [PATCH] ... --- .gitignore | 1 + rtos/build/debug/component_project_vars.mk | 7 - rtos/build/kernel/component_project_vars.mk | 1 - rtos/build/main.elf | Bin 612 -> 0 bytes rtos/build/main.map | 295 -------------------- rtos/build/test/component_project_vars.mk | 7 - rtos/make/bak.project.mk | 156 ----------- rtos/make/project | 156 ----------- rtos/make/project_config.mk | 102 ------- rtos/sdkconfig.old | 14 - 10 files changed, 1 insertion(+), 738 deletions(-) delete mode 100644 rtos/build/debug/component_project_vars.mk delete mode 100644 rtos/build/kernel/component_project_vars.mk delete mode 100755 rtos/build/main.elf delete mode 100644 rtos/build/main.map delete mode 100644 rtos/build/test/component_project_vars.mk delete mode 100644 rtos/make/bak.project.mk delete mode 100644 rtos/make/project delete mode 100644 rtos/make/project_config.mk delete mode 100644 rtos/sdkconfig.old 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 75991a34a3738ddba3c3ce3a88632ca460bbf61e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 612 zcma)3!AiqG5S>J=C?4v?iwO0mmym;k2Zf}NLLeZR6g)X>+ZBZxCA)=s(hu;H{5an< z-MR!1KA6mVGjC^y>_=9Nf*>G=kRC`>MG0LXTM=6XK0y79dJw_ZO=s$hK+olVesdEk(=K zwCGu;{SDb$;BVRL(A#@up(7;c@1uLt(dQi?(!aPM%6;;z>a-<7AG?+`US*yozA^dsQICzPggS+ 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" -- 2.44.0