support aliyun sdk on TencentOS tiny

sample: examples\aliyun_iotkit_csdk_mqtt
project: board\TencentOS_tiny_EVB_MX_Plus\KEIL\aliyun_iotkit_csdk_mqtt
This commit is contained in:
dcxajichu
2019-10-31 16:36:28 +08:00
parent 30ea36a7ab
commit 8c24d921b0
692 changed files with 199829 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
mainmenu "Main Menu"
comment "Configure C-SDK for IoT Embedded Devices"
source "tools/menu/Config.infra"
source "tools/menu/Config.dev_sign"
source "tools/menu/Config.mqtt"
source "tools/menu/Config.dynamic_register"
source "tools/menu/Config.dev_model"
source "tools/menu/Config.wrappers"
source "tools/menu/Config.atm"
source "tools/menu/Config.ota"
source "tools/menu/Config.coap"
source "tools/menu/Config.dev_reset"
source "tools/menu/Config.http"
source "tools/menu/Config.http2"
source "tools/menu/Config.wifi_provision"
source "tools/menu/Config.dev_bind"

View File

@@ -0,0 +1,19 @@
CONFIG_ENV_CFLAGS += \
-DBOARD_ESP8266 -u call_user_start \
-fno-inline-functions \
-ffunction-sections \
-fdata-sections \
-mlongcalls \
-DESPOS_FOR_ESP8266 -Wl,-static \
-DXT_USE_THREAD_SAFE_CLIB=0 \
CONFIG_ENV_CFLAGS += \
-Os \
-DCONFIG_MQTT_TX_MAXLEN=640 \
-DCONFIG_MQTT_RX_MAXLEN=1200 \
CONFIG_external_libs/mbedtls :=
CONFIG_tests :=
CROSS_PREFIX := xtensa-lx106-elf-

View File

@@ -0,0 +1,15 @@
CONFIG_ENV_CFLAGS += \
-mcpu=cortex-m4 -march=armv7-m -mthumb \
-mthumb-interwork -mlittle-endian \
-fno-short-enums \
-DCONFIG_PLATFORM_8711B -DM3 -w \
CONFIG_ENV_CFLAGS += \
-Os \
-DCONFIG_MQTT_TX_MAXLEN=640 \
-DCONFIG_MQTT_RX_MAXLEN=1200 \
CONFIG_external_libs/mbedtls :=
CONFIG_tests :=
CROSS_PREFIX := arm-none-eabi-

View File

@@ -0,0 +1,24 @@
CONFIG_ENV_CFLAGS += \
-Os -Wall \
-g3 --coverage \
-D_PLATFORM_IS_LINUX_ \
-D__UBUNTU_SDK_DEMO__ \
CONFIG_ENV_CFLAGS += \
-DWITH_MQTT_DYN_BUF=1 \
-DWITH_MEM_STATS=0 \
-DWITH_MEM_STATS_PER_MODULE=0 \
-DWITH_MQTT_JSON_FLOW=1 \
-DWITH_MQTT_ZIP_TOPIC=1 \
-DWITH_MQTT_SUB_SHORTCUT=1 \
-DSDK_TEAM_TEST \
CONFIG_ENV_CFLAGS += \
-DCONFIG_MQTT_RX_MAXLEN=5000 \
-DCONFIG_MBEDTLS_DEBUG_LEVEL=0 \
CONFIG_ENV_CFLAGS += -rdynamic
CONFIG_ENV_CFLAGS += -Werror -Wno-unused
CONFIG_ENV_LDFLAGS += -lpthread -lrt

View File

@@ -0,0 +1,55 @@
.PHONY: comp-lib
ifdef COMP_LIB
ifeq (dynamic,$(CONFIG_LIB_EXPORT))
define Finalize_CompLib
( \
$(CC) -shared -Os -o $(2)/lib$(3).so $(1) $(LDFLAGS); \
)
endef
define Info_CompLib
( \
EXIST_OBJS="$$(ls $(2) 2>/dev/null)"; \
\
echo -ne "\033[1;32m"; \
printf "\r%-40s%s\n" "[AR] lib$(1).so" "<= "; \
for i in $${EXIST_OBJS}; do \
printf "%-40s%s\n" "" " $${i}"|$(SED) 's,$(LIBOBJ_TMPDIR)/,,g'; \
done; \
echo -ne "\033[0m"; \
)
endef
else
define Finalize_CompLib
( \
EXIST_OBJS="$$(ls $(1) 2>/dev/null)"; \
\
if [ "$${EXIST_OBJS}" != "" ]; then \
$(AR) -rcs $(2)/lib$(3).a $${EXIST_OBJS}; \
fi \
)
endef
define Info_CompLib
( \
EXIST_OBJS="$$(ls $(2) 2>/dev/null)"; \
\
echo -ne "\033[1;35m"; \
printf "\r%-40s%s\n" "[AR] lib$(1).a" "<= "; \
for i in $${EXIST_OBJS}; do \
printf "%-40s%s\n" "" " $${i}"|$(SED) 's,$(LIBOBJ_TMPDIR)/,,g'; \
done; \
echo -ne "\033[0m"; \
)
endef
endif # dynamic
endif # COMP_LIB
comp-lib: toolchain
ifdef COMP_LIB
$(TOP_Q)+( \
if [ -f $(STAMP_PRJ_CFG) ]; then true; else \
$(call Build_CompLib,FORCE) \
fi)
else
$(Q)true
endif

View File

@@ -0,0 +1,26 @@
.PHONY: coverage lcov test
ifneq (,$(COVERAGE_LIST))
COVERAGE_PROGS := \(
COVERAGE_PROGS += $(COVERAGE_LIST)
COVERAGE_PROGS += \)
COVERAGE_CMD := $(RULE_DIR)/scripts/exe_coverage_progs.sh
endif
ifeq (,$(COVERAGE_CMD))
coverage lcov test:
@echo "COVERAGE_CMD not defined, skip"
else
coverage lcov test:
#
# SKIP --coverage existence in $(CFLAGS) checking for now
#
$(Q)$(MAKE) --no-print-directory WITH_LCOV=1
$(Q)OUTPUT_DIR=$(OUTPUT_DIR) bash <($(SED) '2iPROGS=$(COVERAGE_PROGS)' $(COVERAGE_CMD)) || true
$(Q)CFLAGS=$(CFLAGS) \
$(foreach V,$(INFO_ENV_VARS),$(V)="$($(V))") \
bash $(RULE_DIR)/scripts/gen_lcov_report.sh
endif

View File

@@ -0,0 +1,51 @@
final-out: sub-mods
ifneq (1,$(WITH_LCOV))
ifneq (,$(COMP_LIB_NAME))
$(TOP_Q) \
if [ ! -f $(SYSROOT_LIB)/lib$(COMP_LIB_NAME).a ] && \
[ ! -f $(SYSROOT_LIB)/lib$(COMP_LIB_NAME).so ]; then \
$(call Build_CompLib, FORCE) \
fi;
endif
$(TOP_Q) \
if [ -f $(STAMP_PRJ_CFG) ]; then true; else \
rm -rf $(FINAL_DIR); \
mkdir -p $(DIST_DIR) $(FINAL_DIR); \
for i in bin lib include; do \
if [ -d $(OUTPUT_DIR)/usr/$${i} ]; then \
cp -rf $(OUTPUT_DIR)/usr/$${i} $(FINAL_DIR); \
fi; \
done; \
VDR_NAME=$$(grep -m 1 "VENDOR *:" $(CONFIG_TPL) 2>/dev/null|awk '{ print $$NF }'); \
if [ "$$(ls $(IMPORT_DIR)/$${VDR_NAME}/$(PREBUILT_LIBDIR)/lib* 2>/dev/null)" != "" ]; then \
cp -f $(IMPORT_DIR)/$${VDR_NAME}/$(PREBUILT_LIBDIR)/lib* $(FINAL_DIR)/lib; \
fi; \
fi
$(TOP_Q) \
if [ "$$(ls $(FINAL_DIR)/lib/*.a 2>/dev/null)" != "" ]; then \
$(STRIP) $(STRIP_DBGOPT) $(FINAL_DIR)/lib/*.a 2>/dev/null || (echo "$(STRIP) $(FINAL_DIR)/lib/*.a failed!" || true); \
fi
$(TOP_Q) \
if [ "$$(ls $(FINAL_DIR)/bin/ 2>/dev/null)" != "" ]; then \
$(STRIP) $(FINAL_DIR)/bin/* 2>/dev/null || (echo "$(STRIP) $(FINAL_DIR)/bin/* failed!" || true); \
fi
$(TOP_Q) \
if [ "$$(ls $(FINAL_DIR)/lib/*.so 2>/dev/null)" != "" ]; then \
$(STRIP) $(STRIP_DBGOPT) $(FINAL_DIR)/lib/*.so 2>/dev/null || (echo "$(STRIP) $(FINAL_DIR)/lib/*.so failed!" || true); \
fi
ifeq ($(strip $(HAS_POST_HOOK)), 1)
$(TOP_Q)+$(call $(POST_FINAL_OUT_HOOK))
endif
ifneq (,$(filter all,$(strip $(MAKECMDGOALS))))
$(TOP_Q)+$(call $(POST_FINAL_OUT_HOOK))
endif
$(TOP_Q)$(foreach V,$(INFO_ENV_VARS),$(V)="$($(V))") \
CFLAGS=$(CFLAGS) SED=$(SED) \
bash $(RULE_DIR)/scripts/gen_rom_stats.sh
endif

View File

@@ -0,0 +1,148 @@
ifneq ($(TOP_DIR),$(CURDIR))
INTERNAL_INCLUDES += -I$(SYSROOT_INC)
INTERNAL_INCLUDES += $(foreach d, $(shell find $(SYSROOT_INC) -type d), -I$(d))
INTERNAL_INCLUDES += -I$(TOP_DIR)
INTERNAL_INCLUDES += $(foreach d, $(shell find -L $(TOP_DIR)/$(EXPORT_DIR) -type d -not -path "*/.*" -not -path "$(TOP_DIR)/$(SHADOW_DIR)*"), -I$(d))
INTERNAL_INCLUDES += \
$(foreach d, \
$(shell [ -d $(IMPORT_DIR)/$(CONFIG_VENDOR)/include ] && find -L $(IMPORT_DIR)/$(CONFIG_VENDOR)/include -type d), \
-I$(d) \
)
INTERNAL_INCLUDES += $(foreach mod, $(MODULE_NAME) $(HDR_REFS), \
$(foreach d, \
$(shell [ -d $(TOP_DIR)/$(mod) ] && \
find -L $(TOP_DIR)/$(mod)/ -type d \
-a -name "[^.]*" \
-not -path "*.git*"), \
-I$(d) \
) \
)
# INTERNAL_INCLUDES += \
$(foreach d, \
$(shell find $(OUTPUT_DIR)/$(MODULE_NAME) -type d -a -name "[^.]*"), \
-I$(d) \
)
INTERNAL_INCLUDES := $(strip $(sort $(INTERNAL_INCLUDES)))
EXTERNAL_INCLUDES += $(foreach mod, $(DEPENDS), \
$(foreach d, \
$(shell $(SHELL_DBG) find \
$(SYSROOT_INC)/$(mod)/ -maxdepth 2 -type d 2>/dev/null) \
$(shell $(SHELL_DBG) find \
$(IMPORT_VDRDIR)/include/$(mod)/ -maxdepth 2 -type d 2>/dev/null), \
-I$(d) \
) \
)
EXTERNAL_INCLUDES := $(strip $(EXTERNAL_INCLUDES))
endif # ifneq ($(TOP_DIR),$(CURDIR))
ifeq (dynamic,$(strip $(CONFIG_LIB_EXPORT)))
CFLAGS += -fPIC
endif
#CFLAGS := $(sort $(strip $(CFLAGS)))
LDFLAGS += -L$(SYSROOT_LIB)
ifeq (y,$(shell [ -e $(TOP_DIR)/$(IMPORT_VDRDIR)/$(PREBUILT_LIBDIR) ] && echo y))
LDFLAGS += -L$(TOP_DIR)/$(IMPORT_VDRDIR)/$(PREBUILT_LIBDIR)
endif
LDFLAGS += $(foreach d,$(DEPENDS_$(MODULE_NAME)),$(REF_LDFLAGS_$(d)))
WATCHED_VARS = \
TARGET \
CFLAGS \
CC \
LDFLAGS \
CURDIR \
INTERNAL_INCLUDES \
DEPENDS \
MAKECMDGOALS \
EXTERNAL_INCLUDES \
LIBA_TARGET \
LIBSO_TARGET \
ALL_TARGETS := $(TARGET) $(LIBSO_TARGET) $(LIBA_TARGET) $(firstword $(KMOD_TARGET))
ifneq (,$(strip $(PKG_SWITCH)))
all: $(ALL_TARGETS)
else
all:
$(Q)true
endif
clean:
$(Q)rm -f \
$(strip \
$(ALL_TARGETS) $(OBJS) $(LIB_OBJS) \
$(OBJS:.o=.d) $(LIB_OBJS:.o=.d) \
$(LIB_OBJS:.o=.gcno) $(LIB_OBJS:.o=.gcda) \
) \
*.o.e *.d *.o *.a *.so *.log *.gc*
%.o: %.c $(HD_MAKEFILE)
@$(call Brief_Log,"CC")
$(call Inspect_Env,$(WATCHED_VARS))
$(Q) \
set -o pipefail; \
$(CC) -I$(CURDIR) \
$(INTERNAL_INCLUDES) \
$(EXTERNAL_INCLUDES) \
$(CFLAGS) \
-c -o $@ $<
ifneq (,$(OBJCOPY_FLAGS))
$(Q)$(OBJCOPY) $(OBJCOPY_FLAGS) $@
endif
NODEP_LIST = \
$(SYSROOT_INC)/git_version.h \
$(SYSROOT_INC)/platform.h \
$(SYSROOT_INC)/product.h \
$(SYSROOT_INC)/product_config.h \
ifneq (,$(findstring gcc,$(CC)))
ifeq (,$(filter modinfo,$(MAKECMDGOALS)))
%.d: %.c
@ \
( \
D=$$(dirname $<|$(SED) 's,$(TOP_DIR),$(OUTPUT_DIR),1'); \
F=$$(basename $<); \
mkdir -p $${D}; \
$(CC) -MM -I$(CURDIR) \
$(INTERNAL_INCLUDES) \
$(EXTERNAL_INCLUDES) \
$(CFLAGS) \
$< > $${D}/$${F}.$$$$; \
$(SED) -i 's!$(shell basename $*)\.o[ :]!$*.o:!1' $${D}/$${F}.$$$$; \
mv $${D}/$${F}.$$$$ $@; \
)
endif
endif
%.o: %.cpp
@$(call Brief_Log,"CC")
$(call Inspect_Env,$(WATCHED_VARS))
$(Q)$(CXX) -I$(CURDIR) \
$(INTERNAL_INCLUDES) \
$(EXTERNAL_INCLUDES) \
$(CFLAGS) \
-c -o $@ $<
ifneq (,$(findstring gcc,$(CC)))
%.d: %.cpp
@ \
$(CXX) -MM -I$(CURDIR) \
$(INTERNAL_INCLUDES) \
$(EXTERNAL_INCLUDES) \
$(CFLAGS) \
$< > $@.$$$$; \
$(foreach D,$(NODEP_LIST),$(SED) -i 's,$(D),,g' $@.$$$$;) \
$(SED) 's,\($*\)\.o[ :]*,\1.o $@: ,g' < $@.$$$$ > $@; \
rm -f $@.$$$$;
endif
include $(RULE_DIR)/_rules-libs.mk
include $(RULE_DIR)/_rules-prog.mk
include $(RULE_DIR)/_rules-kmod.mk

View File

@@ -0,0 +1,35 @@
ifdef KMOD_TARGET
KMOD_NAME := $(subst .o,,$(obj-m))
KMOD_OBJS := $(foreach mod, $(KMOD_NAME), $($(mod)-objs))
KMOD_SRCS := $(subst .o,.c,$(KMOD_OBJS))
KMOD_BUILD_DIR := $(CURDIR)/build-$(shell $(SHELL_DBG) basename $(CURDIR))-kmod
KMOD_MAKEFILE := $(KMOD_BUILD_DIR)/Makefile
$(firstword $(KMOD_TARGET)): $(KMOD_SRCS)
$(Q)rm -rf $(KMOD_BUILD_DIR) && mkdir -p $(KMOD_BUILD_DIR)
$(Q)cp -f $(KMOD_SRCS) $(KMOD_BUILD_DIR)
$(Q)echo "EXTRA_CFLAGS += " \
"-I$(CURDIR)" \
"$(INTERNAL_INCLUDES)" \
| $(SED) 's/-I/\\\n -I/g' \
>> $(KMOD_MAKEFILE)
$(Q)echo "" >> $(KMOD_MAKEFILE)
$(Q)echo "obj-m := $(obj-m)" >> $(KMOD_MAKEFILE)
$(Q)echo "" >> $(KMOD_MAKEFILE)
$(Q) \
$(foreach mod, $(KMOD_NAME), \
echo "$(mod)-objs := $($(mod)-objs)" \
| $(SED) 's/ [_a-z]*\.o/ \\\n &/g' \
>> $(KMOD_MAKEFILE); \
echo "" >> $(KMOD_MAKEFILE); \
)
@$(call Brief_Log,"CC",$(KMOD_TARGET))
$(Q) \
LDFLAGS=""; \
$(MAKE) -C $(KERNEL_DIR) M=$(KMOD_BUILD_DIR) CROSS_COMPILE=$(CROSS_PREFIX) modules
$(Q)cp -f $(KMOD_BUILD_DIR)/*.ko $(CURDIR)
$(Q)mkdir -p $(SYSROOT_LIB)
$(Q)install -m 0755 $(KMOD_BUILD_DIR)/*.ko $(SYSROOT_LIB)
endif # ifdef KMOD_TARGET

View File

@@ -0,0 +1,102 @@
ifndef LIBA_TARGET
ifndef LIBSO_TARGET
LIB_SRCS :=
endif
endif
VPATH := $(TOP_DIR)/$(MODULE_NAME)
LIB_SRCS ?= $(foreach M,*.c */*.c */*/*.c,$(wildcard $(TOP_DIR)/$(MODULE_NAME)/$(M))) $(wildcard *.c)
.PHONY : cmake
cmake:
$(Q)$(foreach V,$(INFO_ENV_VARS),$(subst -,_,$(V))="$($(V))") \
$(foreach V,$(TARGET),$(subst -,_,SRCS_$(V))="$(SRCS_$(V))") \
bash $(if $(TOP_Q),,-x) $(RULE_DIR)/scripts/gen_sub_cmake.sh $(TOP_DIR)/${MODULE_NAME}/CMakeLists.txt
ifdef Extra_CMake_Head
@rm -f $(OUTPUT_DIR)/$(STAMP_CMAKE)
@$(call Extra_CMake_Head, >> $(OUTPUT_DIR)/$(STAMP_CMAKE))
@cat $(TOP_DIR)/${MODULE_NAME}/CMakeLists.txt >> $(OUTPUT_DIR)/$(STAMP_CMAKE)
@$(call Extra_CMake_Foot, >> $(OUTPUT_DIR)/$(STAMP_CMAKE))
@mv $(OUTPUT_DIR)/$(STAMP_CMAKE) $(TOP_DIR)/${MODULE_NAME}/CMakeLists.txt
endif
ifdef LIB_SRCS_PATTERN
SRC_LIST := $(foreach M,$(LIB_SRCS_PATTERN),$(shell ls $(TOP_DIR)/$(MODULE_NAME)/$(M) 2>/dev/null))
LIB_SRCS := $(SRC_LIST)
endif
LIB_SRCS := $(filter-out $(foreach M,$(LIB_SRCS_EXCLUDE),$(TOP_DIR)/$(MODULE_NAME)/$(M)),$(LIB_SRCS))
LIB_OBJS := $(LIB_SRCS:.c=.o)
LIB_OBJS := $(subst $(TOP_DIR)/$(MODULE_NAME)/,,$(LIB_OBJS))
sinclude $(LIB_OBJS:.o=.d)
ifdef LIBA_TARGET
.PHONY: StaticLib_Install
ifeq (1,$(words $(LIBA_TARGET)))
$(LIBA_TARGET) :: $(LIB_OBJS)
@$(call Brief_Log,"AR")
$(call Inspect_Env,$(WATCHED_VARS))
$(Q)rm -f $@
ifdef CONFIG_LIBOBJ_STRIP
@$(call Brief_Log,"ST")
$(TOP_Q)$(STRIP) $(STRIP_DBGOPT) $(LIB_OBJS)
endif
$(TOP_Q) \
if [ "$$(echo "$(LIB_OBJS)"|awk '{ print NF }')" != "0" ]; then \
$(AR) -rcs $@ $(LIB_OBJS); \
fi
$(LIBA_TARGET) :: StaticLib_Install
$(Q)mkdir -p $(LIBOBJ_TMPDIR)/$(MODULE_NAME)
ifneq (,$(strip $(LIB_OBJS)))
ifneq ($(LIBA_TARGET),$(LIBA_SKIP_COMBO))
$(Q)cp -f $(LIB_OBJS) $(LIBOBJ_TMPDIR)/$(MODULE_NAME) 2>/dev/null || true
endif
endif
$(Q)mkdir -p $(SYSROOT_LIB)
$(Q)if [ -f $@ ]; then cp -f $@ $(SYSROOT_LIB); fi
$(call Copy_Headers, $(LIB_HEADERS),$(SYSROOT_INC),$(LIB_HDRS_DIR))
else
$(foreach t,$(sort $(LIBA_TARGET)),$(t)): FORCE
$(Q) \
$(MAKE) LIBA_TARGET=$@ \
LIB_SRCS="$(LIB_SRCS_$(subst .a,,$(subst lib,,$@)))" \
LIB_SRCS_PATTERN="$(LIB_SRCS_PATTERN_$(subst .a,,$(subst lib,,$@)))" \
endif # ifeq (1,$(words $(LIBA_TARGET)))
endif # ifdef LIBA_TARGET
ifdef LIBSO_TARGET
.PHONY: DynamicLib_Install
$(LIBSO_TARGET) :: SELF_LIBNAME = $(subst lib,,$(subst .so,,$(LIBSO_TARGET)))
$(LIBSO_TARGET) :: LDFLAGS := $(filter-out -l$(SELF_LIBNAME), $(LDFLAGS))
$(LIBSO_TARGET) :: $(LIB_OBJS) $(foreach d,$(DEPENDS_$(MODULE_NAME)),$(SYSROOT_LIB)/$(LIBA_TARGET_$(d)))
@$(call Brief_Log,"CC")
$(call Inspect_Env,$(WATCHED_VARS))
$(Q)$(CC) -shared -Os \
$(CFLAGS) \
$(RPATH_CFLAGS) \
-o $@ \
$(LIB_OBJS) \
-Wl,--start-group $(LDFLAGS) -Wl,--end-group
$(LIBSO_TARGET) :: DynamicLib_Install
$(Q)mkdir -p $(LIBOBJ_TMPDIR)/$(shell $(SHELL_DBG) basename $(CURDIR))
$(Q)cp -f $(LIB_OBJS) $(LIBOBJ_TMPDIR)/$(shell $(SHELL_DBG) basename $(CURDIR))
$(Q)mkdir -p $(SYSROOT_LIB)
$(Q)install -m 0755 $@ $(SYSROOT_LIB)
$(call Copy_Headers, $(LIB_HEADERS),$(SYSROOT_INC),$(LIB_HDRS_DIR))
endif # ifdef LIBSO_TARGET

View File

@@ -0,0 +1,58 @@
.PHONY: modinfo
modinfo:
@true
MODINFO_VARS := \
EXTRA_SRCS \
PKG_SWITCH \
ORIGIN \
PKG_SOURCE \
PKG_BRANCH \
PKG_REVISION \
PKG_UPSTREAM \
REF_CFLAGS \
REF_LDFLAGS \
LDFLAGS \
LIBA_TARGET \
LIB_OBJS \
TARGET \
LIBSO_TARGET \
ifneq (,$(CONFIG_$(MODULE_NAME)))
$(if $(filter modinfo,$(MAKECMDGOALS)), \
$(if $(strip $(DEPENDS)), \
$(info DEPENDS_$(MODULE_NAME) = $(strip $(DEPENDS))) \
$(info CONFIG_$(MODULE_NAME) = $(CONFIG_$(MODULE_NAME))) \
) \
)
$(if $(filter modinfo,$(MAKECMDGOALS)), \
$(foreach v, $(MODINFO_VARS), \
$(if $(strip $($(v))), \
$(info $(v)_$(MODULE_NAME) = $(strip $($(v)))) \
) \
) \
)
ifeq (0,$(words $(TARGET)))
else
ifeq (1,$(words $(TARGET)))
$(if $(filter modinfo,$(MAKECMDGOALS)), \
$(info SRCS_$(TARGET) = $(if $(SRCS_$(TARGET)), \
$(subst $(TOP_DIR)/,,$(SRCS_$(TARGET))), \
$(subst $(TOP_DIR)/$(MODULE_NAME)/,,$(SRCS)))) \
)
else
$(if $(filter modinfo,$(MAKECMDGOALS)), \
$(foreach v, $(TARGET), \
$(info SRCS_$(v) = $(SRCS_$(v))) \
) \
)
endif
endif
endif

View File

@@ -0,0 +1,120 @@
CFLAGS := $(filter-out -Werror,$(CFLAGS))
LDFLAGS :=
.PHONY: config build install post-install
ORIGIN_Q ?= @
ifeq ($(strip $(PKG_SWITCH)),y)
all :
ifeq ($(PKG_SOURCE),)
$(error PKG_SOURCE for $(PKG_NAME) cannot be found!)
endif
$(ORIGIN_Q) \
MESSAGE=$(strip $(if $(filter 0 1,$(MAKELEVEL)), \
"\r$(PKG_NAME) already pre-built at $(IMPORT_VDRDIR)/$(PREBUILT_LIBDIR)\n","")); \
if [ "$(LIBA_TARGET)" != "" -a -f $(IMPORT_VDRDIR)/$(PREBUILT_LIBDIR)/$(LIBA_TARGET) ] || \
[ "$(LIBSO_TARGET)" != "" -a -f $(IMPORT_VDRDIR)/$(PREBUILT_LIBDIR)/$(LIBSO_TARGET) ]; then \
echo -ne $${MESSAGE}; \
cp -P -f $(IMPORT_VDRDIR)/$(PREBUILT_LIBDIR)/{$(LIBA_TARGET),$(LIBSO_TARGET)*} \
$(SYSROOT_LIB) 2>/dev/null; \
for t in $(TARGET); do \
cp -f $(IMPORT_VDRDIR)/$(PREBUILT_BINDIR)/$${t} $(SYSROOT_BIN); \
done; \
touch $(STAMP_SHIELD); \
fi
$(ORIGIN_Q) \
MESSAGE=$(if $(filter 0 1,$(MAKELEVEL)),"\r$(PKG_NAME) already unpacked\n",""); \
if [ -f $(STAMP_SHIELD) ]; then true; \
elif [ -f $(STAMP_UNPACK) ]; then \
echo -ne $${MESSAGE}; \
else \
rm -rf $(PKG_NAME)* && \
if [ -f $(PKG_SOURCE) ]; then \
tar xf $(PKG_SOURCE) -C . && \
for i in $(wildcard *.patch); do \
cd $(PKG_NAME)* && patch -d . -p 1 < ../$${i} && cd $${OLDPWD}; \
done \
fi \
&& touch $(STAMP_UNPACK); \
fi
$(ORIGIN_Q) \
MESSAGE=$(if $(filter 0 1,$(MAKELEVEL)),"\r$(PKG_NAME) already configured\n",""); \
if [ -f $(STAMP_SHIELD) ]; then true; \
elif [ -f $(STAMP_CONFIG) ]; then \
echo -ne $${MESSAGE}; \
else \
if grep -q 'config *:' $(HD_MAKEFILE); then \
export SHELL=$(SHELL); \
$(MAKE) config -f $(HD_MAKEFILE); \
else \
cd $(PKG_NAME)* && ( \
./configure \
--prefix=$(OUTPUT_DIR)/usr \
--host=$(HOST) \
--target=$(shell $(SHELL_DBG) basename $(CROSS_PREFIX) 2>/dev/null) \
--enable-static --enable-shared \
|| \
./configure \
--prefix=$(OUTPUT_DIR)/usr \
--host=$(HOST) \
--target=$(shell $(SHELL_DBG) basename $(CROSS_PREFIX) 2>/dev/null|cut -d'-' -f1) \
--enable-static --enable-shared \
) && cd $${OLDPWD}; \
fi \
&& touch $(STAMP_CONFIG); \
fi
$(ORIGIN_Q) \
MESSAGE=$(if $(filter 0 1,$(MAKELEVEL)),"\r$(PKG_NAME) already built\n",""); \
if [ -f $(STAMP_SHIELD) ]; then true; \
elif [ -f $(STAMP_BUILD) ]; then \
echo -ne $${MESSAGE}; \
else \
if grep -q 'build *:' $(HD_MAKEFILE); then \
$(MAKE) build -f $(HD_MAKEFILE); \
else \
if [ -d $(PKG_NAME)* ]; then \
cd $(PKG_NAME)* && $(MAKE) -j8 all && cd ..; \
fi \
fi \
&& touch $(STAMP_BUILD); \
fi
$(ORIGIN_Q) \
MESSAGE=$(if $(filter 0 1,$(MAKELEVEL)),"\r$(PKG_NAME) already installed\n",""); \
if [ -f $(STAMP_SHIELD) ]; then true; \
elif [ -f $(STAMP_INSTALL) ]; then \
echo -ne $${MESSAGE}; \
else \
if grep -q 'install *:' $(HD_MAKEFILE); then \
$(MAKE) install -f $(HD_MAKEFILE); \
else \
if [ -d $(PKG_NAME)* ]; then \
cd $(PKG_NAME)* && $(MAKE) install && cd ..; \
fi \
fi \
&& touch $(STAMP_INSTALL); \
fi
$(ORIGIN_Q) \
MESSAGE=$(if $(filter 0 1,$(MAKELEVEL)),"\r$(PKG_NAME) already post-installed\n",""); \
if [ -f $(STAMP_POSTINS) ]; then \
echo -ne $${MESSAGE}; \
else \
if grep -q 'post-install *:' $(HD_MAKEFILE); then \
$(MAKE) post-install -f $(HD_MAKEFILE); \
fi \
&& touch $(STAMP_POSTINS); \
fi
clean-prepare:
$(Q)rm -f $(STAMP_BUILD) $(STAMP_INSTALL) $(STAMP_POSTINS)
else
all:
$(Q)true
clean:
$(Q)true
endif # ifeq ($(strip $(PKG_SWITCH)),y)

View File

@@ -0,0 +1,25 @@
ifeq (,$(findstring llvm,$(CC)))
CFLAGS := "$(sort $(CFLAGS) $(CONFIG_ENV_CFLAGS))"
else
CFLAGS := "$(CFLAGS) $(CONFIG_ENV_CFLAGS)"
endif
LDFLAGS := $(sort $(LDFLAGS) $(CONFIG_ENV_LDFLAGS))
ifeq (dynamic,$(CONFIG_LIB_EXPORT))
CFLAGS := $(filter-out --coverage,$(CFLAGS))
endif
MAKE_ENV_VARS := \
$(foreach v, \
$(shell grep -o 'CONFIG_ENV_[_A-Z]*' $(CONFIG_TPL) 2>/dev/null), \
$(subst CONFIG_ENV_,,$(v)) \
)
# $(eval ...) causes '$' in CFLAGS lost
MAKE_ENV_VARS := $(sort $(filter-out CFLAGS LDFLAGS,$(MAKE_ENV_VARS)))
$(foreach V, \
$(MAKE_ENV_VARS), \
$(eval export $(V) := $(sort $(CONFIG_ENV_$(V)))) \
)

View File

@@ -0,0 +1,74 @@
ifeq (1,$(words $(TARGET)))
SRCS := $(if $(SRCS_$(TARGET)),$(SRCS_$(TARGET)),$(SRCS))
endif
VPATH := $(TOP_DIR)/$(MODULE_NAME)
SRCS ?= $(foreach M,*.c */*.c */*/*.c,$(wildcard $(TOP_DIR)/$(MODULE_NAME)/$(M))) $(wildcard *.c)
OBJS := $(SRCS:.c=.o)
OBJS := $(subst $(TOP_DIR)/$(MODULE_NAME)/,,$(OBJS))
ifdef SRCS_PATTERN
PROG_LIST := $(foreach M,$(SRCS_PATTERN),$(shell ls $(TOP_DIR)/$(MODULE_NAME)/$(M) 2>/dev/null))
SRCS := $(PROG_LIST)
OBJS := $(PROG_LIST:.c=.o)
OBJS := $(subst $(TOP_DIR)/$(MODULE_NAME)/,,$(OBJS))
endif
ifdef TARGET
ifneq (modinfo,$(MAKECMDGOALS))
ifneq (clean,$(MAKECMDGOALS))
sinclude $(OBJS:.o=.d)
endif
endif
ifdef LIBA_TARGET
$(TARGET): $(LIBA_TARGET)
ifeq (,$(filter $(MODULE_NAME),$(COMP_LIB_COMPONENTS)))
LDFLAGS := -l$(subst .a,,$(subst lib,,$(LIBA_TARGET))) $(LDFLAGS)
endif
endif
ifdef LIBSO_TARGET
$(TARGET): $(LIBSO_TARGET)
LDFLAGS := -l$(subst .so,,$(subst lib,,$(LIBSO_TARGET))) $(LDFLAGS)
endif
LDFLAGS += $(sort $(CONFIG_ENV_LDFLAGS))
ifneq (,$(filter %.cpp %.cc,$(SRCS)))
CCLD := $(CXX)
else
CCLD := $(CC)
endif
ifeq (1,$(words $(TARGET)))
$(TARGET): $(OBJS) FORCE
$(call Inspect_Env,$(WATCHED_VARS))
$(Q)$(MAKE) comp-lib 2>/dev/null || true
$(Q) \
( \
if [ "$(strip $(CC))" = "gcc" -o "$(strip $(CC))" = "i686-w64-mingw32-gcc" ] \
|| [ "$(filter -D_PLATFORM_IS_LINUX_,$(CFLAGS))" != "" ] \
|| [ "$(filter -D_PLATFORM_IS_WINDOWS_,$(CFLAGS))" != "" ]; then \
$(call Brief_Log,"LD"); \
mkdir -p $(OUTPUT_DIR)${bindir}; \
$(CCLD) $(CFLAGS) -o $@ \
$(RPATH_CFLAGS) \
$(OBJS) \
$(LDFLAGS) && \
cp -f $@ $(OUTPUT_DIR)${bindir}; \
fi; \
)
else
$(foreach t,$(sort $(TARGET)),$(t)): FORCE
$(Q)$(MAKE) TARGET=$@ OBJS="$(SRCS_$@:.c=.o)"
endif
endif # ifdef TARGET

View File

@@ -0,0 +1,16 @@
OPS_CMDLINE_V := \
PACKAGE_DIR \
TOP_DIR \
STAMP_BLD_VAR \
OPS_SCRIPT := \
$(strip $(foreach V, $(OPS_CMDLINE_V), $(V)="$($(V))")) \
$(SHELL) \
$(RULE_DIR)/scripts/ops_repository.sh \
$(STAMP_BLD_VAR)
repo-list: config
$(TOP_Q)$(OPS_SCRIPT) list
repo-update: config
$(TOP_Q)$(OPS_SCRIPT) update

View File

@@ -0,0 +1,160 @@
SUB_LOG_OPTION := $(if $(Q),,| tee -a $(OUTPUT_DIR)/$${i}/$(COMPILE_LOG))
ALL_LOG_OPTION := $(if $(Q),,| tee -a $(COMPILE_LOG))
sub-mods: toolchain config
$(Q) \
if [ -f $(STAMP_ONE_MK) ] && [ "$(MAKECMDGOALS)" = "" ]; then \
CORE_NUM=$$(cat /proc/cpuinfo 2>/dev/null| grep processor | tail -1 | awk '{ print $$NF }'); \
JOBS_NUM=32; \
if [ "$${CORE_NUM}" != "" ]; then JOBS_NUM=$${CORE_NUM}; fi; \
if [ "$(Q)" != "@" ]; then JOBS_NUM=0; fi; \
rm -rf $(OUTPUT_DIR)${bindir}/* && \
if [ -f $(STAMP_LCOV) ] && [ "$(WITH_LCOV)" != "1" ]; then \
$(MAKE) --no-print-directory clean; \
fi && \
if ([ ! -f $(STAMP_LCOV) ] && [ "$(WITH_LCOV)" = "1" ]) || [ $(TOP_DIR)/make.settings -nt $(DIST_DIR) ]; then \
$(MAKE) --no-print-directory clean; \
fi && \
$(MAKE) --no-print-directory -j$$((JOBS_NUM + 1)) -f $(STAMP_ONE_MK) && \
TMPD=$$(mktemp -d) && \
rm -rf $(LIBOBJ_TMPDIR) $${TMPD} && \
cp -rf $(OUTPUT_DIR) $${TMPD} && \
rm -rf $${TMPD}/{usr,stamps} && \
mv $${TMPD} $(LIBOBJ_TMPDIR); \
else \
if [ -f $(STAMP_PRJ_CFG) ]; then true; else \
set -o pipefail; \
for i in \
$(SUBDIRS); do \
if [ ! -d $${i} ]; then continue; fi; \
$(MAKE) --no-print-directory Q=$(Q) $${i} 2>&1 $(SUB_LOG_OPTION); \
RETVAL=$$?; \
if [ $${RETVAL} != 0 ]; then exit $${RETVAL}; fi; \
done 2>&1 $(ALL_LOG_OPTION); \
fi; \
fi
TOP_BUILD_VARS := \
CC LD AR \
CFLAGS LDFLAGS \
PACKAGE_DIR \
IMPORT_DIR \
EXPORT_DIR \
TOP_DIR \
RULE_DIR \
CONFIG_VENDOR \
COMP_LIB \
COMP_LIB_COMPONENTS \
$(CROSS_CANDIDATES) \
$(MAKE_ENV_VARS) \
INSTALL_DIR \
INSTALL_LIB_DIR \
SYSROOT_INC \
KERNEL_DIR \
MAKE_ENV_VARS \
CROSS_PREFIX \
CROSS_CANDIDATES \
ALL_SUB_DIRS \
WIN32_CMAKE_SKIP \
NOEXEC_CMAKE_DIRS \
CMDLINE_VARS := \
HD_MAKEFILE \
MAKE_SEGMENT \
OUTPUT_DIR \
PACKAGE_DIR \
STAMP_BLD_ENV \
STAMP_UNPACK \
TOP_DIR \
RULE_DIR \
# When TOP_BUILD_VARS like $(CFLAGS) contains special character '$'
# simply echo its value into 'Makefile' will cause '$' lost when GNU make read in again
#
$(STAMP_BLD_ENV): $(TOP_DIR)/makefile $(shell ls $(CONFIG_TPL) 2>/dev/null) \
$(wildcard $(RULE_DIR)/*.mk) \
$(shell grep "^ *include" $(TOP_DIR)/$(TOP_MAKEFILE)|awk '{ print $$NF }'|$(SED) '/^\$$/d')
@rm -f $@
@$(foreach V, \
$(sort $(TOP_BUILD_VARS)), \
echo "$(V) := $(sort $($(V)))"|$(SED) 's:\$$:$$$$:g' >> $(STAMP_BLD_ENV); \
)
@echo "COMP_LIB_FILES := $(foreach V,$(COMP_LIB_COMPONENTS), $(LIBA_TARGET_$(V)))" >> $@
# note:
# $(SED) -i "/CONFIG_$${i//\//\\/}.*/d" $(CONFIG_TPL);
# above
# $(SED) -i "1iCONFIG_$${i} = y" $(CONFIG_TPL)
# was removed since modules will be skipped in some cases
$(STAMP_BLD_VAR): $(foreach d,$(ALL_SUB_DIRS),$(d)/$(MAKE_SEGMENT)) $(STAMP_BLD_ENV) $(wildcard $(RULE_DIR)/*.mk)
$(TOP_Q) \
( \
if [ ! -f $(STAMP_BLD_VAR) ]; then echo ""; VERBOSE=1; fi; \
rm -f $(STAMP_BLD_VAR); \
for i in $(shell echo "$(ALL_SUB_DIRS)"|tr ' ' '\n'|sort -u); do \
if [ "$${VERBOSE}" != "" ]; then \
printf "CONFIGURE .............................. [%s]\n" $${i}; \
$(SED) -i "1iCONFIG_$${i} = y" $(CONFIG_TPL); \
if ! grep -q "target-$${i}:" $(STAMP_POST_RULE) 2>/dev/null; then \
echo "target-$${i}:; @true" >> $(STAMP_POST_RULE); \
fi; \
fi; \
$(foreach V, $(CMDLINE_VARS), $(V)="$($(V))") \
bash $(RULE_DIR)/pre-build.sh $${i} makefile-only > /dev/null; \
if [ -d $(OUTPUT_DIR)/$${i} ]; then \
$(MAKE) -s -C $(OUTPUT_DIR)/$${i} modinfo > /dev/null; \
if [ $$? = 0 ]; then \
$(MAKE) --no-print-directory -s -C $(OUTPUT_DIR)/$${i} modinfo >> $(STAMP_BLD_VAR); \
else \
echo ""; \
echo "ERROR detected in '$${i}/$(MAKE_SEGMENT)'..."|grep --color '.*'; \
echo ""; \
rm -f $(STAMP_BLD_VAR) $(STAMP_PRJ_CFG); \
exit 13; \
fi \
fi \
done; \
sort -o $(STAMP_BLD_VAR) $(STAMP_BLD_VAR); \
if [ "$${VERBOSE}" != "" ]; then echo ""; fi; \
)
pre-build: MOD = $(subst target-,,$(filter-out $@,$(MAKECMDGOALS)))
pre-build: $(STAMP_BLD_ENV)
$(TOP_Q)rm -f $(OUTPUT_DIR)/$(MOD)/$(STAMP_UNPACK)
$(if $(filter 0,$(MAKELEVEL)),,@) \
$(strip $(foreach V, $(CMDLINE_VARS), $(V)="$($(V))") \
PKG_SOURCE="$(PKG_SOURCE_$(MOD))" \
PKG_BRANCH="$(PKG_BRANCH_$(MOD))" \
PKG_REVISION="$(PKG_REVISION_$(MOD))" \
PKG_UPSTREAM="$(PKG_UPSTREAM_$(MOD))" \
PKG_SWITCH="$(PKG_SWITCH_$(MOD))" \
) \
$(if $(filter 0,$(MAKELEVEL)),VERBOSE_PRE_BLD=1) \
bash $(RULE_DIR)/pre-build.sh $(subst target-,,$(filter-out $@,$(MAKECMDGOALS)))
.PHONY: $(ALL_SUB_DIRS)
$(ALL_SUB_DIRS): ALL_LOG_OPT = $(if $(Q),,2>&1|tee -a $(OUTPUT_DIR)/$(COMPILE_LOG))
$(ALL_SUB_DIRS): SUB_LOG_OPT = $(if $(Q),,2>&1|tee -a $(OUTPUT_DIR)/$@/$(COMPILE_LOG))
$(ALL_SUB_DIRS): $(if $(filter 0,$(MAKELEVEL)),toolchain) $(STAMP_BLD_VAR)
$(TOP_Q)rm -f $(STAMP_PRJ_CFG)
$(TOP_Q)$(MAKE) --no-print-directory pre-build target-$@
ifeq (0,$(MAKELEVEL))
$(Q)$(MAKE) --no-print-directory -C $(OUTPUT_DIR)/$@ clean
endif
$(Q) \
if [ "$$( $(call Require_Build,$@) )" = "TRUE" ]; then \
$(call Build_Depends,$@) && \
$(call Build_CompLib,$@) && \
$(call Update_Extra_Srcs,$(EXTRA_SRCS_$@),$@) && \
$(MAKE) --no-print-directory -C $(OUTPUT_DIR)/$@ all $(SUB_LOG_OPT) $(ALL_LOG_OPT) && \
if [ "$$(echo $(ORIGIN_$@))" != "" ]; then \
touch $(OUTPUT_DIR)/$@/{$(STAMP_UNPACK),$(STAMP_CONFIG),$(STAMP_BUILD),$(STAMP_INSTALL)}; \
fi \
else \
echo -ne "\r$$(printf '%40s' '')\r"; \
fi
@mkdir -p $(STAMP_DIR) && touch $(STAMP_DIR)/$$(echo "$@"|$(SED) 's:/:~:g').build.done

View File

@@ -0,0 +1,216 @@
.PHONY: doc detect config reconfig toolchain sub-mods final-out env cmake one help
all: detect config toolchain sub-mods final-out
$(TOP_Q) \
if [ -f $(STAMP_PRJ_CFG) ]; then \
$(RECURSIVE_MAKE) toolchain; \
rm -f $(STAMP_PRJ_CFG); \
fi
@rm -rf $(STAMP_DIR)
RESET_ENV_VARS := \
CROSS_PREFIX \
CFLAGS \
HOST \
LDFLAGS \
help:
@echo -e "\033[1;37m[$(RULE_DIR)/docs]\e[0m"
@echo ""
@cat $(RULE_DIR)/docs/Help.md
@echo ""
doc:
$(TOP_Q)rm -rf $(DOXYGEN_DIR)/html; mkdir -p $(DOXYGEN_DIR)
$(TOP_Q) \
$(SED) \
-e 's:^PROJECT_NAME.*:PROJECT_NAME = $(PRJ_NAME):g;' \
-e 's:^PROJECT_NUMBER.*:PROJECT_NUMBER = $(PRJ_VERSION):g;' \
-e 's:^OUTPUT_DIRECTORY.*:OUTPUT_DIRECTORY = $(DOXYGEN_DIR):g;' \
build-rules/misc/Doxyfile.tpl > $(OUTPUT_DIR)/.doxygen.cfg
$(TOP_Q)doxygen $(OUTPUT_DIR)/.doxygen.cfg
detect:
@if [ -d .git ]; then \
mkdir -p .git/hooks; \
for i in $(RULE_DIR)/hooks/*; do \
cp -f $$i .git/hooks && chmod a+x .git/hooks/$$(basename $$i); \
done; \
fi
prune:
@echo "$(TOP_DIR).pkgs directory removed!"|grep --color ".*"
@rm -rf $(TOP_DIR).pkgs
@$(MAKE) --no-print-directory distclean
unzip: config $(STAMP_BLD_VAR)
@echo "Components: "
@echo ""
@for i in $(ALL_SUB_DIRS); do \
$(MAKE) --no-print-directory pre-build target-$${i} ; \
echo -ne "\r. $${i}"; \
echo -e " "; \
done
@echo ""
cmake:
$(TOP_Q)$(MAKE) -s distclean
$(TOP_Q)$(MAKE) -s DEFAULT_BLD=$(RULE_DIR)/misc/config.generic.cmake config
$(TOP_Q)$(foreach V,$(INFO_ENV_VARS),$(V)="$($(V))") CFLAGS=$(CFLAGS) \
SEP_LIBS="$$(grep -m 1 '^COMP_LIB_FILES' $(STAMP_BLD_ENV) | cut -d' ' -f3-)" \
bash $(if $(TOP_Q),,-x) $(RULE_DIR)/scripts/gen_top_cmake.sh $(TOP_DIR)/CMakeLists.txt
$(TOP_Q)for D in $(ALL_SUB_DIRS); do \
echo "+ $${D}"; \
$(MAKE) --no-print-directory -C $(OUTPUT_DIR)/$${D} cmake; \
done
$(TOP_Q)echo ""
one: COMP_LIB_OBJS = $(foreach V,$(COMP_LIB_COMPONENTS),$(foreach U,$(LIB_OBJS_$(V)),$(V)/$(U)))
one:
$(TOP_Q)$(foreach V,$(INFO_ENV_VARS),$(V)="$($(V))") \
CFLAGS="$(subst ",,$(CFLAGS))" \
ALL_LIBS="$(strip $(foreach V,$(SUBDIRS),$(LIBA_TARGET_$(V))))" \
ALL_PROG="$(strip $(foreach V,$(SUBDIRS) $(COMP_LIB_COMPONENTS),$(TARGET_$(V))))" \
COMP_LIB_OBJS="$(COMP_LIB_OBJS)" \
bash $(RULE_DIR)/scripts/gen_one_makefile.sh
config:
@mkdir -p $(OUTPUT_DIR) $(STAMP_DIR) $(INSTALL_DIR)
@mkdir -p $(SYSROOT_BIN) $(SYSROOT_INC) $(SYSROOT_LIB)
$(TOP_Q) \
if [ -f $(STAMP_BLD_VAR) ]; then \
if [ "$$($(SED) '/[-_/a-zA-Z0-9]* = *..*/d' $(STAMP_BLD_VAR)|wc -l|$(SED) 's:^ *::g')" != "0" ]; then \
rm -vf $(STAMP_BLD_VAR); \
fi \
fi
$(TOP_Q)+( \
if [ -f $(CONFIG_TPL) ]; then \
if [ "$(filter comp-lib,$(MAKECMDGOALS))" = "" ]; then \
printf "BUILDING WITH EXISTING CONFIGURATION:\n\n"; \
command grep -m 1 "VENDOR *:" $(CONFIG_TPL)|cut -c 3-; \
command grep -m 1 "MODEL *:" $(CONFIG_TPL)|cut -c 3-; \
echo ""; \
fi \
else \
if ([ "$(MAKECMDGOALS)" = "all" ]) || ([ "$(DEFAULT_BLD)" != "" ] && [ -f $(DEFAULT_BLD) ] && \
([ "$(DEFAULT_BLD)" = "$(RULE_DIR)/misc/config.generic.default" ] \
|| [ "$(MAKECMDGOALS)" = "" ] || [ "$(MAKECMDGOALS)" = "config" ])); then \
printf "# Automatically Generated Section End\n\n" >> $(CONFIG_TPL); \
printf "# %-10s %s\n" "VENDOR :" $$(basename $(DEFAULT_BLD)|cut -d. -f2) >> $(CONFIG_TPL); \
printf "# %-10s %s\n" "MODEL :" $$(basename $(DEFAULT_BLD)|cut -d. -f3) >> $(CONFIG_TPL); \
cat $(DEFAULT_BLD) >> $(CONFIG_TPL); \
else \
printf "SELECT A CONFIGURATION:\n\n"; \
LIST=$$(for i in $(CONFIG_DIR)/config.*.*; do basename $${i}; done|sort); \
select V in $${LIST}; do \
echo ""; \
printf "# Automatically Generated Section End\n\n" >> $(CONFIG_TPL); \
printf "# %-10s %s\n" "VENDOR :" $$(echo $${V}|cut -d. -f2) >> $(CONFIG_TPL); \
printf "# %-10s %s\n" "MODEL :" $$(echo $${V}|cut -d. -f3) >> $(CONFIG_TPL); \
cp -f -P $(IMPORT_DIR)/$$(echo $${V}|cut -d. -f2)/$(PREBUILT_LIBDIR)/*.so* $(SYSROOT_LIB) 2>/dev/null; \
cat $(CONFIG_DIR)/$${V} >> $(CONFIG_TPL); \
break; \
done; \
fi && \
printf "SELECTED CONFIGURATION:\n\n" && \
command grep -m 1 "VENDOR *:" $(CONFIG_TPL)|cut -c 3- && \
command grep -m 1 "MODEL *:" $(CONFIG_TPL)|cut -c 3- && \
echo ""; \
if [ "$(MAKECMDGOALS)" = "config" ]; then true; else \
if [ "$(DEFAULT_BLD)" = "" ]; then \
touch $(STAMP_PRJ_CFG); \
fi; \
fi; \
for i in $(RESET_ENV_VARS); do unset $${i}; done; \
$(MAKE) --no-print-directory -f $(TOP_MAKEFILE) $(STAMP_BLD_VAR) unzip; \
fi)
@$(MAKE) --no-print-directory one
DL_TOOLCHAIN_VARS = \
TOOLCHAIN_DLDIR \
OUTPUT_DIR \
toolchain:
@$(foreach V,$(DL_TOOLCHAIN_VARS),$(V)=$($(V))) \
CC=$(shell basename $(CC)) \
AR=$(shell basename $(AR)) \
RELPATH=` $(call Relative_TcPath,$(shell basename $(CC))) ` \
GITPATH=` $(call Gitrepo_TcPath,$(shell basename $(CC))) ` \
bash $(RULE_DIR)/scripts/gen_cross_toolchain.sh
reconfig: distclean
$(TOP_Q)+( \
if [ -d $(CONFIG_DIR) ]; then \
$(RECURSIVE_MAKE) config DEFAULT_BLD=not-exist-actually; \
else \
$(RECURSIVE_MAKE) config; \
fi)
$(TOP_Q)rm -f $(STAMP_PRJ_CFG)
clean:
$(TOP_Q) \
$(TOP_Q) \
rm -rf \
$(LIBOBJ_TMPDIR) \
$(COMPILE_LOG) \
$(DIST_DIR)/* \
$(STAMP_DIR) \
$(STAMP_LCOV) \
$(SYSROOT_INC)/* $(SYSROOT_LIB)/* $(SYSROOT_LIB)/../bin/* \
$(shell $(SHELL_DBG) find $(OUTPUT_DIR) -name "$(COMPILE_LOG)" \
-or -name "$(WARNING_LOG)" \
-or -name "$(STAMP_BUILD)" \
-or -name "$(STAMP_INSTALL)" \
-or -name "$(STAMP_POSTINS)" \
-or -name "*.so" \
-or -name "*.a" \
-or -name "*.o" \
-or -name "*.d" \
-or -name "*.gc*" \
| grep -v '$(OUTPUT_DIR)/compiler' \
2>/dev/null)
distclean:
$(TOP_Q) \
rm -rf \
$(CONFIG_TPL) $(COMPILE_LOG) \
$(STAMP_PRJ_CFG) $(STAMP_BLD_ENV) $(STAMP_BLD_VAR) $(STAMP_POST_RULE) $(STAMP_LCOV) \
$(DIST_DIR) $(STAMP_DIR) *.gcda \
$(TOP_Q) \
if [ -d $(OUTPUT_DIR) ]; then \
cd $(OUTPUT_DIR); \
if [ "$(CONFIG_TOOLCHAIN_NAME)" = "" ]; then \
rm -rf *; \
else \
rm -rf $$(ls -I $(CONFIG_TOOLCHAIN_NAME)); \
fi \
fi
ifeq ($(shell uname),Darwin)
KCONFIG_MCONF := tools/prebuilt/macos/kconfig-frontends-mac/kconfig-mconf
else
KCONFIG_MCONF := tools/prebuilt/ubuntu/bin/kconfig-mconf
endif
COMMON_CONFIG_ENV = \
KCONFIG_CONFIG=mconf.config \
KCONFIG_AUTOCONFIG=$(OUTPUT_DIR)/auto.conf \
KCONFIG_AUTOHEADER=$(OUTPUT_DIR)/autoconf.h \
CONFIG_=FEATURE_ \
menuconfig: $(KCONFIG_MCONF)
$(TOP_Q)chmod a+x $(KCONFIG_MCONF) $(if $(TOP_Q),2>/dev/null) || true
$(TOP_Q)$(COMMON_CONFIG_ENV) $^ -s $(TOP_DIR)/tools/Config.in $(if $(TOP_Q),2>/dev/null)
$(TOP_Q) \
( \
if [ ! -f mconf.config ]; then exit 0; fi; \
\
cp -Lf mconf.config make.settings; \
rm -f mconf.config*; \
)

View File

@@ -0,0 +1,14 @@
常用命令
---
| 命令 | 解释 |
|-----------------------|-----------------------------------------------------------------------------------|
| `make distclean` | **清除一切编译过程产生的中间文件, 使当前目录仿佛和刚刚clone下来一样** |
| `make` | **使用默认的或者已选中的平台配置文件开始编译** |
| `make reconfig` | **弹出多平台选择菜单, 用户可按数字键选择, 然后根据相应的硬件平台配置开始编译** |
| `make config` | **显示当前被选择的平台配置文件** |
| `make menuconfig` | **图形化的编辑 make.settings 文件** |
| `make help` | **打印帮助文本** |
| `make env` | **打印当前编译的选项和它们的值** |
o 访问 https://code.aliyun.com/edward.yangx/public-docs/wikis/home 可获得编译系统线上最新和最全的帮助文档

View File

@@ -0,0 +1,259 @@
define Append_Conditional
$(if $(strip $(foreach V,$(4),$(filter -D$(V),$(CFLAGS)))),, \
$(if \
$(if $(strip $(3)),,x)$(findstring $(foreach U,$(3),-D$(U)),$(foreach U,$(3),$(filter -D$(U),$(CFLAGS)))), \
$(eval $(strip $(1)) += $(2)) \
) \
)
endef
define Dump_Var
NUM=`echo "$(strip $($(1)))"|awk '{ print NF }'`; \
if (( $${NUM} \> 1 )); then \
printf -- "-----------------------------------------------------------------\n"; \
printf "%-24s| %s\n" ". $(1)" `echo "$(strip $($(1)))"|cut -d' ' -f1|$(SED) 's/^ *//'`; \
for i in `echo "$(strip $($(1)))"|cut -d' ' -f2-`; do \
printf "%-24s| %s\n" "" "$${i}"; \
done; \
printf -- "-----------------------------------------------------------------\n"; \
else \
printf "%-24s| %s\n" ". $(1)" "$(strip $($(1)))"; \
fi;
endef
ifneq (,$(Q))
define Inspect_Env
endef
else
define Inspect_Env
@printf -- "-----------------------------------------------------------------\n"
@printf "%-20s| %s\n" ". BUILDING_TARGET" "$@"
@printf -- "-----------------------------------------------------------------\n"
@printf "%-20s| %s\n" ". BUILDING_DEPEND" "$(filter-out FORCE,$^)"
@printf -- "-----------------------------------------------------------------\n"
@$(foreach var,$(1),$(call Dump_Var,$(var)))
@printf -- "-----------------------------------------------------------------\n"
endef
endif
# 31, red. 32, green. 33, yellow. 34, blue. 35, magenta. 36, cyan. 37, white.
define Brief_Log
( \
if [ "$1" = "CC" ]; then \
if echo "$@"|grep -q "\.so$$"; then \
COLOR_MARK="\033[1;32m"; \
elif echo "$@"|grep -q "\.ko$$"; then \
COLOR_MARK="\033[1;35m"; \
else \
COLOR_MARK="\033[1;36m"; \
fi \
elif [ "$1" = "AR" ]; then \
COLOR_MARK="\033[1;33m"; \
elif [ "$1" = "LD" ]; then \
COLOR_MARK="\033[1;31m"; \
elif [ "$1" = "ST" ]; then \
COLOR_MARK="\033[0;33m"; \
fi; \
if [ "$(PLAIN_LOG)" != "1" ]; then \
echo -ne "$${COLOR_MARK}"; \
fi; \
if [ "$2" = "" ]; then \
FIRST_DEP="$(firstword $(filter-out FORCE,$?))"; \
SPACE_BAR=" "; \
if [ "$${FIRST_DEP}" != "" ]; then \
FIRST_DEP="$$(basename $${FIRST_DEP})"; \
fi; \
printf "\r%-40s%s%s$(3)\n" "[$1] $$(echo -n "$$(basename $@)" | cut -c1-28)" "<= $${FIRST_DEP} $${SPACE_BAR}"; \
else \
printf "\r%-40s%s%s$(3)\n" "[$1] $$(echo -n "$(2)" | cut -c1-28)" "<= $${FIRST_DEP} $${SPACE_BAR}"; \
fi; \
if [ "$3" != "..." ]; then \
for i in $(wordlist 2,150,$(filter-out FORCE,$?)); do \
if [ "$$(echo $${i}|cut -c1)" != "/" ]; then \
printf "%-40s%s$(3)\n" "" " $$(basename $${i})"; \
fi \
done; \
fi; \
if [ "$(PLAIN_LOG)" != "1" ]; then \
echo -ne "\033[0m"; \
fi; \
)
endef
define Copy_Headers
$(Q) \
if [ "$(strip $(1))" != "" ]; then \
mkdir -p $(2)/$(3); \
for hdr in $(1); do \
if [ ! -f $(2)/$(3)/$${hdr} ] || [ $${PWD}/$${hdr} -nt $(2)/$(3)/$${hdr} ]; then \
mkdir -p $(2)/$(3); \
cp -f $(TOP_DIR)/$(MODULE_NAME)/$${hdr} $(2)/$(3)/$$(basename $${hdr}); \
fi; \
done \
fi
endef
define Update_Extra_Srcs
( \
for ELEM in $(strip $(1)); do \
DST=$(OUTPUT_DIR)/$(2)/$$(basename $${ELEM}); \
if [ $${ELEM} -nt $${DST} ]; then \
cp -Lf $${ELEM} $${DST}; \
fi; \
done \
)
endef
define Require_Build
( \
SW=$$(grep -m 1 "^PKG_SWITCH_$(1) =" $(STAMP_BLD_VAR)|awk '{ print $$NF }'); \
[ "$${SW}" != "y" ] && \
echo "FALSE" && exit; set +x; \
\
[ "$(LIBA_TARGET_$(1))" != "" ] && \
$(foreach L,$(LIBA_TARGET_$(1)),[ -f $(IMPORT_VDRDIR)/$(PREBUILT_LIBDIR)/$(L) ] && ) \
echo "FALSE" && exit; \
\
[ "$(LIBSO_TARGET_$(1))" != "" ] && \
[ -f $(IMPORT_VDRDIR)/$(PREBUILT_LIBDIR)/$(LIBSO_TARGET_$(1)) ] && \
echo "FALSE" && exit; \
\
echo "TRUE"; \
)
endef
define Build_Depends
( \
set -o pipefail && \
for i in $(DEPENDS_$(1)); do \
STAMP=$(STAMP_DIR)/$$(echo $${i}|$(SED) 's:/:~:g').build.done; \
if [ -f $${STAMP} ]; then \
continue; \
fi; \
$(MAKE) --no-print-directory $${i} \
$(if $(Q),,2>&1|tee -a $(OUTPUT_DIR)/$${i}/$(COMPILE_LOG)) \
$(if $(Q),,2>&1|tee -a $(OUTPUT_DIR)/$(COMPILE_LOG)); \
RETVAL=$$?; \
if [ $${RETVAL} != 0 ]; then \
exit $${RETVAL}; \
fi; \
done \
\
)
endef
#
# ($(foreach d,$(COMP_LIB_COMPONENTS), \
#
# $(RECURSIVE_MAKE) pre-build target-$(d) && \
# $(MAKE) --no-print-directory -C $(OUTPUT_DIR)/$(d) $(LIBA_TARGET_$(d)) \
# $(if $(Q),,2>&1|tee -a $(OUTPUT_DIR)/$(d)/$(COMPILE_LOG)) \
# $(if $(Q),,2>&1|tee -a $(OUTPUT_DIR)/$(COMPILE_LOG)) \
# ; \
#
# if [ $$? != 0 ]; then \
#
# KEEP SEPA-LIBS:
#
# rm -f $(SYSROOT_LIB)/$(firstword $(LIBA_TARGET_$(d))) $(SYSROOT_LIB)/$(firstword $(LIBSO_TARGET_$(d))) 2>/dev/null; \
#
ifdef COMP_LIB
define Build_CompLib
( \
if [ "$(strip $(1))" = "FORCE" ] || \
[ "$$(echo $(LDFLAGS_$(strip $(1)))|grep -wo -- '-l$(COMP_LIB_NAME)')" != "" ]; then \
( \
$(foreach d,$(COMP_LIB_COMPONENTS), \
[ -f $(STAMP_DIR)/$(subst /,~,$(d)).build.done ] || \
set -o pipefail && \
$(MAKE) --no-print-directory -C $(OUTPUT_DIR)/$(d) $(firstword $(LIBA_TARGET_$(d))) $(firstword $(LIBSO_TARGET_$(d))) && set +x; \
RETVAL=$$?; \
if [ $${RETVAL} != 0 ]; then \
exit $${RETVAL}; \
fi; \
) \
); \
if [ ! -f $(SYSROOT_LIB)/$(COMP_LIB) ]; then \
$(call Info_CompLib,$(COMP_LIB_NAME),$(COMP_LIB_OBJS)); \
fi; \
$(call Finalize_CompLib,$(COMP_LIB_OBJS),$(SYSROOT_LIB),$(COMP_LIB_NAME)); \
fi \
)
endef
else
define Build_CompLib
true
endef
endif
define Relative_TcPath
( \
case $(1) in \
xtensa-lx106-elf-gcc ) \
echo "gcc-xtensa-lx106-linux/main/bin" ;; \
arm-none-eabi-gcc ) \
echo "gcc-arm-none-eabi-linux/main/bin" ;; \
esac \
)
endef
define Gitrepo_TcPath
( \
case $(1) in \
xtensa-lx106-elf-gcc ) \
echo "gcc-xtensa-lx106-linux" ;; \
arm-none-eabi-gcc ) \
echo "gcc-arm-none-eabi-linux" ;; \
esac \
)
endef
define CompLib_Map
$(eval \
COMP_LIB_COMPONENTS += \
$(if \
$(filter y,$($(strip $(1)))),$(foreach M,$(strip $(2)),$(if $(filter $(strip $(M)),$(COMP_LIB_COMPONENTS)),,$(strip $(M)))) \
) \
)
endef
OMIT_GOALS := distclean clean env help config reconfig menuconfig
ifeq (,$(filter $(OMIT_GOALS),$(MAKECMDGOALS)))
define Conflict_Relation
$(if $(filter y,$($(strip $(1)))), \
$(if $(filter y,$($(strip $(2)))), \
$(error INVALID CONFIG: '$(strip $(1)) = $($(strip $(1)))' conflicts with '$(strip $(2)) = $($(strip $(2)))' at same time!), \
), \
)
endef
define Present1_Relation
$(if $(filter n,$($(strip $(1)))), \
$(if $(filter n,$($(strip $(2)))), \
$(error INVALID CONFIG: '$(strip $(1)) = $($(strip $(1)))' conflicts with '$(strip $(2)) = $($(strip $(2)))' at same time!), \
), \
)
endef
define Requires_Relation
$(if $(filter y,$($(strip $(1)))), \
$(if $(filter y,$($(strip $(2)))),, \
$(error INVALID CONFIG: '$(strip $(2)) = $($(strip $(2)))' breaks dependency since '$(strip $(1)) = $($(strip $(1)))'!), \
), \
)
endef
else # ifeq (,$(filter $(OMIT_GOALS),$(MAKECMDGOALS)))
define Conflict_Relation
endef
define Present1_Relation
endef
define Requires_Relation
endef
endif # ifeq (,$(filter $(OMIT_GOALS),$(MAKECMDGOALS)))

View File

@@ -0,0 +1,23 @@
#!/bin/sh
#
# An example hook script to verify what is about to be committed.
# Called by "git commit" with no arguments. The hook should
# exit with non-zero status after issuing an appropriate message if
# it wants to stop the commit.
#
# To enable this hook, rename this file to "pre-commit".
for i in `git status -s | awk '{ print $NF }'`; do
j=$(echo $(basename $i)|cut -d'.' -f2)
if [ "$j" = "c" -o "$j" = "h" -o "$j" = "md" -o "$j" = "mk" ] || [ "$i" = "makefile" -o "$i" = "make.settings" ]; then
if [ "$(find $i -perm /111 2>/dev/null)" != "" ]; then
chmod a-x $i
echo "[chmod] $i"
if [ "$(git status --short $i|cut -c1)" = "M" ]; then
git add $i
fi
fi
else
echo "[skip ] $i"
fi
done

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,5 @@
CONFIG_ENV_CFLAGS += \
-Os -Wall \
-D_PLATFORM_IS_HOST_ \
LDFLAGS += -lpthread -lrt

View File

@@ -0,0 +1,2 @@
CONFIG_ENV_CFLAGS += -Wall
CONFIG_ENV_CFLAGS += --coverage

View File

@@ -0,0 +1,192 @@
#include "cut.h"
struct cut_runtime cut;
static char suite_pattern[64];
static char case_pattern[64];
static void _filter(int argc, char **argv)
{
int i = 0;
struct cut_case *c = NULL;
if (argc == 2 && 0 == strcmp(argv[1], "all")) {
return;
}
for (i = 0; i < cut.ccnt_total; i++) {
c = cut.clist[i];
if ((argc == 2 && (0 != strcmp(c->sname, argv[1]))) ||
(argc == 3 && (0 != strcmp(c->sname, argv[1]) || 0 != strcmp(c->cname, argv[2])))) {
if (!(argc == 2 && strlen(suite_pattern) && strstr(c->sname, suite_pattern))) {
cut.clist[i]->skip = 1;
cut.ccnt_skip++;
}
}
}
}
static void _usage(const char *me)
{
cut_printf("Usage: %s [OPTION] S-FILTER [C-FILTER]\n\n" \
"OPTION:\n" \
" --verbose: verbose when exec cases\n" \
" --list: list cases\n" \
" --count: print case count\n" \
"\n" \
"S-FILTER: suite name filter, e.g. '%s all' means run all suites\n" \
"C-FILTER: case name filter\n", me, me);
}
static int _verbose_opt = 0;
static int _parse_arg(int argc, char **argv)
{
if (argc >= 2) {
if (0 == strcmp(argv[1], "--list")) {
int i = 0;
int cnt = 0;
for (i = 0; i < cut.ccnt_total; i++) {
struct cut_case *c = cut.clist[i];
if (argc == 2 ||
(argc == 3 && 0 == strcmp(argv[2], "all")) ||
(argc == 3 && 0 == strcmp(c->sname, argv[2])) ||
(argc == 3 && strlen(suite_pattern) && strstr(c->sname, suite_pattern)) ||
(argc == 4 && strlen(suite_pattern) && strlen(case_pattern) && strstr(c->sname, suite_pattern)
&& strstr(c->cname, case_pattern)) ||
(argc == 4 && 0 == strcmp(c->sname, argv[2]) && 0 == strcmp(c->cname, argv[3]))) {
cut_printf(" [%02d] %s.%s\n", ++cnt, c->sname, c->cname);
}
}
cut_printf("\n");
cut_printf("In total %d case(s), matched %d case(s)\n", cut.ccnt_total, cnt);
cut_printf("\n");
return 0;
}
if (0 == strcmp(argv[1], "--count")) {
cut_printf("total %d case(s).\n", cut.ccnt_total);
return 0;
}
if (0 == strcmp(argv[1], "--help")) {
_usage(argv[0]);
return 0;
}
}
return 1;
}
int cut_main(int argc, char **argv)
{
int i = 0, j = 0, cnt = 0;
char tmpbuf[128];
char *pos;
if (argc >= 2) {
int idx = 1;
char *q = NULL;
if (!strcmp(argv[1], "--list") || !strncmp(argv[1], "--verbose", strlen("--verbose"))) {
idx += 1;
}
if (idx < argc) {
if ((q = strchr(argv[idx], '%')) != NULL) {
strncpy(suite_pattern, argv[idx], q - argv[idx]);
}
idx += 1;
if (idx < argc) {
if ((q = strchr(argv[idx], '%')) != NULL) {
strncpy(case_pattern, argv[idx], q - argv[idx]);
}
}
}
}
if (0 == _parse_arg(argc, argv)) {
return 0;
}
if (argc >= 2 && !strncmp(argv[1], "--verbose", strlen("--verbose"))) {
_verbose_opt = 1;
argc --;
argv ++;
}
_filter(argc, argv);
for (; i < cut.ccnt_total; i++) {
pos = tmpbuf;
cut.ccur = cut.clist[i];
if (cut.ccur->skip) {
continue;
}
memset(tmpbuf, 0, sizeof(tmpbuf));
pos += cut_snprintf(pos,
sizeof(tmpbuf),
"TEST [%02d/%02d] %s.%s ",
++cnt,
cut.ccnt_total - cut.ccnt_skip,
cut.ccur->sname,
cut.ccur->cname);
for (j = 80 - strlen(tmpbuf); j >= 0; --j) {
pos += sprintf(pos, "%s", ".");
}
if (_verbose_opt) {
pos += sprintf(pos, " [%sEXEC%s]\n", COL_YEL, COL_DEF);
cut_printf("%s", tmpbuf);
pos -= 19;
}
TRY {
if (cut.ccur->setup)
{
cut.ccur->setup(cut.ccur->data, cut.ccur);
}
cut.ccur->run(cut.ccur->data, (struct cut_case *)cut.ccur);
if (cut.ccur->teardown)
{
cut.ccur->teardown(cut.ccur->data);
}
pos += sprintf(pos, " [%sSUCC%s]\n", COL_GRE, COL_DEF);
cut_printf("%s", tmpbuf);
cut.ccnt_pass++;
continue;
}
EXCEPT {
pos += sprintf(pos, " [%sFAIL%s]\n", COL_RED, COL_DEF);
cut_printf("%s", tmpbuf);
cut.ccnt_fail++;
continue;
}
}
cut_printf("\n");
cut_printf("===========================================================================\n");
if (cut.ccnt_fail > 0) {
cut_printf("FAIL LIST:\n");
for (i = 0; i < cut.ccnt_fail; i++) {
cut_printf(" [%02d] %s\n", i + 1, cut.cerrmsg[i]);
cut_free(cut.cerrmsg[i]);
}
cut_printf("---------------------------------------------------------------------------\n");
}
cut_printf("SUMMARY:\n" \
" TOTAL: %d\n" \
" SKIPPED: %d\n" \
" MATCHED: %d\n" \
" PASS: %d\n" \
" FAILED: %d\n", cut.ccnt_total, cut.ccnt_skip,
cut.ccnt_total - cut.ccnt_skip, cut.ccnt_pass, cut.ccnt_fail);
cut_printf("===========================================================================\n");
return cut.ccnt_fail;
}

View File

@@ -0,0 +1,249 @@
#ifndef __CUT_H__
#define __CUT_H__
#ifdef __cplusplus
extern "C" {
#endif
#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
#include <setjmp.h>
#include <string.h>
#include <assert.h>
#define CUT_CASE_MAX_CNT (1024)
#define CUT_MSG_MAX_LEN (512)
#define cut_printf printf
#define cut_snprintf snprintf
#define cut_malloc malloc
#define cut_free free
#define CASE2 CASEs
extern int cut_main(int argc, char **argv);
extern struct cut_runtime cut;
struct cut_case {
const char *sname;
const char *cname;
void *data;
void (*run)(void *, void *);
void (*setup)(void *, void *);
void (*teardown)(void *);
int skip;
};
struct cut_runtime {
jmp_buf jmpbuf;
int scnt_total;
int ccnt_total;
int ccnt_pass;
int ccnt_fail;
int ccnt_skip;
struct cut_case *clist[CUT_CASE_MAX_CNT];
struct cut_case *ccur;
char *cerrmsg[CUT_CASE_MAX_CNT];
};
#define CUT_CASE_RUNNER(sname, cname) cut_##sname##_##cname##_run
#define CUT_CASE_NAME(sname, cname) cut_##sname##_##cname
#define CUT_CASE_DATA(sname) cut_##sname##_data
#define CUT_CASE_SETUP(sname) cut_##sname##_setup
#define CUT_CASE_TEARDOWN(sname) cut_##sname##_teardown
#define DATA(sname) \
struct CUT_CASE_DATA(sname)
#define SETUP(sname) \
static void CUT_CASE_SETUP(sname)(struct CUT_CASE_DATA(sname) *data, struct cut_case *case_data)
#define TEARDOWN(sname) \
static void CUT_CASE_TEARDOWN(sname)(struct CUT_CASE_DATA(sname) *data)
/*
* @brief: construct a test case structor and a test case runner
* @sname: suite name
* @cname: case name
* e.g.
CASE(mysuite, mycase1) {
// do something here
ASSERT_TRUE(1);
}
*/
#define CASE(sname, cname) \
static void CUT_CASE_RUNNER(sname, cname)(void *null, struct cut_case *case_data); \
static struct cut_case CUT_CASE_NAME(sname, cname) = \
{ \
#sname, #cname, NULL, (void(*)(void*,void*))CUT_CASE_RUNNER(sname, cname), NULL, NULL, 0}; \
static void CUT_CASE_RUNNER(sname, cname)(void *null, struct cut_case *case_data)
/*
* @brief: construct a test case structor and a test case runner
* with case_data/setup/teardown for each case.
* @sname: suite name
* @cname: case name
* e.g.
CASE_DATA(mysuite) {
int errmsg;
char *errcode;
};
CASE_SETUP(mysuite) {
data->errcode = 0;
data->errmsg = (char*)malloc(100);
}
CASE_TEARDOWN(mysuite) {
if(data->errmsg) {
free(data->errmsg);
data->errmsg = NULL;
}
}
CASEs(mysuite, mycase1) {
data->errcode = 1;
strcpy(data->errmsg, "timeout error");
ASSERT_TRUE(1);
}
*/
#define CASEs(sname, cname) \
static struct CUT_CASE_DATA(sname) CUT_CASE_DATA(sname); \
static void CUT_CASE_RUNNER(sname, cname)(struct CUT_CASE_DATA(sname) * data,struct cut_case *case_data); \
static struct cut_case CUT_CASE_NAME(sname, cname) = \
{ \
#sname, #cname, &CUT_CASE_DATA(sname), (void(*)(void*,void*))CUT_CASE_RUNNER(sname, cname), \
(void(*)(void*,void*))CUT_CASE_SETUP(sname), (void(*)(void*))CUT_CASE_TEARDOWN(sname), 0}; \
\
static void CUT_CASE_RUNNER(sname, cname)(struct CUT_CASE_DATA(sname) * data, struct cut_case *case_data)
/*
* @brief: construct a test suite by adding test case(s)
* @sname: suite name
* e.g.
SUITE(mysuite) = {
ADD_CASE(mysuite, mycase1),
ADD_CASE(mysuite, mycase2),
ADD_CASE_NULL
};
*/
#define SUITE(sname) struct cut_case *cut_suite_##sname[]
/*
* @brief: add a test case into a test suite
* @sname: suite name
* @cname: case name
*/
#define ADD_CASE(sname, cname) &CUT_CASE_NAME(sname, cname)
#define ADD_CASE_NULL (struct cut_case*)(NULL)
/*
* @brief: add a test suite into case list
* @sname: suite name
*/
#define ADD_SUITE(sname) \
do { \
int i = 0; \
extern struct cut_case *cut_suite_##sname[]; \
struct cut_case *c = cut_suite_##sname[i]; \
if (cut.ccnt_total >= CUT_CASE_MAX_CNT) { \
cut_printf("reaches maximum case count:%d\n", \
CUT_CASE_MAX_CNT); \
break; \
} \
while (c) { \
*(cut.clist + cut.ccnt_total++) = c; \
c = *(cut_suite_##sname + (++i)); \
} \
} while (0)
#define TRY if (0 == setjmp(cut.jmpbuf))
#define EXCEPT else
#define RAISE_EXCEPTION_WITH_MSG(msg) \
do { \
int ret = 0, i = cut.ccnt_fail; \
cut.cerrmsg[i] = (char*)cut_malloc(CUT_MSG_MAX_LEN); \
assert(cut.cerrmsg[i] != NULL); \
memset(cut.cerrmsg[i], 0, CUT_MSG_MAX_LEN); \
ret = cut_snprintf(cut.cerrmsg[i], \
CUT_MSG_MAX_LEN - 1, \
"%s.%s in %s(%d) expected %s", \
cut.ccur->sname, cut.ccur->cname, \
__FILE__, __LINE__, msg); \
if (ret >= CUT_MSG_MAX_LEN) \
cut_snprintf(cut.cerrmsg[i] + CUT_MSG_MAX_LEN - 4, \
4, "..."); \
longjmp(cut.jmpbuf, 1); \
} while (0)
#define ASSERT_TRUE(cond) \
do { \
if (!(cond)) \
RAISE_EXCEPTION_WITH_MSG("[True]"); \
} while (0)
#define ASSERT_INT(expected, compare, actual) \
do { \
if (!((expected)compare(actual))) \
RAISE_EXCEPTION_WITH_MSG("[" #expected " " #compare " " #actual "]"); \
} while (0)
#define ASSERT_STR(expected, compare, actual) \
do { \
if (!(strcmp((expected), (actual)) compare 0)) \
RAISE_EXCEPTION_WITH_MSG("[" #expected " " #compare " " #actual "]"); \
} while (0)
#define ASSERT_IN(expected1, actual, expected2) \
do { \
if ((actual) < (expected1) || (actual) > (expected2)) \
RAISE_EXCEPTION_WITH_MSG("[" #expected1 " <= " #actual " <= " #expected2 "]"); \
} while (0)
#define ASSERT_NSTR(expected, compare, actual, len) \
do { \
if (!(strncmp((expected), (actual), (len)) compare 0)) \
RAISE_EXCEPTION_WITH_MSG("[" #expected " " #compare " " #actual "]"); \
} while (0)
#define ASSERT_FAIL() RAISE_EXCEPTION_WITH_MSG("[should not be here]")
#define ASSERT_FALSE(cond) ASSERT_TRUE(!(cond))
#define ASSERT_NULL(ptr) ASSERT_INT(ptr, ==, NULL)
#define ASSERT_NOT_NULL(ptr) ASSERT_INT(ptr, !=, NULL)
#define ASSERT_EQ(actual, expected) ASSERT_INT(actual, ==, expected)
#define ASSERT_NE(actual, expected) ASSERT_INT(actual, !=, expected)
#define ASSERT_GT(actual, expected) ASSERT_INT(actual, >, expected)
#define ASSERT_GE(actual, expected) ASSERT_INT(actual, >=, expected)
#define ASSERT_LT(actual, expected) ASSERT_INT(actual, <, expected)
#define ASSERT_LE(actual, expected) ASSERT_INT(actual, <=, expected)
#define ASSERT_STR_EQ(actual, expected) ASSERT_STR(actual, ==, expected)
#define ASSERT_STR_NE(actual, expected) ASSERT_STR(actual, !=, expected)
#define ASSERT_STR_GT(actual, expected) ASSERT_STR(actual, >, expected)
#define ASSERT_STR_LT(actual, expected) ASSERT_STR(actual, <, expected)
#define ASSERT_NSTR_EQ(actual, expected, len) ASSERT_NSTR(actual, ==, expected, len)
#define ASSERT_NSTR_NE(actual, expected, len) ASSERT_NSTR(actual, !=, expected, len)
#define ASSERT_NSTR_GT(actual, expected, len) ASSERT_NSTR(actual, >, expected, len)
#define ASSERT_NSTR_LT(actual, expected, len) ASSERT_NSTR(actual, <, expected, len)
/*
* see http://stackoverflow.com/questions/3585846/color-text-in-terminal-applications-in-unix
*/
#define COL_DEF "\x1B[0m"
#define COL_RED "\x1B[1;31m"
#define COL_GRE "\x1B[1;32m"
#define COL_YEL "\x1B[1;33m"
#define COL_BLU "\x1B[1;34m"
#define COL_MAG "\x1B[1;35m"
#define COL_CYN "\x1B[1;36m"
#define COL_WHE "\x1B[1;37m"
#ifdef __cplusplus
}
#endif
#endif /* __CUT_H__ */

View File

@@ -0,0 +1,194 @@
#! /bin/bash
if [ "$(uname)" = "Darwin" ]; then
SED=gsed
else
SED=sed
fi
function Trace()
{
if [ "${VERBOSE_PRE_BLD}" != "" ]; then
echo "$1" 1>&2
fi
}
function Update_Sources()
{
if [ -f ${BLD_DIR}/${STAMP_UNPACK} ]; then
Trace "Skipped @ ${BLD_DIR}/${STAMP_UNPACK}"
return 0
fi
if [ "${PKG_SWITCH}" = "" ]; then
Trace "Warning @ CONFIG_${MODULE} = '${PKG_SWITCH}'"
fi
Trace "MODULE_NAME: [${MODULE}]"
Trace "SRC_DIR: [${SRC_DIR}]"
Trace "BLD_DIR: [${BLD_DIR}]"
Trace "PACKAGE_DIR: [${PACKAGE_DIR}]"
Trace "PKG_SOURCE: [${PKG_SOURCE}]"
Trace "PKG_BRANCH: [${PKG_BRANCH}]"
Trace "PKG_REVISION: [${PKG_REVISION}]"
Trace "PKG_UPSTREAM: [${PKG_UPSTREAM}]"
for i in $(find -L ${MODULE} -type d -not -path "*.git*"|${SED} "s,${MODULE}/*,,1"|${SED} '/^$/d'); do
mkdir -p ${BLD_DIR}/${i}
done
if [ "${PKG_SOURCE}" != "" ] && [ -d ${PACKAGE_DIR}/${PKG_SOURCE} ]; then
GIT_BASENAME=$(basename ${PKG_SOURCE})
GIT_NAME_LEN=$(echo -n "${GIT_BASENAME}"|wc -c|awk '{ print $1 }')
GIT_OFFSET=$(( GIT_NAME_LEN - 3 ))
GIT_MOD_NAME=$(echo "${GIT_BASENAME}" | cut -c"1-$(( GIT_OFFSET-1 ))"|awk '{ print $1 }')
GIT_POSTFIX=$(echo "${GIT_BASENAME}" | cut -c"${GIT_OFFSET}-${GIT_NAME_LEN}"|awk '{ print $1 }')
Trace "GIT_POSTFIX: [${GIT_POSTFIX}]"
Trace "GIT_MOD_NAME: [${GIT_MOD_NAME}]"
fi
set +x
if [ "${GIT_POSTFIX}" = ".git" ]; then
GIT_COPY=${MODULE}/${GIT_MOD_NAME}
DEV_COPY_BASE=${TOP_DIR}.pkgs
Trace "GIT_COPY: [${GIT_COPY}]"
Trace "DEV_COPY_BASE: [${DEV_COPY_BASE}]"
eval "${CMDSET_X}"
mkdir -p ${DEV_COPY_BASE}
cd ${DEV_COPY_BASE}
if [ ! -d ${GIT_MOD_NAME} ]; then
git clone ${OPTION_Q} ${PACKAGE_DIR}/${PKG_SOURCE} ${GIT_MOD_NAME} \
$([ "${PKG_BRANCH}" = "" ] || echo "-b ${PKG_BRANCH}")
if [ "${PKG_UPSTREAM}" != "" ]; then
cd ${GIT_MOD_NAME};
git remote add upstream ${PKG_UPSTREAM}
cd ${OLDPWD};
fi
fi
if [ "${PKG_REVISION}" != "" ]; then
cd ${GIT_MOD_NAME} && git reset ${OPTION_Q} --hard ${PKG_REVISION} && cd ${OLDPWD}
else
cd ${GIT_MOD_NAME}
git pull ${OPTION_Q} origin ${PKG_BRANCH} || exit 1
fi
cd ${TOP_DIR}
rm -fr ${SRC_DIR}/${GIT_MOD_NAME}
ln -sf ${DEV_COPY_BASE}/${GIT_MOD_NAME} ${SRC_DIR}/${GIT_MOD_NAME}
touch ${BLD_DIR}/${STAMP_UNPACK}
PKG_SOURCE=""
set +x
SRC_ELEM=$(ls ${SRC_DIR}|grep -v ${HD_MAKEFILE}|grep -v ${MAKE_SEGMENT})
BLD_ELEM=$(ls ${BLD_DIR}|grep -v ${HD_MAKEFILE}|grep -v ${MAKE_SEGMENT})
if [ "${BLD_ELEM}" = "" ]; then
for iter in ${SRC_ELEM}; do
Trace "Bulk [${SRC_DIR}/${iter} => ${BLD_DIR}"
# cp -Lrf ${SRC_DIR}/${iter} ${BLD_DIR}
done
return 0
fi
fi
# for FILE in \
# $(find -L ${SRC_DIR}/ -type f -o -type l -name "*.[ch]" -o -name "*.mk" -o -name "*.cpp") \
# $(find ${SRC_DIR}/ -maxdepth 1 -name "*.patch" -o -name "lib*.a" -o -name "lib*.so") \
# $([ "" != "${PKG_SOURCE}" ] && [ -d ${PACKAGE_DIR}/${PKG_SOURCE} ] && find ${PACKAGE_DIR}/${PKG_SOURCE}/ -type f -o -type l) \
# ; \
# do
# if [ "" != "${PKG_SOURCE}" ] && \
# [ -d ${PKG_SOURCE} ] && \
# [ "$(dirname ${FILE})" != "${TOP_DIR}/${MODULE}" ]; then
# SUBD=$(echo $(dirname ${FILE})|${SED} "s:$(dirname ${PKG_SOURCE})::")
# SUBD=$(echo ${SUBD}|${SED} "s:${SRC_DIR}::")
# else
# SUBD=$(echo $(dirname ${FILE})|${SED} "s:${SRC_DIR}::")
# SUBD=$(echo ${SUBD}|${SED} "s:${PACKAGE_DIR}/*::")
# fi
#
# COPY_DIR=${OUTPUT_DIR}/${MODULE}/${SUBD}
# mkdir -p ${COPY_DIR}
# COPY_BASE=$(basename ${FILE})
# FILE_COPY=${COPY_DIR}/${COPY_BASE}
# # grep -q "\.git" <<< ${FILE} || Trace "Check: ${FILE}: ${FILE_COPY}"
#
# if [ ! -e ${FILE_COPY} -o \
# ${FILE} -nt ${FILE_COPY} ]; then
# mkdir -p ${BLD_DIR}/${FILE_DIR}
# cp -f ${FILE} ${FILE_COPY}
# fi
# done
}
function Update_Makefile()
{
BLD_MFILE=${BLD_DIR}/${HD_MAKEFILE}
if [ ${BLD_MFILE} -nt ${SRC_DIR}/${MAKE_SEGMENT} ] && \
[ ${BLD_MFILE} -nt ${STAMP_BLD_ENV} ]; then
return 0;
fi
rm -f ${BLD_MFILE}
echo "MODULE_NAME := ${MODULE}" >> ${BLD_MFILE}
cat ${STAMP_BLD_ENV} >> ${BLD_MFILE}
cat << EOB >> ${BLD_MFILE}
include \$(RULE_DIR)/settings.mk
include \$(CONFIG_TPL)
all:
EOB
cp -f ${SRC_DIR}/${MAKE_SEGMENT} ${BLD_DIR}/${MAKE_SEGMENT}
cat ${BLD_DIR}/${MAKE_SEGMENT} >> ${BLD_MFILE}
${SED} -i 's/clean:/clean : clean-prepare/g' ${BLD_MFILE}
cat << EOB >> ${BLD_MFILE}
env:
@echo ""
@printf -- "-----------------------------------------------------------------\n"
@\$(foreach var,\$(SHOW_ENV_VARS),\$(call Dump_Var,\$(var)))
@printf -- "-----------------------------------------------------------------\n"
@echo ""
include \$(RULE_DIR)/rules.mk
EOB
Trace "Updated: ${BLD_MFILE}"
}
if [ "$#" != "1" -a "$#" != "2" ]; then exit 12; fi
MODULE=${1}
BLD_DIR=${OUTPUT_DIR}/${MODULE}
SRC_DIR=${TOP_DIR}/${MODULE}
if [ ! -d ${SRC_DIR} ]; then
exit 0
fi
if [ "${VERBOSE_PRE_BLD}" != "" ]; then
OPTION_V="-v"
CMDSET_X="set -x"
else
OPTION_Q="-q"
fi
mkdir -p ${BLD_DIR}
MSG=$(printf "%-28s%s" "${MODULE}" "[..]")
echo -ne "\r "
echo -ne "\033[0;37;0;44m""\r[..] o ${MSG}""\033[0;m"
Trace ""
if [ "$#" = "1" ]; then
Update_Sources
fi
Update_Makefile

View File

@@ -0,0 +1,197 @@
include $(RULE_DIR)/settings.mk
sinclude $(CONFIG_TPL)
export PATH := $(PATH):$(TOOLCHAIN_DLDIR)/main/bin
unexport VERBOSE
unexport DEBUG
TOPDIR_NAME := $(shell $(SHELL_DBG) basename $(TOP_DIR))
LIBOBJ_TMPDIR := $(OUTPUT_DIR)/lib$(TOPDIR_NAME).objs
SYSROOT_BIN := $(OUTPUT_DIR)${bindir}
SYSROOT_INC := $(OUTPUT_DIR)${incdir}
SYSROOT_LIB := $(OUTPUT_DIR)${libdir}
CONFIG_VENDOR := $(shell grep -m 1 "VENDOR *:" $(CONFIG_TPL) 2>/dev/null|awk '{ print $$NF }')
IMPORT_VDRDIR := $(IMPORT_DIR)/$(CONFIG_VENDOR)
HOST_ARCH_BITS := $(shell [ "$$(uname -m)" = "x86_64" ] && echo -n "64" || echo -n "32")
PREBUILT_LIBDIR := $(if $(strip $(filter 64,$(HOST_ARCH_BITS)) $(CROSS_PREFIX)),libs,32bit-libs)
PREBUILT_BINDIR := $(if $(strip $(filter 64,$(HOST_ARCH_BITS)) $(CROSS_PREFIX)),bin,32bit-bin)
CONFIG_VSP_WEBSITE ?= http://gitlab.alibaba-inc.com/yusheng.yx/alink-vendor-support-package
ifeq ($(shell uname), Linux)
RPATH_CFLAGS += -Wl,-rpath='$$''ORIGIN/../lib'
endif
# CFLAGS contains '$' causes ./configure failure in ORIGIN packages
#
# Instead of:
#
# ifeq ($(shell uname), Linux)
# CFLAGS += -Wl,-rpath='$$''ORIGIN/../lib'
# CFLAGS := $(sort $(CFLAGS))
# endif
#
# Write @ package's makefile:
#
# ./configure \
# CFLAGS='$(CFLAGS) -Wl,-rpath='\''$$$$'\''ORIGIN/../lib' \
# --prefix=...
#
# To pass in RPATH related link flags
COMP_LIB_NAME := $(subst lib,,$(subst .so,,$(subst .a,,$(COMP_LIB))))
COMP_LIB_OBJS = $(foreach d,$(COMP_LIB_COMPONENTS),$(LIBOBJ_TMPDIR)/$(d)/*.o)
RECURSIVE_MAKE := $(MAKE) $(if $(TOP_Q),-s) -C $(TOP_DIR) -f $(TOP_MAKEFILE)
ALL_SUB_DIRS := $(shell find -L $(TOP_DIR) \
! -path "$(OUTPUT_DIR)/*" \
! -path "$(TOP_DIR)/$(SHADOW_DIR)/*" \
-name "$(MAKE_SEGMENT)" 2>/dev/null \
| $(SED) 's,$(TOP_DIR)[/]*,,;s,[/]*$(MAKE_SEGMENT),,')
SHOW_ENV_VARS := \
MODULE_NAME SUBDIRS PKG_NAME PKG_RPATH PKG_SOURCE PKG_SWITCH_V PKG_SWITCH \
HOST_ARCH_BITS PREBUILT_LIBDIR RPATH_CFLAGS EXTRA_INCLUDE_DIRS \
CROSS_PREFIX DEPENDS CFLAGS CCLD LDFLAGS \
CC LD AR STRIP OBJCOPY COMP_LIB ALL_SUB_DIRS LIBOBJ_TMPDIR \
MAKE_ENV_VARS DEFAULT_BLD EXTRA_CFLAGS \
LIBA_TARGET LIBSO_TARGET TARGET KMOD_TARGET \
SRCS OBJS LIB_SRCS LIB_OBJS LIB_HDRS_DIR LIB_HEADERS EXTRA_SRCS \
$(foreach M,$(LIBA_TARGET),LIB_SRCS_$(subst .a,,$(subst lib,,$(M)))) \
INTERNAL_INCLUDES TOP_DIR PRJ_NAME PRJ_VERSION COMP_LIB_COMPONENTS \
IMPORT_DIR IMPORT_VDRDIR CONFIG_DIR PACKAGE_DIR EXTERNAL_INCLUDES \
CONFIG_LIB_EXPORT OBJCOPY_FLAGS CONFIG_VENDOR COVERAGE_PROGS COVERAGE_CMD \
INFO_ENV_VARS := $(SHOW_ENV_VARS) \
ALL_SUB_DIRS SED RULE_DIR OUTPUT_DIR MAKE_SEGMENT COMP_LIB_NAME LIBOBJ_TMPDIR \
COMP_LIB_FILES STAMP_BLD_ENV STAMP_BLD_VAR EXTRA_INSTALL_HDRS FINAL_DIR DIST_DIR \
WIN32_CMAKE_SKIP EXTRA_INCLUDE_DIRS NOEXEC_CMAKE_DIRS COMP_LIB \
WITH_LCOV LCOV_DIR UTEST_PROG COVERAGE_CMD STAMP_LCOV CMAKE_EXPORT_LIBS \
INFO_ENV_VARS := $(filter-out CFLAGS,$(INFO_ENV_VARS))
ifndef CONFIG_LIB_EXPORT
ifeq (y,$(strip $(CONFIG_EMB_GATEWAY_SDK)))
CONFIG_LIB_EXPORT := dynamic
else
ifeq (y,$(strip $(CONFIG_EMB_BASIC_SDK)))
CONFIG_LIB_EXPORT := static
else
ifeq (y,$(strip $(CONFIG_EMB_ROUTER_SDK)))
CONFIG_LIB_EXPORT := dynamic
endif # ROUTER
endif # BASIC
endif # GATEWAY
else
ifneq (static,$(CONFIG_LIB_EXPORT))
ifneq (dynamic,$(CONFIG_LIB_EXPORT))
$(error CONFIG_LIB_EXPORT($(CONFIG_LIB_EXPORT)) is neither 'static' or 'dynamic')
endif # dynamic
endif # static
endif # CONFIG_LIB_EXPORT
ifneq (,$(shell ls $(STAMP_BLD_VAR) 2>/dev/null))
ifeq (,$(filter reconfig distclean,$(MAKECMDGOALS)))
ifeq (0,$(strip $(shell $(SED) '/[-_/a-zA-Z0-9]* = *..*/d' $(STAMP_BLD_VAR)|wc -l)))
include $(STAMP_BLD_VAR)
endif
endif
endif
.PHONY: all clean FORCE
ifdef SUBDIRS
include $(RULE_DIR)/_rules-top.mk
include $(RULE_DIR)/_rules-prefix.mk
include $(RULE_DIR)/_rules-repo.mk
CROSS_CANDIDATES := CC CXX AR LD STRIP OBJCOPY
export CC := $(strip $(if $(OVERRIDE_CC), $(OVERRIDE_CC), $(CROSS_PREFIX)gcc))
export CXX := $(strip $(if $(OVERRIDE_CXX), $(OVERRIDE_CXX), $(CROSS_PREFIX)g++))
export AR := $(strip $(if $(OVERRIDE_AR), $(OVERRIDE_AR), $(CROSS_PREFIX)ar))
export LD := $(strip $(if $(OVERRIDE_LD), $(OVERRIDE_LD), $(CROSS_PREFIX)ld))
export OBJCOPY := $(strip $(if $(OVERRIDE_OBJCOPY),$(OVERRIDE_OBJCOPY),$(CROSS_PREFIX)objcopy))
ifneq (,$(OVERRIDE_STRIP))
export STRIP := $(OVERRIDE_STRIP)
else
ifneq (,$(CROSS_PREFIX))
export STRIP := $(CROSS_PREFIX)strip
else
export STRIP := true
endif
endif
ifeq (gcc,$(strip $(CC)))
export STRIP := strip
endif
ifneq (y,$(shell which $(CC) > /dev/null 2>&1 && echo 'y'))
LOCAL_TCDIR := $(TOOLCHAIN_DLDIR)/$(shell $(call Relative_TcPath,$(CC)))
export CC := $(LOCAL_TCDIR)/$(CC)
export AR := $(LOCAL_TCDIR)/$(AR)
export LD := $(LOCAL_TCDIR)/$(LD)
export OBJCOPY := $(LOCAL_TCDIR)/$(OBJCOPY)
export STRIP := $(LOCAL_TCDIR)/$(STRIP)
endif
ifneq (,$(filter -m32,$(strip $(CFLAGS))))
PREBUILT_LIBDIR := 32bit-libs
PREBUILT_BINDIR := 32bit-bin
endif
include $(RULE_DIR)/_rules-dist.mk
include $(RULE_DIR)/_rules-complib.mk
include $(RULE_DIR)/_rules-submods.mk
env:
$(TOP_Q)echo ""
$(TOP_Q)printf -- "-----------------------------------------------------------------\n"
$(TOP_Q)$(foreach var,$(SHOW_ENV_VARS),$(call Dump_Var,$(var)))
$(TOP_Q)printf -- "-----------------------------------------------------------------\n"
$(TOP_Q)echo ""
$(TOP_Q)$(call $(POST_ENV_HOOK))
else # ifdef SUBDIRS
PKG_RPATH := $(shell echo $(CURDIR)|$(SED) 's,$(OUTPUT_DIR)/*,,g')
PKG_NAME ?= $(shell basename $(CURDIR))
PKG_SOURCE ?= $(shell [ -d $(PACKAGE_DIR) ] && find $(PACKAGE_DIR) -name "$(PKG_NAME)*" | head -1)
DEPENDS += $(DEPENDS_$(MODULE_NAME))
DEPENDS := $(sort $(strip $(DEPENDS)))
ifdef CONFIG_SWITCH
PKG_SWITCH_V = $(CONFIG_SWITCH)
else
PKG_SWITCH_V := CONFIG_$(PKG_RPATH)
endif
PKG_SWITCH = $($(PKG_SWITCH_V))
ifdef ORIGIN
include $(RULE_DIR)/_rules-origin.mk
else # ifdef ORIGIN
ifneq (,$(filter -m32,$(strip $(CFLAGS))))
PREBUILT_LIBDIR := 32bit-libs
PREBUILT_BINDIR := 32bit-bin
endif
include $(RULE_DIR)/_rules-flat.mk
endif # ifdef ORIGIN
include $(RULE_DIR)/_rules-modinfo.mk
endif # ifdef SUBDIRS
sinclude $(STAMP_POST_RULE)
ifdef UTEST_PROG
COVERAGE_LIST += \"./$(strip $(UTEST_PROG) --list)\"
COVERAGE_LIST += \"./$(strip $(UTEST_PROG) --verbose=4)\"
include $(RULE_DIR)/_rules-coverage.mk
endif

View File

@@ -0,0 +1,40 @@
#! /bin/bash
TEXT=(
"Copyright (c) 2014-2016 Alibaba Group. All rights reserved."
"License-Identifier: Apache-2.0"
""
"Licensed under the Apache License, Version 2.0 (the \"License\"); you may"
"not use this file except in compliance with the License."
"You may obtain a copy of the License at"
""
"http://www.apache.org/licenses/LICENSE-2.0"
""
"Unless required by applicable law or agreed to in writing, software"
"distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT"
"WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied."
"See the License for the specific language governing permissions and"
"limitations under the License."
""
)
TOTAL_LINE=${#TEXT[@]}
i=$(( TOTAL_LINE - 1 ))
sed -i "1i\ */" $1
while (( i >= 0 )); do
j=$(eval echo '${TEXT['$i']}')
if [ "$j" = "" ]; then
sed -i "1i\ *" $1
else
if [ "$(echo $j|awk '{ print NF }')" = "1" ] && [ "$(echo $j | cut -c1-7)" = "http://" ]; then
sed -i "1i\ * $j" $1
else
sed -i "1i\ * $j" $1
fi
fi
i=$(( i - 1 ))
done
sed -i "1i\/*" $1

View File

@@ -0,0 +1,10 @@
#! /bin/bash
START_LINE=$(head -3 $1|grep -n '^ *\/\*'|cut -d':' -f1)
END_LINE=$(grep -m 1 -n '^ *\*\/' $1|cut -d':' -f1)
echo "[${START_LINE},${END_LINE}]"
if [ "${START_LINE}" != "" ] && [ "${END_LINE}" != "" ]; then
sed -i "${START_LINE},${END_LINE}d" $1
echo "LICENSE REMOVED: $1"
fi

View File

@@ -0,0 +1,25 @@
#! /bin/bash
set -e
if [ "${OUTPUT_DIR}" = "" ] || [ ! -d ${OUTPUT_DIR} ]; then exit 1; fi
cd ${OUTPUT_DIR}/usr/bin
echo ""
iter=0
while (( iter < ${#PROGS[@]} )); do
UT_CMD=$(eval echo '${PROGS['${iter}']}')
UT_PROG=$(echo ${UT_CMD}|cut -d' ' -f1)
echo "[${iter}] RUNNING '${UT_CMD}' with '${UT_PROG}'"|grep --color ".*"
echo ""
if [ -f ${UT_PROG} ]; then
${UT_CMD}
else
echo "${UT_CMD} SPECIFIED BUT ${UT_PROG} NOT FOUND"|grep --color ".*"
fi
iter=$(( iter + 1 ))
done

View File

@@ -0,0 +1,62 @@
#! /bin/bash
procing() {
trap 'exit 0;' 6
while :; do
for j in '-' '\\' '|' '/'; do
tput sc
echo -ne "[$j]"
sleep 0.1
tput rc
done
done
}
waiting() {
local pid="$1"
echo -ne "\033[1;32m"
echo -n "$2 .................... "
procing &
local tmppid="$!"
wait $pid
tput rc
echo "done"
echo -ne "\033[0m"
echo ""
kill -6 $tmppid >/dev/null 1>&2
}
GIT_PREFIX="https://gitee.com/alios-things"
LOCAL_CC=${TOOLCHAIN_DLDIR}/${RELPATH}/${CC}
LOCAL_AR=${TOOLCHAIN_DLDIR}/${RELPATH}/${AR}
# echo "[RELPATH]: ${RELPATH}"
# echo "[GITPATH]: ${GITPATH}"
which ${CC} > /dev/null 2>&1
if [ $? != 0 ] && [ ! -f ${LOCAL_CC} ]; then
if [ "${GITPATH}" = "" ]; then
echo "Unable to find available toolchain of [${CC}] from local ENV or Internet. Abort!" | grep --color ".*"
echo ""
exit 1
fi
echo -n "${GIT_PREFIX}/${GITPATH} -> "
echo -n "$(basename ${OUTPUT_DIR})/$(basename ${TOOLCHAIN_DLDIR})/"
echo "$(dirname ${RELPATH})"
echo "---"
mkdir -p ${TOOLCHAIN_DLDIR}
cd ${TOOLCHAIN_DLDIR}
git clone -q ${GIT_PREFIX}/${GITPATH} &
waiting "$!" "downloading toolchain for ${CC}"
cd ${OLDPWD}
fi

View File

@@ -0,0 +1,108 @@
#! /bin/bash
set -e
if [ "$(uname)" = "Darwin" ]; then
SED=gsed
else
SED=sed
fi
rm -rf ${OUTPUT_DIR}/${LCOV_DIR} ${DIST_DIR}/${LCOV_DIR}
lcov --quiet \
--capture --initial --directory ${OUTPUT_DIR}/ \
-o ${OUTPUT_DIR}/files.info
lcov --quiet \
--capture --directory ${OUTPUT_DIR} \
-o ${OUTPUT_DIR}/tests.info
lcov --quiet \
--add-tracefile ${OUTPUT_DIR}/files.info \
--add-tracefile ${OUTPUT_DIR}/tests.info \
-o ${OUTPUT_DIR}/all.info
lcov --quiet \
--remove ${OUTPUT_DIR}/all.info \
-o ${OUTPUT_DIR}/final.info '*.h'
genhtml --quiet \
--legend --no-branch-coverage \
-o ${OUTPUT_DIR}/${LCOV_DIR} ${OUTPUT_DIR}/final.info 2>/dev/null
cp -rf ${OUTPUT_DIR}/${LCOV_DIR} ${DIST_DIR}/${LCOV_DIR}
cd ${DIST_DIR}/${LCOV_DIR} && \
${SED} -i 's:\(coverFile.*\)>${OUTPUT_DIR}/:\1>:g' index.html
cd ${OLDPWD}
SRC_NAME_LENGTH=28
DIR_NAME_LENGTH=16
COVERAGE_HIGH=90
COVERAGE_MID=75
echo ""
echo "Processing [${DIST_DIR}/${LCOV_DIR}] for Coverage Brief"
echo ""
#
# sdk-example / example.c : [100.00%] (7/7) [100.00%] (1/1)
#
echo -ne "\033[1;36m"
printf "%${DIR_NAME_LENGTH}s %-${SRC_NAME_LENGTH}s: %-24s %-20s\n\n" \
"Directory" \
"Source File" \
"Line Coverage" \
"Function Coverage"
echo -ne "\033[0m"
REPORT_LIST=$(find ${DIST_DIR}/${LCOV_DIR} -mindepth 2 -name "index.html")
for R in ${REPORT_LIST}; do
SOURCE_LIST=$(grep "coverFile" ${R} | awk -F '<' '{ print $3 }' | cut -d'>' -f2)
for S in ${SOURCE_LIST}; do
STATS=$(grep -A 7 "${S}</a>" ${R} | ${SED} -n '6p;8p'|grep -o -E '[0-9]+')
DIR_NAME=$(echo "$(dirname ${R}|xargs basename)" | cut -c1-15)
SRC_NAME=$(echo "${S}" | cut -c"1-$(( SRC_NAME_LENGTH -1 ))")
COVER_LINE=$(echo ${STATS}|cut -d' ' -f1)
TOTAL_LINE=$(echo ${STATS}|cut -d' ' -f2)
COVER_FUNC=$(echo ${STATS}|cut -d' ' -f3)
TOTAL_FUNC=$(echo ${STATS}|cut -d' ' -f4)
LINE_PERCENT="$(echo "scale=2; ${COVER_LINE} * 100 / ${TOTAL_LINE}"|bc -l)%"
FUNC_PERCENT="$(echo "scale=2; ${COVER_FUNC} * 100 / ${TOTAL_FUNC}"|bc -l)%"
printf \
"%-8s %${DIR_NAME_LENGTH}s / %-${SRC_NAME_LENGTH}s: [ %s ] (%s/%s) \t [ %s ] (%s/%s)\n" \
${LINE_PERCENT} \
${DIR_NAME} \
${SRC_NAME} \
${LINE_PERCENT} \
${COVER_LINE} \
${TOTAL_LINE} \
${FUNC_PERCENT} \
${COVER_FUNC} \
${TOTAL_FUNC}
done
done \
| sort -nr \
| cut -d' ' -f2- \
| awk -v SRC_LEN=${SRC_NAME_LENGTH} -v DIR_LEN=${DIR_NAME_LENGTH} \
-v HIGH=${COVERAGE_HIGH} -v MID=${COVERAGE_MID} \
'{
split($6, arr, ".");
if (arr[1] >= HIGH)
printf("\033[1;32m");
else if (arr[1] >= MID)
printf("\033[1;35m");
else
printf("\033[1;31m");
printf("%" DIR_LEN "s / %-" SRC_LEN "s: [ %-8s] %-12s [ %-8s] %-12s\n",
$1, $3, $6, $8, $10, $12);
}'
#
# 1 2 3 4 5 6 7 8 9 10 11 12
# sdk-example / example.c : [ 100.00% ] (7/7) [ 100.00% ] (1/1)
#
rm -f ${OUTPUT_DIR}/{files,tests,all,final}.info
find ${OUTPUT_DIR} -name "*.gcno" -o -name "*.gcda" -exec rm -f {} \;
echo ""
exit 0

View File

@@ -0,0 +1,207 @@
#! /bin/bash
TARGET_FILE=${OUTPUT_DIR}/.one_makefile
rm -f ${TARGET_FILE}
CONFIG_VERNDOR=$(grep -m 1 "VENDOR *:" .config|awk '{ print $NF }')
EXT_IFLAGS=$( \
for iter in \
$(find -L \
tools/build-rules/misc \
include \
tests \
src \
${IMPORT_DIR}/${CONFIG_VENDOR}/include \
-type d -not -path "*.git*" -not -path "*.O*" 2>/dev/null); do \
echo " -I${iter} \\"; \
done)
IFLAGS=$( \
for iter in \
$(find -L \
${COMP_LIB_COMPONENTS} \
${EXPORT_DIR} \
${SUBDIRS} \
${EXTRA_INCLUDE_DIRS} \
${IMPORT_DIR}/${CONFIG_VENDOR}/include \
-type d -not -path "*.git*" -not -path "*.O*" 2>/dev/null); do \
echo " -I${iter} \\"; \
done)
if [ "${WITH_LCOV}" = "1" ]; then
CFLAGS=$( \
echo "${CFLAGS}" \
| xargs -n 1 \
| awk '{ printf(" %s \\\n", $0); }' \
)
else
CFLAGS=$( \
echo "${CFLAGS}" \
| xargs -n 1 \
| grep -v '\-\-coverage' \
| awk '{ printf(" %s \\\n", $0); }' \
)
fi
ETC_OBJS=$(
for i in ${ALL_LIBS}; do
j=$(grep "${i}$" ${STAMP_BLD_VAR} | cut -d' ' -f1 | sed 's|LIBA_TARGET_|LIB_OBJS_|g')
k=$(grep "${j}" ${STAMP_BLD_VAR} | cut -d' ' -f3-)
for l in ${k}; do
echo "${j//LIB_OBJS_/}/${l}"
done
done)
ALL_LIBS=$(for iter in ${ALL_LIBS}; do echo -n "${OUTPUT_DIR}/usr/lib/${iter} "; done)
ALL_BINS=$(for iter in ${ALL_PROG}; do echo -n "${OUTPUT_DIR}/usr/bin/${iter} "; done)
OUTPUT_D=$(basename ${OUTPUT_DIR})
if [ "$(echo ${CFLAGS}|grep -w '\-D_PLATFORM_IS_LINUX_')" = "" ]; then
ALL_BINS=""
fi
cat << EOB >> ${TARGET_FILE}
include ${RULE_DIR}/funcs.mk
SHELL := bash
Q ?= @
VPATH := $(for iter in ${COMP_LIB_COMPONENTS}; do echo -n "${OUTPUT_DIR}/${iter} "; done)
EXT_IFLAGS := \\
${EXT_IFLAGS}
IFLAGS := \\
${IFLAGS}
CFLAGS := \\
${EXTRA_CFLAGS} \\
${CFLAGS}
STAMP_LCOV := ${STAMP_LCOV}
.PHONY: all
all: ${OUTPUT_DIR}/usr/lib/${COMP_LIB} ${ALL_LIBS} ${ALL_BINS}
\$(Q)cp -rf ${EXTRA_INSTALL_HDRS} ${OUTPUT_DIR}/usr/include 2>/dev/null || true
@rm -f *.gcda *.gcno \$\$(find ${RULE_DIR} -name "*.o")
@if [ "\$(WITH_LCOV)" = "1" ]; then \\
mkdir -p \$\$(dirname \$(STAMP_LCOV)); \\
touch \$(STAMP_LCOV); \\
else \\
rm -f \$(STAMP_LCOV); \\
fi
ifneq (,\$(findstring gcc,\$(CC)))
$(for iter in ${COMP_LIB_OBJS}; do
echo "sinclude ${OUTPUT_DIR}/${iter/.o/.d}"
done
)
endif
${OUTPUT_DIR}/usr/lib/${COMP_LIB}: \\
$(for iter in ${COMP_LIB_OBJS}; do
echo " ${OUTPUT_DIR}/${iter} \\"
done
)
\$(Q)mkdir -p \$\$(dirname \$@)
\$(Q)\$(call Brief_Log,"AR",\$\$(basename \$@),"...")
\$(Q)${AR} -rcs \$@ \$^ 2>/dev/null
%.o:
\$(Q)\$(call Brief_Log,"CC",\$\$(basename \$@),"...")
\$(Q)mkdir -p \$\$(dirname \$@)
\$(Q)S=\$\$(echo \$@|sed 's,${OUTPUT_DIR},${TOP_DIR},1'); \\
if echo \$\${S//.o/.c} | grep -q 'mbedtls\|HAL_\|hal-impl'; then \\
${CC} -c \\
-o \$@ \\
\$(filter-out -ansi,\$(CFLAGS)) \\
\$(IFLAGS) \\
\$\${S//.o/.c}; \\
else \\
${CC} -c \\
-o \$@ \\
\$(CFLAGS) \\
\$(IFLAGS) \\
\$\${S//.o/.c}; \\
fi
ifneq (,\$(findstring gcc,\$(CC)))
%.d:
@\\
( \\
D=\$\$(dirname \$@|sed 's,${OUTPUT_DIR},${TOP_DIR},1'); \\
F=\$\$(basename \$@); \\
F=\$\${F/.d/.c}; \\
mkdir -p \$\$(dirname \$@); \\
${CC} -MM -I\$(CURDIR) \\
\$(IFLAGS) \\
\$(filter-out -ansi,\$(CFLAGS)) \\
\$\${D}/\$\${F} > \$@.\$\$\$\$; \\
sed -i 's!\$(shell basename \$*)\.o[ :]!\$*.o:!1' \$@.\$\$\$\$; \\
mv \$@.\$\$\$\$ \$@; \\
)
endif
EOB
for i in ${ALL_LIBS}; do
n=$(basename ${i})
j=$(grep "${n}$" ${STAMP_BLD_VAR}|cut -d' ' -f1|sed 's:LIBA_TARGET_::1')
k=$(echo 'LIB_OBJS_'"${j}")
k=$(grep -m 1 "^${k}" ${STAMP_BLD_VAR}|cut -d' ' -f3-)
k=$(for l in ${k}; do echo -n "${OUTPUT_DIR}/${j}/${l} "; done)
for m in ${k}; do
echo "sinclude ${m/.o/.d}" >> ${TARGET_FILE}
done
echo "" >> ${TARGET_FILE}
cat << EOB >> ${TARGET_FILE}
${OUTPUT_DIR}/usr/lib/${n}: \\
$(for m in ${k}; do
echo " ${m} \\";
done)
\$(Q)mkdir -p \$\$(dirname \$@)
\$(Q)\$(call Brief_Log,"AR",\$\$(basename \$@),"...")
\$(Q)${AR} -rcs \$@ \$^ 2>/dev/null
EOB
done
for i in ${ALL_PROG}; do
j=$(grep -w -m 1 "^SRCS_${i}" ${STAMP_BLD_VAR}|cut -d' ' -f3-)
k=$(grep -w -m 1 "TARGET_.* = .*${i}" ${STAMP_BLD_VAR}|cut -d' ' -f1|sed 's:TARGET_::1')
q=${k}
if [ "$(grep -w -m 1 "^TARGET_${k}" ${STAMP_BLD_VAR}|cut -d' ' -f3-|awk '{ print NF }')" = "1" ]; then
k=""
fi
LFLAGS=$(grep -w -m 1 "^LDFLAGS_${q}" ${STAMP_BLD_VAR}|cut -d' ' -f3-)
if [ "${CC}" = "gcc" ]; then
if [ "$(uname)" != "Darwin" ]; then
LFLAGS="${LFLAGS} -lgcov"
fi
fi
j=$(for n in ${j}; do p=$(echo ${n}|cut -c1); [ "${p}" = "/" ] && echo -n "${n}" || echo -n "${TOP_DIR}/${q}/${n} "; done)
EXTRA_SRCS=$(grep -w -m 1 "^EXTRA_SRCS_${q}" ${STAMP_BLD_VAR}|cut -d' ' -f3-)
cat << EOB >> ${TARGET_FILE}
${OUTPUT_DIR}/usr/bin/${i}: \\
${EXTRA_SRCS} \\
$(for m in ${j} ${OUTPUT_DIR}/usr/lib/${COMP_LIB} ${ALL_LIBS}; do
echo " ${m} \\"|sed 's!//*!/!g';
done)
\$(Q)\$(call Brief_Log,"LD",\$\$(basename \$@),"...")
\$(Q)${CC} \\
-o \$@ \\
$([ "$i" != "sdk-testsuites" ] && echo "\$(IFLAGS)" || echo "\$(EXT_IFLAGS)") \\
\$(filter-out -Wdeclaration-after-statement -ansi,\$(CFLAGS)) \\
\$(filter-out %.a,\$^) \\
$( if [ "${i}" = "sdk-testsuites" ] && uname -a|grep -qw Ubuntu; then echo "${TOP_DIR}/${IMPORT_VDRDIR}/${PREBUILT_LIBDIR}/libcurl.a"; fi ) \\
-L${OUTPUT_DIR}/usr/lib \\
${LFLAGS} $( if [ "${i}" = "sdk-testsuites" ] && ! uname -a|grep -qw Ubuntu; then echo "-lcurl"; fi )
EOB
done

View File

@@ -0,0 +1,133 @@
#! /bin/bash
#echo "COMP_LIB = ${COMP_LIB}"
#echo "STRIP = ${STRIP}"
bash ${TOP_DIR}/extract.sh test
cd ${DIST_DIR}/eng
cp -rf wrappers/wrappers_defs.h infra/*.h ${FINAL_DIR}/include
echo "Selected functions:"
echo ""
for iter in $(ls|grep -v 'wrappers\|infra'); do
echo " . [${iter}]"
cp -f ${iter}/*_api.h ${FINAL_DIR}/include 2>/dev/null
cp -f ${iter}/*_wrapper.h ${FINAL_DIR}/include 2>/dev/null
done
cd ${OLDPWD}
echo ""
printf " | %-5s | %-35s | %14s | %26s |\n" "RATE" "OBJ NAME" "BYTES/TOTAL" "MODULE NAME"
for iter in ${ALL_SUB_DIRS}; do
[ ! -d ${LIBOBJ_TMPDIR}/${iter} ] && continue
cd ${LIBOBJ_TMPDIR}/${iter}
ITER_OBJS=$(find . -name "*.o")
[ "${ITER_OBJS}" != "" ] || continue
${STRIP} ${ITER_OBJS} 2>/dev/null
ITER_SIZE=$(size ${ITER_OBJS} | ${SED} '1d' | awk '{ sum += $1 } END { print sum }')
[ "${ITER_SIZE}" != "0" ] && \
printf " |-%-.5s-|-%-.35s-|-%.14s-|-%.26s-|\n" \
"-----------------------------------------" \
"-----------------------------------------" \
"-----------------------------------------" \
"-----------------------------------------"
for j in ${ITER_OBJS}; do
size $j | ${SED} '1d' \
| awk -v sum="${ITER_SIZE}" \
-v mod="${iter}" \
-v obj="$(basename ${j})" \
'{ if ($1 != 0) printf("%d %.4s%% %s %-d/%d %s\n", $1, ($1/sum)*100, obj, $1, sum, mod); }'
done \
| sort -nr \
| cut -d' ' -f2- \
| awk '{ printf(" | %-5s | %-35s | %14s | %26s |\n", $1, $2, $3, $4); }'
cd ${OLDPWD}
done
echo ""
echo ""
echo ""
printf " | %-5s | %-35s | %-9s | %-9s | %-10s | %-6s |\n" \
"RATE" "MODULE NAME" "ROM" "RAM" "BSS" "DATA"
printf " |-%-.5s-|-%-.35s-|-%-.9s-|-%-.9s-|-%-.10s-|-%-.6s-|\n" \
"-------------" \
"--------------------------------------------" \
"-------------" \
"-------------" \
"-------------" \
"-------------"
cd ${LIBOBJ_TMPDIR}
TOTAL_ROM=$(find $(for i in ${COMP_LIB_COMPONENTS}; do echo "${OUTPUT_DIR}/${i}"; done) -name "*.o" 2>/dev/null \
| xargs size \
| awk '{ sum += $1 } END { print sum }')
cd ${OLDPWD}
for iter in ${COMP_LIB_COMPONENTS}; do
[ ! -d ${LIBOBJ_TMPDIR}/${iter} ] && continue
cd ${LIBOBJ_TMPDIR}/${iter}
ITER_OBJS=$(find . -name "*.o")
[ "${ITER_OBJS}" != "" ] || continue
${STRIP} ${ITER_OBJS} 2>/dev/null
size ${ITER_OBJS} | ${SED} '1d' \
| awk -v name=${iter} -v total_rom=${TOTAL_ROM} '
BEGIN { sum_rom = sum_ram = sum_bss = sum_data = 0 }
{
sum_rom += $1 + $2;
sum_ram += $2 + $3;
sum_bss += $3;
sum_data += $2;
}
END {
rate = sum_rom / total_rom * 100;
printf("%d | %.4s%% | %-35s | %-9s | %-9s | %-10s | %-6s |\n",
sum_rom,
rate,
name,
sum_rom,
sum_ram,
sum_bss,
sum_data);
}
'
cd ${OLDPWD}
done \
| sort -nr \
| cut -d' ' -f2- \
| ${SED} 's!.*! &!g' \
| awk -v total_rom=${TOTAL_ROM} '
BEGIN { sum_rom = sum_ram = sum_bss = sum_data = 0 }
{
sum_rom += $6;
sum_ram += $8;
sum_bss += $10;
sum_data += $12;
print;
}
END {
rate = sum_rom / total_rom * 100;
printf(" |-------|-------------------------------------|-----------|-----------|------------|--------|\n");
if (rate < 100)
printf(" | %.4s%% | %-35s | %-9s | %-9s | %-10s | %-6s |\n", rate, "- IN TOTAL -", sum_rom, sum_ram, sum_bss, sum_data);
else
printf(" | %.3s%% | %-35s | %-9s | %-9s | %-10s | %-6s |\n", rate, "- IN TOTAL -", sum_rom, sum_ram, sum_bss, sum_data);
}
'
echo ""

View File

@@ -0,0 +1,120 @@
#! /bin/bash
TARGET_FILE=$1
SRC_LIST=$(for i in ${LIB_SRCS}; do
echo ${i}|${SED} "s:${TOP_DIR}: \${PROJECT_SOURCE_DIR}:g"
done)
DIR_LIST=$(for i in ${LIB_SRCS}; do
dirname ${i}|sed "s:${TOP_DIR}/*::g"
done|sort -u)
MOD_NAME=$(echo ${MODULE_NAME}|sed 's:/:_:g')
rm -f ${TARGET_FILE}
cat << EOB >> ${TARGET_FILE}
$(for i in ${INTERNAL_INCLUDES} ${EXTERNAL_INCLUDES}; do
if grep -q "$(basename ${OUTPUT_DIR})/usr/include" <<< "${i}"; then
continue;
fi
echo $i \
| ${SED} "s:-I${TOP_DIR}\(.*\):INCLUDE_DIRECTORIES (\${PROJECT_SOURCE_DIR}\1):g"
done)
EOB
if echo ${CMAKE_EXPORT_LIBS} | grep -qw ${MODULE_NAME}; then
TYPE="SHARED"
else
TYPE="OBJECT"
fi
if [ "${LIBA_TARGET}" != "" ]; then
LNAME=${LIBA_TARGET#lib}
LNAME=${LNAME%.a}
cat << EOB >> ${TARGET_FILE}
FILE (GLOB ${MOD_NAME}_SRCS
$(for i in ${DIR_LIST}; do echo " \${PROJECT_SOURCE_DIR}/${i}/*.c"; done)
)
ADD_LIBRARY (${LNAME} ${TYPE}
\${${MOD_NAME}_SRCS}
\${EXTRA_C_SOURCES}
)
EOB
fi
#
# We do NOT compose ADD_TARGET and TARGET_LINK_LIBRARY segment for those
#
if grep -qw "${MODULE_NAME}" <<< "${NOEXEC_CMAKE_DIRS}"; then
exit 0
fi
TARGET_COUNT=$(echo "${TARGET}" | awk '{ print NF }')
if (( TARGET_COUNT == 1 )); then
if grep -qw ${TARGET} <<< ${WIN32_CMAKE_SKIP}; then
echo "IF (NOT WIN32)" >> ${TARGET_FILE}
fi
cat << EOB >> ${TARGET_FILE}
ADD_EXECUTABLE (${TARGET}
$(for i in ${SRCS}; do
echo ${i} | ${SED} "s:${TOP_DIR}: \${PROJECT_SOURCE_DIR}:g"
done)
)
$(for i in \
$(echo ${LDFLAGS} | grep -o '\-l[^ ]*' | sort -u | sed 's:^-l::g'); do
if [ "${i}" = "pthread" -o "${i}" = "rt" ]; then echo "IF (NOT MSVC)"; fi
echo "TARGET_LINK_LIBRARIES (${TARGET} ${i})"
if [ "${i}" = "pthread" -o "${i}" = "rt" ]; then echo "ENDIF (NOT MSVC)"; fi
done)
EOB
if grep -qw ${TARGET} <<< ${WIN32_CMAKE_SKIP}; then
echo "ENDIF (NOT WIN32)" >> ${TARGET_FILE}
fi
echo "" >> ${TARGET_FILE}
fi
if (( TARGET_COUNT > 1 )); then
cat << EOB >> ${TARGET_FILE}
$(for i in ${TARGET}; do
if echo ${WIN32_CMAKE_SKIP} | grep -qw ${i}; then
echo "IF (NOT WIN32)"
fi
echo "ADD_EXECUTABLE (${i}"
j=${i//-/_}
k=$(eval echo '${''SRCS_'"${j}"'}')
for v in ${k}; do
echo " ${v}"
done
echo ")"
if echo ${WIN32_CMAKE_SKIP} | grep -qw ${i}; then
echo "ENDIF (NOT WIN32)"
fi
done)
$(for i in ${TARGET}; do
if echo ${WIN32_CMAKE_SKIP} | grep -qw ${i}; then
echo "IF (NOT WIN32)"
fi
echo "TARGET_LINK_LIBRARIES (${i} ${COMP_LIB_NAME})"
for j in $(echo ${LDFLAGS} | grep -o '\-l[^ ]*' | sort -u | sed 's:^-l::g' | grep -vw ${COMP_LIB_NAME}); do
if [ "${j}" = "pthread" -o "${j}" = "rt" ]; then echo "IF (NOT MSVC)"; fi
echo "TARGET_LINK_LIBRARIES (${i} ${j})"
if [ "${j}" = "pthread" -o "${j}" = "rt" ]; then echo "ENDIF (NOT MSVC)"; fi
done
if echo ${WIN32_CMAKE_SKIP} | grep -qw ${i}; then
echo "ENDIF (NOT WIN32)"
fi
echo ""
done)
SET (EXECUTABLE_OUTPUT_PATH ../out)
EOB
fi

View File

@@ -0,0 +1,116 @@
#! /bin/bash
TARGET_FILE=$1
PKG_RPATH=$(echo ${PACKAGE_DIR}|${SED} "s:${TOP_DIR}/*::g")
W32_LIBSD=$(echo ${IMPORT_DIR}/win7/${PREBUILT_LIBDIR}|${SED} "s:${TOP_DIR}/*::g")
rm -f ${TARGET_FILE}
ALL_CFLAGS="$(grep -m 1 '^CFLAGS\>' ${STAMP_BLD_ENV}|cut -d' ' -f3-)"
REM_CFLAGS=""
DEF_CFLAGS=""
for i in ${ALL_CFLAGS}; do
j=$(echo ${i}|cut -c1,2)
if [ "${j}" = "-D" ]; then
DEF_CFLAGS="${DEF_CFLAGS} ${i}"
else
REM_CFLAGS="${REM_CFLAGS} ${i}"
fi
done
cat << EOB >> ${TARGET_FILE}
if(\${CMAKE_SOURCE_DIR} STREQUAL \${CMAKE_BINARY_DIR})
MESSAGE (FATAL_ERROR "in-tree build not allowded")
endif(\${CMAKE_SOURCE_DIR} STREQUAL \${CMAKE_BINARY_DIR})
CMAKE_MINIMUM_REQUIRED (VERSION 2.8)
PROJECT (${PRJ_NAME}-${PRJ_VERSION} C)
SET (EXECUTABLE_OUTPUT_PATH \${PROJECT_BINARY_DIR}/bin)
SET (LIBRARY_OUTPUT_PATH \${PROJECT_BINARY_DIR}/lib)
SET (CMAKE_C_FLAGS "${REM_CFLAGS} -fPIC")
IF (WIN32)
SET (CMAKE_EXE_LINKER_FLAGS "-L\${PROJECT_SOURCE_DIR}/${W32_LIBSD}")
ENDIF (WIN32)
MESSAGE ("---------------------------------------------------------------------")
MESSAGE ("Project Name : " \${PROJECT_NAME})
MESSAGE ("Source Dir : " \${PROJECT_SOURCE_DIR})
MESSAGE ("Binary Dir : " \${PROJECT_BINARY_DIR})
MESSAGE ("System Processor : " \${CMAKE_SYSTEM_PROCESSOR})
MESSAGE ("System Platform : " \${CMAKE_SYSTEM})
MESSAGE ("C Compiler : " \${CMAKE_C_COMPILER})
MESSAGE ("Executable Dir : " \${EXECUTABLE_OUTPUT_PATH})
MESSAGE ("Library Dir : " \${LIBRARY_OUTPUT_PATH})
MESSAGE ("SDK Version : " ${PRJ_VERSION})
MESSAGE ("")
IF (WIN32)
MESSAGE ("Building on WINDOWS ...")
ELSE (WIN32)
MESSAGE ("Building on LINUX ...")
ENDIF (WIN32)
MESSAGE ("---------------------------------------------------------------------")
$(for i in $(grep 'PKG_SOURCE' \
$(find ${TOP_DIR} -name ${MAKE_SEGMENT} -not -path "*.O*") \
| ${SED} "s:${TOP_DIR}/\(.*\)/${MAKE_SEGMENT}.*= *\(.*\):\1~\2:g"); do
UNZIP_DIR=${i%%~*}
GREPO_DIR=${i##*~}
GREPO_PRE=${GREPO_DIR%%.git}
echo "FILE (REMOVE_RECURSE \${PROJECT_SOURCE_DIR}/${UNZIP_DIR}/${GREPO_PRE})"
echo "EXECUTE_PROCESS (COMMAND git clone -q \${PROJECT_SOURCE_DIR}/${PKG_RPATH}/${GREPO_DIR} \${PROJECT_SOURCE_DIR}/${UNZIP_DIR}/${GREPO_PRE})"
echo ""
done)
EOB
cat << EOB >> ${TARGET_FILE}
$(for i in ${DEF_CFLAGS}; do
echo "ADD_DEFINITIONS (${i})"
done)
EOB
if [ "${COMP_LIB_NAME}" != "" ]; then
cat << EOB >> ${TARGET_FILE}
$(for i in ${COMP_LIB_COMPONENTS}; do
echo "ADD_SUBDIRECTORY (${i})"
done)
EOB
cat << EOB >> ${TARGET_FILE}
$(for i in ${SUBDIRS}; do
if [ ! -d ${TOP_DIR}/${i} ]; then
continue
fi
if echo ${COMP_LIB_COMPONENTS} | grep -qw ${i}; then
continue
fi
if [ "$i" = "tests" ]; then
continue
fi
echo "ADD_SUBDIRECTORY (${i})"
done)
EOB
cat << EOB >> ${TARGET_FILE}
ADD_LIBRARY (${COMP_LIB_NAME} SHARED
$(for i in ${SEP_LIBS}; do
j=${i%.a}
j=${j#lib}
echo " \$<TARGET_OBJECTS:${j}>"
done)
)
if(WIN32)
TARGET_LINK_LIBRARIES (${COMP_LIB_NAME} ws2_32)
endif(WIN32)
TARGET_LINK_LIBRARIES (${COMP_LIB_NAME} iot_hal)
SET (LIBRARY_OUTPUT_PATH ./out)
EOB
fi

View File

@@ -0,0 +1,65 @@
#! /bin/bash
if [ $# != 2 ]; then echo "$# != 2"; exit 1; fi
if [ ! -f $1 ]; then echo "$1 not exist"; exit 2; fi
if [ "$(uname)" = "Darwin" ]; then
SED=gsed
else
SED=sed
fi
BLDV=$1
CMDV=$2
if [ "${CMDV}" = "list" ]; then
grep "^PKG_UPSTREAM_[-/_a-zA-Z0-9]*" ${BLDV} \
| ${SED} 's/^PKG_UPSTREAM_\([^ ]*\) = \(.*\)$/[\1] \2/g'
fi
REPO_LIST=$( \
grep "^PKG_UPSTREAM_[-/_a-zA-Z0-9]*" ${BLDV} \
| ${SED} 's/^PKG_UPSTREAM_\([^ ]*\) = \(.*\)$/[\1] \2/g' \
| cut -d' ' -f1 \
| ${SED} 's/\[//g;s/\]//g;' \
)
if [ "${CMDV}" = "update" ]; then
echo "Select repository to be updated, type 1 to update all repositories"|grep --color ".*"
echo ""
select O in "ALL REPOS" ${REPO_LIST}; do
echo ""
echo "Updating $O ..."|grep --color ".*"
echo ""
break
done
if [ "${O}" = "ALL REPOS" ]; then
O=""
fi
REPOS=$(grep -o "^PKG_UPSTREAM_[-/_a-zA-Z0-9]*" ${BLDV}|grep "${O}"|sort -u|${SED} 's:PKG_UPSTREAM_::')
for R in ${REPOS}; do
UPSTREAM=$(grep -m 1 "^PKG_UPSTREAM_${R}" ${BLDV}|awk '{ print $NF }')
SOURCE=$(grep -m 1 "^PKG_SOURCE_${R}" ${BLDV}|awk '{ print $NF }')
BRANCH=$(grep -m 1 "^PKG_BRANCH_${R}" ${BLDV}|awk '{ print $NF }')
[ "${BRANCH}" = "" ] && BRANCH="master"
echo "[ ${SOURCE} ] <= : ${UPSTREAM} :: ${BRANCH}"
set -x
cd ${PACKAGE_DIR}
rm -rf ${SOURCE}
# --single-branch might doesn't exist for git <= 1.7.9.5
#
# git clone -q --bare -b ${BRANCH} --single-branch ${UPSTREAM} ${SOURCE}
git clone -q --bare -b ${BRANCH} ${UPSTREAM} ${SOURCE}
rm -rf ${SOURCE}/hooks/
mkdir -p ${SOURCE}/hooks/
touch ${SOURCE}/hooks/.gitkeep
touch ${SOURCE}/refs/{heads,tags}/.gitkeep
rm -rf ${TOP_DIR}.pkgs/${SOURCE/.git}
cd ${OLDPWD}
set +x
done
fi

View File

@@ -0,0 +1,98 @@
# Basic Settings
#
SHELL := /bin/bash
TOP_DIR ?= $(CURDIR)
ifeq (Darwin,$(strip $(shell uname)))
SED := gsed
STRIP_DBGOPT :=
else
SED := sed
STRIP_DBGOPT := --strip-dwo
endif
# Settings of input directory and file
#
RULE_DIR ?= $(TOP_DIR)/build-rules
CONFIG_DIR ?= $(TOP_DIR)/configs
PACKAGE_DIR ?= $(TOP_DIR)/packages
IMPORT_DIR ?= $(TOP_DIR)/import
MAKE_SEGMENT ?= iot.mk
DOXYGEN_DIR ?= $(TOP_DIR)
ifeq ($(shell [ ! -d $(CONFIG_DIR) ] && echo y),y)
DEFAULT_BLD := $(RULE_DIR)/misc/config.generic.default
endif
# Settings of project information
PRJ_NAME ?= LITE-build.prj
PRJ_VERSION ?= LITE-build.ver
# Settings of output directory
#
CONFIG_TPL := $(TOP_DIR)/.config
OUTPUT_DIR ?= $(TOP_DIR)/.O
SHADOW_DIR ?= workspace
DIST_DIR ?= $(TOP_DIR)/output
LCOV_DIR ?= Coverage
FINAL_DIR ?= $(DIST_DIR)/release
# Setting of directory for flat modules
#
bindir = /usr/bin
libdir = /usr/lib
incdir = /usr/include
# Setting of build process control
#
COMPILE_LOG := compile.log
WARNING_LOG := warnings.log
HD_MAKEFILE := makefile
TOP_MAKEFILE := makefile
STAMP_PRJ_CFG := $(OUTPUT_DIR)/.just.configured
STAMP_BLD_ENV := $(OUTPUT_DIR)/.sub-build.env
STAMP_BLD_VAR := $(OUTPUT_DIR)/.sub-build.vars
STAMP_LCOV := $(OUTPUT_DIR)/.coverage.done
STAMP_UNPACK := .unpack.done
STAMP_CONFIG := .config.done
STAMP_CMAKE := .cmake_section
STAMP_BUILD := .build.done
STAMP_INSTALL := .install.done
STAMP_POSTINS := .post.install.done
STAMP_SHIELD := .shield.done
STAMP_POST_RULE := $(OUTPUT_DIR)/.post-rules.mk
STAMP_DIR := $(OUTPUT_DIR)/stamps
STAMP_ONE_MK := $(OUTPUT_DIR)/.one_makefile
ifdef DEBUG
AUTO_HEADER_Q :=
ORIGIN_Q :=
SHELL_DBG := set -x;
Q :=
TOP_Q :=
else
Q := @
TOP_Q := @
endif
ifdef DEBUG_SHELL
SHELL_DBG := set -x;
endif
# Setting of downloading toolchains
TOOLCHAIN_DLDIR := $(OUTPUT_DIR)/compiler
# Setting of directory for origin modules
#
export INSTALL_DIR = $(OUTPUT_DIR)/usr
export INSTALL_BIN_DIR = $(INSTALL_DIR)/bin
export INSTALL_LIB_DIR = $(INSTALL_DIR)/lib
# Setting of cmake auto-generation
#
CMAKE_EXPORT_LIBS := \
src/ref-impl/hal \
src/ref-impl/tls \
include $(RULE_DIR)/funcs.mk

View File

@@ -0,0 +1,33 @@
DEFAULT_BLD ?= $(CONFIG_DIR)/config.ubuntu.x86
POST_ENV_HOOK := Post_Env
POST_FINAL_OUT_HOOK := Post_Distro
ifeq (Darwin,$(shell uname))
POST_FINAL_OUT_HOOK :=
endif
CONFIG_LIB_EXPORT ?= static
# Default CFLAGS setting
#
CFLAGS += -ansi
CFLAGS += -Wdeclaration-after-statement
CFLAGS += -DFORCE_SSL_VERIFY
# Default INCLUDE list
#
I_DIRS := \
include \
include/imports \
include/exports \
wrappers \
CFLAGS += $(foreach D,$(I_DIRS),$(if $(shell [ -d $(TOP_DIR)/$(D) ] && echo y), -I$(D)))
# For one makefile Generation
#
EXTRA_INSTALL_HDRS := \
$(EXPORT_DIR)/iot_import.h \
$(EXPORT_DIR)/iot_export.h \
$(EXPORT_DIR)/imports \
$(EXPORT_DIR)/exports \

View File

@@ -0,0 +1,12 @@
define Post_Env
( \
$(foreach V,$(SWITCH_VARS), \
$(if $(findstring FEATURE_,$(V)), \
printf "%-40s : %-s\n" "+ $(V)" "$(if $($(V)),$($(V)),n)"; \
) \
) \
echo ""; \
)
endef

View File

@@ -0,0 +1,54 @@
config ATM_ENABLED
bool "FEATURE_ATM_ENABLED"
default n
menu "ATM Configurations"
depends on ATM_ENABLED
config AT_TCP_ENABLED
bool "FEATURE_AT_TCP_ENABLED"
default n
config AT_MQTT_ENABLED
bool "FEATURE_AT_MQTT_ENABLED"
depends on MQTT_COMM_ENABLED
depends on !MQTT_DEFAULT_IMPL
depends on !AT_TCP_ENABLED
default n
config AT_PARSER_ENABLED
bool "FEATURE_AT_PARSER_ENABLED"
default n
choice
prompt "AT HAL Configurations"
depends on AT_PARSER_ENABLED
default AT_HAL_NONE
config AT_HAL_NONE
bool "FEATURE_AT_HAL_NONE"
default n
config AT_TCP_HAL_MK3060
bool "FEATURE_AT_TCP_HAL_MK3060"
default n
depends on AT_TCP_ENABLED
config AT_TCP_HAL_SIM800
bool "FEATURE_AT_TCP_HAL_SIM800"
default n
depends on AT_TCP_ENABLED
config AT_MQTT_HAL_ICA
bool "FEATURE_AT_MQTT_HAL_ICA"
default n
depends on AT_MQTT_ENABLED
config AT_MQTT_HAL_SIM800
bool "FEATURE_AT_MQTT_HAL_SIM800"
default n
depends on AT_MQTT_ENABLED
endchoice
endmenu

View File

@@ -0,0 +1,41 @@
config COAP_COMM_ENABLED
bool "FEATURE_COAP_COMM_ENABLED"
default n
select INFRA_COMPAT
select COAP_CLIENT
help
Establish non-persistent connection with AliCloud via CoAP-based protocol
Switching to "y" leads to building CoAP related implementation into SDK and COAP_COMM_ENABLED included into CFLAGS
Switching to "n" leads to keeping CoAP-based cloud connection implementations out of SDK
config COAP_PACKET
bool
default n
config COAP_CLIENT
bool
default n
select INFRA_CJSON
select INFRA_JSON_PARSER
select INFRA_HTTPC
select INFRA_SHA256
select INFRA_MD5
select INFRA_REPORT
select INFRA_STRING
select HAL_CRYPTO
select HAL_UDP
select COAP_PACKET
config COAP_SERVER
bool
default n
select INFRA_MD5
select INFRA_STRING
select INFRA_JSON_PARSER
select INFRA_SHA1
select HAL_UDP
select HAL_KV
select HAL_CRYPTO
select COAP_PACKET

View File

@@ -0,0 +1,12 @@
config DEV_BIND_ENABLED
bool "FEATURE_DEV_BIND_ENABLED"
select INFRA_CLASSIC
select INFRA_COMPAT
select COAP_SERVER
select MQTT_COMM_ENABLED
default n
help
Enable dev-bind in SDK

View File

@@ -0,0 +1,83 @@
config DEVICE_MODEL_CLASSIC
bool
default y
config LOG_REPORT_TO_CLOUD
bool
default n
config DEVICE_MODEL_ENABLED
depends on MQTT_COMM_ENABLED
bool "FEATURE_DEVICE_MODEL_ENABLED"
select DEVICE_MODEL_CLASSIC
select INFRA_CLASSIC
select INFRA_COMPAT
select INFRA_CJSON
select LOG_REPORT_TO_CLOUD if MQTT_COMM_ENABLED
default y
help
Enable providing Thing-Model-Management/Alink-Protocol encapulation in SDK
Switching to "y" leads to SDK being able to interpret JSON payload in MQTT channel, which also called "Advanced Version Protocol"
Those capabilities are provided via IOT_Linkkit_XXX() APIs or being_deprecated linkkit_xxx() + linkkit_gateway_xxx() APIs
menu "Device Model Configurations"
depends on DEVICE_MODEL_ENABLED
config DEVICE_MODEL_GATEWAY
bool "FEATURE_DEVICE_MODEL_GATEWAY"
select INFRA_SHA1
default n
help
Switching Thing-Model related implementations provided in gateway oriented way
config DEPRECATED_LINKKIT
bool
default n
select INFRA_JSON_PARSER
help
Enable providing Thing-Model related functions via being_deprecated/old/obsoleted APIs
They are named as linkkit_xxx() or linkkit_gateway_xxx(), declared in linkkit_export.h and linkkit_gateway_export.h
Switching to "y" leads to SDK providing APIs in linkkit_export.h + linkkit_gateway_export.h
Switching to "n" leads to SDK providing APIs in iot_export_linkkit.h
config DEVICE_MODEL_RAWDATA_SOLO
bool "FEATURE_DEVICE_MODEL_RAWDATA_SOLO"
depends on DEVICE_MODEL_ENABLED && !DEVICE_MODEL_GATEWAY && !DEPRECATED_LINKKIT
default n
help
Enable only raw data function via IOT_Linkkit_xxx new APIs
Switching to "y" leads to SDK being compiled only raw data function
Switching to "n" leads to SDK being compiled both raw data and thing model function
config ALCS_ENABLED
bool "FEATURE_ALCS_ENABLED"
default n
select COAP_SERVER
help
ALCS(alink local communication service) is a communication between phone and device
Switching to "y" leads to SDK being compiled with alcs function
Switching to "n" leads to SDK being compiled without alcs function
config SUB_PERSISTENCE_ENABLED
bool "FEATURE_SUB_PERSISTENCE_ENABLED"
default n
select HAL_KV
help
Enable this feature will enhance subscribe speed by storing mqtt subscribe infomation with HAL_KV
config DEVICE_MODEL_SUBDEV_OTA
depends on DEVICE_MODEL_GATEWAY
depends on OTA_ENABLED
bool "FEATURE_DEVICE_MODEL_SUBDEV_OTA"
default n
config DEVICE_MODEL_SHADOW
bool "FEATURE_DEVICE_MODEL_SHADOW"
default n
endmenu

View File

@@ -0,0 +1,5 @@
config DEV_RESET
bool "FEATURE_DEV_RESET"
default n
select MQTT_COMM_ENABLED
select HAL_KV

View File

@@ -0,0 +1,4 @@
config DEV_SIGN
bool
default y
select INFRA_SHA256

View File

@@ -0,0 +1,7 @@
config DYNAMIC_REGISTER
bool "FEATURE_DYNAMIC_REGISTER"
default n
select INFRA_STRING
select INFRA_HTTPC
select INFRA_SHA256
select SUPPORT_TLS

View File

@@ -0,0 +1,12 @@
config HTTP_COMM_ENABLED
bool "FEATURE_HTTP_COMM_ENABLED"
default n
select INFRA_SHA1
select INFRA_HTTPC
select INFRA_REPORT
select INFRA_JSON_PARSER
select SUPPORT_TLS
help
Establish persistent connection with AliCloud via HTTP-based protocol

View File

@@ -0,0 +1,18 @@
config HTTP2_COMM_ENABLED
bool "FEATURE_HTTP2_COMM_ENABLED"
select INFRA_HTTPC
select INFRA_SHA1
select INFRA_TIMER
select SUPPORT_TLS
select ON_DAILY
select FS_ENABLED
default n
help
Establish persistent connection with AliCloud via HTTP2-stream protocol
config FS_ENABLED
bool
default n
help
USE HAL fs api to enable file upload feature

View File

@@ -0,0 +1,149 @@
config PLATFORM_HAS_STDINT
bool "PLATFORM_HAS_STDINT"
default y
help
Tell if you have <stdint.h> when build image for target board
Switching to "n" leads to SDK use self-defined data-type in src/infra/infra_types.h
config PLATFORM_HAS_DYNMEM
bool "PLATFORM_HAS_DYNMEM"
default y
help
Tell if you have malloc() and free() style capability on target board via HAL_Malloc() and HAL_Free()
Switching to "y" leads to SDK invoking HAL_Malloc() and HAL_Free() so runtime memory is dynamic
Switching to "n" leads to SDK use global static array instead of heap so process capability is more limited
config PLATFORM_HAS_OS
bool "PLATFORM_HAS_OS"
default n
help
Tell if you have Operation System on target board
Switching to "y" leads to SDK invoking HAL_Mutex_Lock() / HAL_Semaphore_Wait() etc
Switching to "n" leads to SDK avoid using mutex and semaphore, and avoid using multi-task as well
config INFRA_STRING
bool
default n
config INFRA_NET
bool
default n
config INFRA_LIST
bool
default n
config INFRA_LOG_NETWORK_PAYLOAD
bool "FEATURE_INFRA_NETWORK_PAYLOAD"
default y if MQTT_COMM_ENABLED || COAP_COMM_ENABLED || HTTP_COMM_ENABLED || DEVICE_MODEL_ENABLED
help
Parse and print JSON format upstream and downstream network packet payload when SDK communicates with cloud
config INFRA_LOG
bool "FEATURE_INFRA_LOG"
default y
select INFRA_LOG_ALL_MUTED if (INFRA_LOG_MUTE_FLW && INFRA_LOG_MUTE_DBG && INFRA_LOG_MUTE_INF && INFRA_LOG_MUTE_WRN && INFRA_LOG_MUTE_ERR && INFRA_LOG_MUTE_CRT)
help
Control SDK print formatted log but all levels are muted by default, enable them in sub-menu of "Log Configurations"
menu "Log Configurations"
depends on INFRA_LOG
config INFRA_LOG_ALL_MUTED
bool
default n
config INFRA_LOG_MUTE_FLW
bool "MUTE LEVEL of FLOW (6)"
default y
config INFRA_LOG_MUTE_DBG
bool "MUTE LEVEL of DEBUG (5)"
default y
config INFRA_LOG_MUTE_INF
bool "MUTE LEVEL of INFO (4)"
default y
config INFRA_LOG_MUTE_WRN
bool "MUTE LEVEL of WARN (3)"
default y
config INFRA_LOG_MUTE_ERR
bool "MUTE LEVEL of ERROR (2)"
default y
config INFRA_LOG_MUTE_CRT
bool "MUTE LEVEL of CRIT (1)"
default y
endmenu
config INFRA_MEM_STATS
bool
default n
config INFRA_TIMER
bool
default n
config INFRA_RANDOM
bool
default n
config INFRA_JSON_PARSER
bool
default n
config INFRA_CJSON
bool
default n
config INFRA_MD5
bool
default n
config INFRA_SHA1
bool
default n
config INFRA_SHA256
bool
default n
config INFRA_REPORT
bool
default n
select INFRA_STRING
config INFRA_HTTPC
bool
default n
select INFRA_NET
select INFRA_TIMER
config INFRA_MEM_STATS
bool
default n
select INFRA_LIST
config INFRA_COMPAT
bool
default n
select HAL_KV if DYNAMIC_REGISTER
config INFRA_CLASSIC
bool
default n
config INFRA_PREAUTH
bool
default n
config INFRA_AES
bool
default n

View File

@@ -0,0 +1,63 @@
config MQTT_COMM_ENABLED
bool "FEATURE_MQTT_COMM_ENABLED"
default y
select MQTT_PRE_AUTH if !MQTT_DIRECT
select DEV_SIGN
select INFRA_SHA256
select INFRA_LIST
select INFRA_TIMER
select INFRA_REPORT
select INFRA_COMPAT
help
Establish persistent connection with AliCloud via MQTT-based protocol
Switching to "y" leads to building MQTT related implementation into SDK and MQTT_COMM_ENABLED included into CFLAGS
Switching to "n" seldom happens unless you're connecting to AliCloud via CoAP/HTTP channel
menu "MQTT Configurations"
depends on MQTT_COMM_ENABLED
config MQTT_DEFAULT_IMPL
bool "FEATURE_MQTT_DEFAULT_IMPL"
default y
select INFRA_SHA256
select INFRA_NET
select INFRA_TIMER
help
Use SDK default MQTT implementation
Switching to "y" leads to building MQTT related implementation into SDK and MQTT_DEFAULT_IMPL included into CFLAGS
Switching to "n" seldom happens unless you're using other MQTT implementations
config MQTT_PRE_AUTH
bool
default n
select SUPPORT_TLS
select INFRA_HTTPC
select INFRA_PREAUTH
config MQTT_DIRECT
bool "FEATURE_MQTT_DIRECT"
default y
help
Directly connect MQTT server without perform HTTP authenticate to another HTTP server ahead
Switching to "y" leads to connect MQTT server directly and MQTT_DIRECT included into CFLAGS
Switching to "n" leads to legacy authenticate mode: connnect HTTP server first, then connect MQTT server afterwards
config ASYNC_PROTOCOL_STACK
bool "FEATURE_ASYNC_PROTOCOL_STACK"
default n
help
Use async protocol stack for SDK default MQTT implementation
Switching to "y" leads to building MQTT async protocol stack related implementation into SDK and ASYNC_PROTOCOL_STACK included into CFLAGS
Switching to "n" seldom happens unless you're not using async protocol stack
endmenu

View File

@@ -0,0 +1,8 @@
config OTA_ENABLED
bool "FEATURE_OTA_ENABLED"
depends on MQTT_COMM_ENABLED
select INFRA_STRING
select INFRA_JSON_PARSER
select INFRA_HTTPC
select INFRA_MD5
select INFRA_SHA256

View File

@@ -0,0 +1,75 @@
config AWSS_SUPPORT_APLIST
bool
default n
config AWSS_DISABLE_ENROLLEE
bool
default n
config AWSS_DISABLE_REGISTRAR
bool
default n
config AWSS_SUPPORT_ADHA
bool
default n
config AWSS_FRAMEWORKS
bool
default n
config WIFI_PROVISION_ENABLED
bool "FEATURE_WIFI_PROVISION_ENABLED"
select DEV_BIND_ENABLED
select INFRA_AES if !SUPPORT_TLS
select AWSS_FRAMEWORKS if AWSS_SUPPORT_SMARTCONFIG_WPS || AWSS_SUPPORT_SMARTCONFIG
select AWSS_FRAMEWORKS if AWSS_SUPPORT_ZEROCONFIG || AWSS_SUPPORT_DEV_AP
select AWSS_FRAMEWORKS if AWSS_SUPPORT_AHA || AWSS_SUPPORT_ADHA
select AWSS_DISABLE_ENROLLEE if !AWSS_SUPPORT_ZEROCONFIG
select AWSS_DISABLE_REGISTRAR if !AWSS_SUPPORT_ZEROCONFIG
select AWSS_SUPPORT_APLIST if AWSS_FRAMEWORKS
select INFRA_CLASSIC if AWSS_FRAMEWORKS
select INFRA_CJSON if AWSS_FRAMEWORKS
select INFRA_COMPAT if AWSS_FRAMEWORKS
default n
help
Enable providing Wifi SSID/PASSWD configration in SDK
config AWSS_SUPPORT_SMARTCONFIG_WPS
bool
default n
menu "Wifi Provision Configurations"
depends on WIFI_PROVISION_ENABLED
config AWSS_SUPPORT_SMARTCONFIG
bool "FEATURE_AWSS_SUPPORT_SMARTCONFIG"
select AWSS_SUPPORT_SMARTCONFIG_WPS
default y
help
Switching on a wifi provision method based on len-encoding
config AWSS_SUPPORT_ZEROCONFIG
bool "FEATURE_AWSS_SUPPORT_ZEROCONFIG"
select MQTT_COMM_ENABLED
default n
help
Switching on a wifi provision method based on zero-config, which shares ssid/passwd between devices
config AWSS_SUPPORT_AHA
bool "FEATURE_AWSS_SUPPORT_AHA, ADHA"
select AWSS_SUPPORT_ADHA
default n
help
Switching on a wifi provision method based on phone-ap, which tells the ssid/passwd to the devices connected to it
Switching on a wifi provision method based on router-ap, which tells the ssid/passwd to the devices connected to it
config AWSS_SUPPORT_DEV_AP
bool "FEATURE_AWSS_SUPPORT_DEV_AP"
default n
help
Switching on a wifi provision method based on device-ap, which receives the ssid/passwd from the phones connected to it
endmenu

View File

@@ -0,0 +1,19 @@
config HAL_KV
bool
default n
config SUPPORT_TLS
bool "FEATURE_SUPPORT_TLS"
default y if OTA_ENABLED
config HAL_CRYPTO
bool
default n
config HAL_UDP
bool
default n
config COAP_DTLS_SUPPORT
bool
default n

View File

@@ -0,0 +1,220 @@
#!/bin/bash
throw() {
echo "$*" >&2
exit 1
}
BRIEF=0
LEAFONLY=0
PRUNE=0
NO_HEAD=0
NORMALIZE_SOLIDUS=0
usage() {
echo
echo "Usage: JSON.sh [-b] [-l] [-p] [-s] [-h]"
echo
echo "-p - Prune empty. Exclude fields with empty values."
echo "-l - Leaf only. Only show leaf nodes, which stops data duplication."
echo "-b - Brief. Combines 'Leaf only' and 'Prune empty' options."
echo "-c - Brief. Combines 'Leaf only' and 'Prune empty' options, but print code"
echo "-n - No-head. Do not show nodes that have no path (lines that start with [])."
echo "-s - Remove escaping of the solidus symbol (straight slash)."
echo "-h - This help text."
echo
}
parse_options() {
set -- "$@"
local ARGN=$#
while [ "$ARGN" -ne 0 ]
do
case $1 in
-h) usage
exit 0
;;
-b) BRIEF=1
LEAFONLY=1
PRUNE=1
CODE=0
;;
-c) BRIEF=1
LEAFONLY=1
PRUNE=1
CODE=1
;;
-l) LEAFONLY=1
;;
-p) PRUNE=1
;;
-n) NO_HEAD=1
;;
-s) NORMALIZE_SOLIDUS=1
;;
?*) echo "ERROR: Unknown option."
usage
exit 0
;;
esac
shift 1
ARGN=$((ARGN-1))
done
}
awk_egrep () {
local pattern_string=$1
gawk '{
while ($0) {
start=match($0, pattern);
token=substr($0, start, RLENGTH);
print token;
$0=substr($0, start+RLENGTH);
}
}' pattern="$pattern_string"
}
tokenize () {
local GREP
local ESCAPE
local CHAR
if echo "test string" | egrep -ao --color=never "test" >/dev/null 2>&1
then
GREP='egrep -ao --color=never'
else
GREP='egrep -ao'
fi
if echo "test string" | egrep -o "test" >/dev/null 2>&1
then
ESCAPE='(\\[^u[:cntrl:]]|\\u[0-9a-fA-F]{4})'
CHAR='[^[:cntrl:]"\\]'
else
GREP=awk_egrep
ESCAPE='(\\\\[^u[:cntrl:]]|\\u[0-9a-fA-F]{4})'
CHAR='[^[:cntrl:]"\\\\]'
fi
local STRING="\"$CHAR*($ESCAPE$CHAR*)*\""
local NUMBER='-?(0|[1-9][0-9]*)([.][0-9]*)?([eE][+-]?[0-9]*)?'
local KEYWORD='null|false|true'
local SPACE='[[:space:]]+'
# Force zsh to expand $A into multiple words
local is_wordsplit_disabled=$(unsetopt 2>/dev/null | grep -c '^shwordsplit$')
if [ $is_wordsplit_disabled != 0 ]; then setopt shwordsplit; fi
$GREP "$STRING|$NUMBER|$KEYWORD|$SPACE|." | egrep -v "^$SPACE$"
if [ $is_wordsplit_disabled != 0 ]; then unsetopt shwordsplit; fi
}
parse_array () {
local index=0
local ary=''
read -r token
case "$token" in
']') ;;
*)
while :
do
parse_value "$1" "$index"
index=$((index+1))
ary="$ary""$value"
read -r token
case "$token" in
']') break ;;
',') ary="$ary," ;;
*) throw "EXPECTED , or ] GOT ${token:-EOF}" ;;
esac
read -r token
done
;;
esac
[ "$BRIEF" -eq 0 ] && value=$(printf '[%s]' "$ary") || value=
:
}
parse_object () {
local key
local obj=''
read -r token
case "$token" in
'}') ;;
*)
while :
do
case "$token" in
'"'*'"') key=$token ;;
*) throw "EXPECTED string GOT ${token:-EOF}" ;;
esac
read -r token
case "$token" in
':') ;;
*) throw "EXPECTED : GOT ${token:-EOF}" ;;
esac
read -r token
parse_value "$1" "$key"
obj="$obj$key:$value"
read -r token
case "$token" in
'}') break ;;
',') obj="$obj," ;;
*) throw "EXPECTED , or } GOT ${token:-EOF}" ;;
esac
read -r token
done
;;
esac
[ "$BRIEF" -eq 0 ] && value=$(printf '{%s}' "$obj") || value=
:
}
parse_value () {
local jpath="${1:+$1,}$2" isleaf=0 isempty=0 print=0
local cpath="$(echo ${jpath}|sed 's:"*,"*:__:g;s:"::g')"
case "$token" in
'{') parse_object "$jpath" ;;
'[') parse_array "$jpath" ;;
# At this point, the only valid single-character tokens are digits.
''|[!0-9]) throw "EXPECTED value GOT ${token:-EOF}" ;;
*) value=$token
# if asked, replace solidus ("\/") in json strings with normalized value: "/"
[ "$NORMALIZE_SOLIDUS" -eq 1 ] && value=$(echo "$value" | sed 's#\\/#/#g')
isleaf=1
[ "$value" = '""' ] && isempty=1
;;
esac
[ "$value" = '' ] && return
[ "$NO_HEAD" -eq 1 ] && [ -z "$jpath" ] && return
[ "$LEAFONLY" -eq 0 ] && [ "$PRUNE" -eq 0 ] && print=1
[ "$LEAFONLY" -eq 1 ] && [ "$isleaf" -eq 1 ] && [ $PRUNE -eq 0 ] && print=1
[ "$LEAFONLY" -eq 0 ] && [ "$PRUNE" -eq 1 ] && [ "$isempty" -eq 0 ] && print=1
[ "$LEAFONLY" -eq 1 ] && [ "$isleaf" -eq 1 ] && \
[ $PRUNE -eq 1 ] && [ $isempty -eq 0 ] && print=1
if [ "$CODE" = "0" ]; then
[ "$print" -eq 1 ] && printf "[%s]\t%s\n" "$jpath" "$value"
else
[ "$print" -eq 1 ] && printf "%s=%s\n" "$cpath" "$value"
fi
:
}
parse () {
read -r token
parse_value
read -r token
case "$token" in
'') ;;
*) throw "EXPECTED EOF GOT $token" ;;
esac
}
if ([ "$0" = "$BASH_SOURCE" ] || ! [ -n "$BASH_SOURCE" ]);
then
parse_options "$@"
tokenize | parse
fi
# vi: expandtab sw=2 ts=2

View File

@@ -0,0 +1,44 @@
#! /bin/bash
alias_map()
{
VAR_ALIAS="$1"
VAR_NAME="$2"
VAR_VAL="$(eval echo '${'${VAR_NAME}'}')"
eval "${VAR_ALIAS}=${VAR_VAL}"
VARS_LIST="${VARS_LIST} ${VAR_ALIAS}"
}
SELF_DIR=$(cd "$(dirname "$0")";pwd)
JPARSER=${SELF_DIR}/JSON.sh
MODEL_FL="${SELF_DIR}/../../model.json"
SRC_FL="${SELF_DIR}/linkkit_example_auto.c"
DST_FL="$1"
VARS_FL="${PWD}/.temp_dm_auto_cache"
VARS_LIST=""
if [ -f ${MODEL_FL} ]; then
echo "Processing [${MODEL_FL}] ..."
fi
${JPARSER} -c < ${MODEL_FL} > ${VARS_FL}
source ${VARS_FL}
alias_map "DEVICE_PK" "profile__productKey"
alias_map "DM_PROP_ID" "properties__0__identifier"
alias_map "DM_EVT_ID" "events__1__identifier"
alias_map "DM_EVT_OU_KEY" "events__1__outputData__0__identifier"
mkdir -p $(dirname ${DST_FL})
cp ${SRC_FL} ${DST_FL}
echo "Recognised Variables:"
echo ""
for iter in ${VARS_LIST}; do
iter_val=$(eval echo '$'${iter})
printf "%16s : %-32s\n" ${iter} ${iter_val}
sed -i "s: ###${iter}### :${iter_val}:g" ${DST_FL}
done
echo ""
rm -f ${VARS_FL}

View File

@@ -0,0 +1,222 @@
/*
* Copyright (C) 2015-2018 Alibaba Group Holding Limited
*/
#include <stdio.h>
#include <string.h>
#include "infra_types.h"
#include "infra_defs.h"
#include "infra_compat.h"
#include "infra_compat.h"
#include "dev_model_api.h"
#include "dm_wrapper.h"
#include "cJSON.h"
#ifdef ATM_ENABLED
#include "at_api.h"
#endif
void HAL_Printf(const char *fmt, ...);
int HAL_SetProductKey(char *product_key);
int HAL_SetDeviceName(char *device_name);
int HAL_SetProductSecret(char *product_secret);
int HAL_SetDeviceSecret(char *device_secret);
/* Fill in your device info here */
#define PRODUCT_KEY " ###DEVICE_PK### "
#define PRODUCT_SECRET "0HxtPRZjwr14bi7K"
#define DEVICE_NAME "auto_example1"
#define DEVICE_SECRET "L1xQk7AntumkNNc8wvHwMJsh9PBoexN0"
/* This time interval will be given to SDK for receiving packets from network */
#define USER_EXAMPLE_YIELD_TIMEOUT_MS (200)
#define EXAMPLE_TRACE(...) \
do { \
HAL_Printf("\033[1;32;40m%s.%d: ", __func__, __LINE__); \
HAL_Printf(__VA_ARGS__); \
HAL_Printf("\033[0m\r\n"); \
} while (0)
typedef struct {
int cloud_connected;
int master_devid;
int master_initialized;
} user_example_ctx_t;
static user_example_ctx_t g_user_example_ctx;
static user_example_ctx_t *user_example_get_ctx(void)
{
return &g_user_example_ctx;
}
static int user_connected_event_handler(void)
{
user_example_ctx_t *user_example_ctx = user_example_get_ctx();
EXAMPLE_TRACE("Alibaba Cloud Connected Successfully!");
user_example_ctx->cloud_connected = 1;
return 0;
}
static int user_master_dev_available(void)
{
user_example_ctx_t *user_example_ctx = user_example_get_ctx();
if (user_example_ctx->cloud_connected && user_example_ctx->master_initialized) {
return 1;
}
return 0;
}
static int user_disconnected_event_handler(void)
{
user_example_ctx_t *user_example_ctx = user_example_get_ctx();
EXAMPLE_TRACE("Cloud Disconnected Event Arrived!");
user_example_ctx->cloud_connected = 0;
return 0;
}
static int user_property_set_event_handler(const int devid, const char *request, const int request_len)
{
int res = 0;
user_example_ctx_t *user_example_ctx = user_example_get_ctx();
EXAMPLE_TRACE("Property Set Received, Devid: %d, Request: %s", devid, request);
res = IOT_Linkkit_Report(user_example_ctx->master_devid,
ITM_MSG_POST_PROPERTY,
(unsigned char *)request,
request_len);
EXAMPLE_TRACE("Post Property Message ID: %d", res);
return 0;
}
static int user_initialized(const int devid)
{
user_example_ctx_t *user_example_ctx = user_example_get_ctx();
EXAMPLE_TRACE("Device Initialized, Devid: %d", devid);
if (user_example_ctx->master_devid == devid) {
user_example_ctx->master_initialized = 1;
}
return 0;
}
void user_post_property(void)
{
int res = 0;
user_example_ctx_t *user_example_ctx = user_example_get_ctx();
char *property_payload = "NULL";
/* Normal Example */
property_payload = "{\" ###DM_PROP_ID### \":0}";
res = IOT_Linkkit_Report(user_example_ctx->master_devid,
ITM_MSG_POST_PROPERTY,
(unsigned char *)property_payload,
strlen(property_payload));
EXAMPLE_TRACE("Post Property Message ID: %d", res);
}
void user_post_event(void)
{
int res = 0;
user_example_ctx_t *user_example_ctx = user_example_get_ctx();
char *event_id = " ###DM_EVT_ID### ";
char *event_payload = "NULL";
/* Normal Example */
event_payload = "{\" ###DM_EVT_OU_KEY### \":0}";
res = IOT_Linkkit_TriggerEvent(user_example_ctx->master_devid,
event_id,
strlen(event_id),
event_payload,
strlen(event_payload));
EXAMPLE_TRACE("Post Event Message ID: %d", res);
}
void set_iotx_info()
{
HAL_SetProductKey(PRODUCT_KEY);
HAL_SetProductSecret(PRODUCT_SECRET);
HAL_SetDeviceName(DEVICE_NAME);
HAL_SetDeviceSecret(DEVICE_SECRET);
}
int main(void)
{
unsigned int loop_cnt = 0;
int res = 0;
iotx_linkkit_dev_meta_info_t master_meta_info;
user_example_ctx_t *user_example_ctx = user_example_get_ctx();
#ifdef ATM_ENABLED
if (IOT_ATM_Init() < 0) {
EXAMPLE_TRACE("IOT ATM init failed!\n");
return -1;
}
#endif
IOT_SetLogLevel(IOT_LOG_DEBUG);
set_iotx_info();
/* Register Callback to Listen What You Interested inside SDK */
IOT_RegisterCallback(ITE_CONNECT_SUCC, user_connected_event_handler);
IOT_RegisterCallback(ITE_INITIALIZE_COMPLETED, user_initialized);
IOT_RegisterCallback(ITE_PROPERTY_SET, user_property_set_event_handler);
IOT_RegisterCallback(ITE_DISCONNECTED, user_disconnected_event_handler);
/* Create Meta Information Struct for IOT_Linkkit_Open() */
memset(&master_meta_info, 0, sizeof(iotx_linkkit_dev_meta_info_t));
memcpy(master_meta_info.product_key, PRODUCT_KEY, strlen(PRODUCT_KEY));
memcpy(master_meta_info.product_secret, PRODUCT_SECRET, strlen(PRODUCT_SECRET));
memcpy(master_meta_info.device_name, DEVICE_NAME, strlen(DEVICE_NAME));
memcpy(master_meta_info.device_secret, DEVICE_SECRET, strlen(DEVICE_SECRET));
/* Create Master Device Resources by IOT_Linkkit_Open() */
memset(user_example_ctx, 0, sizeof(user_example_ctx_t));
user_example_ctx->master_devid = IOT_Linkkit_Open(IOTX_LINKKIT_DEV_TYPE_MASTER, &master_meta_info);
if (user_example_ctx->master_devid < 0) {
EXAMPLE_TRACE("IOT_Linkkit_Open() Failed\n");
return -1;
}
EXAMPLE_TRACE("IOT_Linkkit_Open() Success!\n");
/* Start Connectting Alibaba Cloud */
res = IOT_Linkkit_Connect(user_example_ctx->master_devid);
if (res < 0) {
EXAMPLE_TRACE("IOT_Linkkit_Connect() Failed\n");
return -1;
}
EXAMPLE_TRACE("IOT_Linkkit_Connect() Success! res = IOT_Linkkit_Connect() = %d\n", res);
/* Infinite Loop of Processing Command Received from Cloud */
while (1) {
IOT_Linkkit_Yield(USER_EXAMPLE_YIELD_TIMEOUT_MS);
/* Post Proprety Example */
if (loop_cnt % 100 == 0 && user_master_dev_available()) {
EXAMPLE_TRACE("loop_cnt = %d, going to post property\n", loop_cnt);
user_post_property();
}
/* Post Event Example */
if (loop_cnt % 180 == 0 && user_master_dev_available()) {
EXAMPLE_TRACE("loop_cnt = %d, going to post event\n", loop_cnt);
user_post_event();
}
++ loop_cnt;
}
IOT_Linkkit_Close(user_example_ctx->master_devid);
IOT_DumpMemoryStats(IOT_LOG_DEBUG);
IOT_SetLogLevel(IOT_LOG_NONE);
return 0;
}

View File

@@ -0,0 +1,70 @@
LIB_SDK_TARGET := libiot_sdk.a
LIB_HAL_TARGET := libiot_hal.a
###############################################################################
# Compiler
CC := gcc
AR := ar
###############################################################################
# Path definitions
TOPDIR := .
BLDDIR := build
SRCDIR := eng
EXPDIR := examples
HDRDIR := $(shell find $(SRCDIR) -type d)
PROG_TARGET := $(shell ls $(EXPDIR) 2>/dev/null|grep example|sed 's:\.c::g;s:_:-:g')
PROG_TARGET := $(foreach V,$(PROG_TARGET),$(BLDDIR)/$(V))
###############################################################################
# Application source files
SOURCE_FILES_C := $(shell find $(SRCDIR) -name "*.c" -not -path "*wrappers*")
WRAPPER_IMPL_C := $(shell find $(SRCDIR) -name "*.c" -path "*wrappers*")
###############################################################################
# Standard application lib/header search paths
CFLAGS := $(addprefix -I,$(HDRDIR))
LDFLAGS := -L$(BLDDIR) -liot_sdk -liot_hal -lpthread -lrt
###############################################################################
# Dependency rules
LIB_OBJS := $(SOURCE_FILES_C:.c=.o)
LIB_OBJS := $(subst $(SRCDIR),$(BLDDIR),$(LIB_OBJS))
HAL_OBJS := $(WRAPPER_IMPL_C:.c=.o)
HAL_OBJS := $(subst $(SRCDIR),$(BLDDIR),$(HAL_OBJS))
.PHONY: prepare all clean prog
all: prepare $(BLDDIR)/$(LIB_SDK_TARGET) $(BLDDIR)/$(LIB_HAL_TARGET)
prog: all $(PROG_TARGET)
prepare:
-@mkdir -p $(BLDDIR)
$(BLDDIR)/$(LIB_SDK_TARGET): $(LIB_OBJS)
@echo "o Archiving $@ ..."
@$(AR) -rcs $@ $^
$(BLDDIR)/$(LIB_HAL_TARGET): $(HAL_OBJS)
@echo "o Archiving $@ ..."
@$(AR) -rcs $@ $^
$(PROG_TARGET): $(BLDDIR)/$(LIB_SDK_TARGET) $(BLDDIR)/$(LIB_HAL_TARGET)
@echo "+ Linking $@ ..."
@$(CC) -o $@ $(shell echo $@".c"|sed 's:$(BLDDIR):$(EXPDIR):g;s:-:_:g') $(CFLAGS) $(LDFLAGS)
$(BLDDIR)/%.o: $(SRCDIR)/%.c
@echo ": Compiling $< ..."
@mkdir -p $(shell dirname $@)
@$(CC) -o $@ -c $< $(CFLAGS)
clean:
@rm -rf $(BLDDIR)

View File

@@ -0,0 +1,700 @@
WRAPPER_NOTE:
/**
* NOTE:
*
* HAL_TCP_xxx API reference implementation: wrappers/os/ubuntu/HAL_TCP_linux.c
*
*/
WRAPPER_FUNC_REFERENCE:
/**
 *
 * 函数 FUNC_NAME() 需要SDK的使用者针对SDK将运行的硬件平台填充实现, 供SDK调用
 * ---
 * Interface of FUNC_NAME() requires to be implemented by user of SDK, according to target device platform
 *
 * 如果需要参考如何实现函数 FUNC_NAME(), 可以查阅SDK移植到 Ubuntu Linux 上时的示例代码
 * ---
 * If you need guidance about how to implement FUNC_NAME, you can check its reference implementation for Ubuntu platform
 *
 * https://code.aliyun.com/linkkit/c-sdk/blob/v3.0.1/wrappers/FUNC_FILE
 *
 *
 * 注意! HAL_XXX() 系列的函数虽然有阿里提供的对应参考实现, 但不建议您不做任何修改/检视的应用于您的商用设备!
 * 
 * 注意! 参考示例实现仅用于解释各个 HAL_XXX() 系列函数的语义!
 * 
 */
HAL_Malloc:
/**
* @brief Allocates a block of size bytes of memory, returning a pointer to the beginning of the block.
*
* @param [in] size @n specify block size in bytes.
* @return A pointer to the beginning of the block.
* @see None.
* @note Block value is indeterminate.
*/
HAL_Free:
/**
* @brief Deallocate memory block
*
* @param[in] ptr @n Pointer to a memory block previously allocated with platform_malloc.
* @return None.
* @see None.
* @note None.
*/
HAL_Printf:
/**
* @brief Writes formatted data to stream.
*
* @param [in] fmt: @n String that contains the text to be written, it can optionally contain embedded format specifiers
that specifies how subsequent arguments are converted for output.
* @param [in] ...: @n the variable argument list, for formatted and inserted in the resulting string replacing their respective specifiers.
* @return None.
* @see None.
* @note None.
*/
HAL_Snprintf:
/**
* @brief Writes formatted data to string.
*
* @param [out] str: @n String that holds written text.
* @param [in] len: @n Maximum length of character will be written
* @param [in] fmt: @n Format that contains the text to be written, it can optionally contain embedded format specifiers
that specifies how subsequent arguments are converted for output.
* @param [in] ...: @n the variable argument list, for formatted and inserted in the resulting string replacing their respective specifiers.
* @return bytes of character successfully written into string.
* @see None.
* @note None.
*/
HAL_SleepMs:
/**
* @brief Sleep thread itself.
*
* @param [in] ms @n the time interval for which execution is to be suspended, in milliseconds.
* @return None.
* @see None.
* @note None.
*/
HAL_UptimeMs:
/**
* @brief Retrieves the number of milliseconds that have elapsed since the system was boot.
*
* @return the number of milliseconds.
* @see None.
* @note None.
*/
HAL_MutexCreate:
/**
* @brief Create a mutex.
*
* @retval NULL : Initialize mutex failed.
* @retval NOT_NULL : The mutex handle.
* @see None.
* @note None.
*/
HAL_MutexDestroy:
/**
* @brief Destroy the specified mutex object, it will release related resource.
*
* @param [in] mutex @n The specified mutex.
* @return None.
* @see None.
* @note None.
*/
HAL_MutexLock:
/**
* @brief Waits until the specified mutex is in the signaled state.
*
* @param [in] mutex @n the specified mutex.
* @return None.
* @see None.
* @note None.
*/
HAL_MutexUnlock:
/**
* @brief Releases ownership of the specified mutex object..
*
* @param [in] mutex @n the specified mutex.
* @return None.
* @see None.
* @note None.
*/
HAL_GetProductKey:
/**
* @brief Get product key from user's system persistent storage
*
* @param [ou] product_key: array to store product key, max length is IOTX_PRODUCT_KEY_LEN
* @return the actual length of product key
*/
HAL_GetDeviceName:
/**
* @brief Get device name from user's system persistent storage
*
* @param [ou] device_name: array to store device name, max length is IOTX_DEVICE_NAME_LEN
* @return the actual length of device name
*/
HAL_GetDeviceSecret:
/**
* @brief Get device secret from user's system persistent storage
*
* @param [ou] device_secret: array to store device secret, max length is IOTX_DEVICE_SECRET_LEN
* @return the actual length of device secret
*/
HAL_GetFirmwareVersion:
/**
* @brief Get firmware version
*
* @param [ou] version: array to store firmware version, max length is IOTX_FIRMWARE_VER_LEN
* @return the actual length of firmware version
*/
HAL_TCP_Establish:
/**
* @brief Establish a TCP connection.
*
* @param [in] host: @n Specify the hostname(IP) of the TCP server
* @param [in] port: @n Specify the TCP port of TCP server
*
* @return The handle of TCP connection.
@retval (uintptr_t)(-1): Fail.
@retval All other values(0 included): Success, the value is handle of this TCP connection.
*/
HAL_TCP_Destroy:
/**
* @brief Destroy the specific TCP connection.
*
* @param [in] fd: @n Specify the TCP connection by handle.
*
* @return The result of destroy TCP connection.
* @retval < 0 : Fail.
* @retval 0 : Success.
*/
HAL_TCP_Write:
/**
* @brief Write data into the specific TCP connection.
* The API will return immediately if 'len' be written into the specific TCP connection.
*
* @param [in] fd @n A descriptor identifying a connection.
* @param [in] buf @n A pointer to a buffer containing the data to be transmitted.
* @param [in] len @n The length, in bytes, of the data pointed to by the 'buf' parameter.
* @param [in] timeout_ms @n Specify the timeout value in millisecond. In other words, the API block 'timeout_ms' millisecond maximumly.
*
* @retval < 0 : TCP connection error occur..
* @retval 0 : No any data be write into the TCP connection in 'timeout_ms' timeout period.
* @retval (0, len] : The total number of bytes be written in 'timeout_ms' timeout period.
* @see None.
*/
HAL_TCP_Read:
/**
* @brief Read data from the specific TCP connection with timeout parameter.
* The API will return immediately if 'len' be received from the specific TCP connection.
*
* @param [in] fd @n A descriptor identifying a TCP connection.
* @param [out] buf @n A pointer to a buffer to receive incoming data.
* @param [out] len @n The length, in bytes, of the data pointed to by the 'buf' parameter.
* @param [in] timeout_ms @n Specify the timeout value in millisecond. In other words, the API block 'timeout_ms' millisecond maximumly.
*
* @retval -2 : TCP connection error occur.
* @retval -1 : TCP connection be closed by remote server.
* @retval 0 : No any data be received in 'timeout_ms' timeout period.
* @retval (0, len] : The total number of bytes be received in 'timeout_ms' timeout period.
* @see None.
*/
wrapper_mqtt_init:
/**
* @brief Init the MQTT client
* This function initialize the data structures.
*
* @param [in] mqtt_params: specify the MQTT client parameter.
*
* @retval NULL : Init failed.
* @retval NOT_NULL : The handle of MQTT client.
* @see None.
*/
wrapper_mqtt_connect:
/**
* @brief Establish MQTT connection.
* This function establish MQTT connection.
*
* @param [in] client: The handle of MQTT client.
*
* @retval 0 : MQTT connect seccuss.
* @retval < 0 : MQTT connect failed.
* @see None.
*/
wrapper_mqtt_yield:
/**
* @brief Handle MQTT packet from remote server and process timeout request
* which include the MQTT subscribe, unsubscribe, publish(QOS >= 1), reconnect, etc..
*
* @param [in] client: specify the MQTT client.
* @param [in] timeout_ms: specify the timeout in millisecond in this loop.
*
* @return status.
* @see None.
*/
wrapper_mqtt_check_state:
/**
* @brief check whether MQTT connection is established or not.
*
* @param [in] client: specify the MQTT client.
*
* @retval 1 : MQTT in abnormal state.
* @retval 0 : MQTT in normal state.
* @see None.
*/
wrapper_mqtt_subscribe:
/**
* @brief Subscribe MQTT topic.
*
* @param [in] client: specify the MQTT client.
* @param [in] topic_filter: specify the topic filter.
* @param [in] qos: specify the MQTT Requested QoS.
* @param [in] topic_handle_func: specify the topic handle callback-function.
* @param [in] pcontext: specify context. When call 'topic_handle_func', it will be passed back.
*
* @retval -1 : Subscribe failed.
* @retval >=0 : Subscribe successful.
The value is a unique ID of this request.
The ID will be passed back when callback 'iotx_mqtt_param_t:handle_event'.
* @see None.
*/
wrapper_mqtt_subscribe_sync:
/**
* @brief Subscribe MQTT topic and wait suback.
*
* @param [in] client: specify the MQTT client.
* @param [in] topic_filter: specify the topic filter.
* @param [in] qos: specify the MQTT Requested QoS.
* @param [in] topic_handle_func: specify the topic handle callback-function.
* @param [in] pcontext: specify context. When call 'topic_handle_func', it will be passed back.
* @param [in] timeout_ms: time in ms to wait.
*
* @retval -1 : Subscribe failed.
* @retval >=0 : Subscribe successful.
The value is a unique ID of this request.
The ID will be passed back when callback 'iotx_mqtt_param_t:handle_event'.
* @see None.
*/
wrapper_mqtt_unsubscribe:
/**
* @brief Unsubscribe MQTT topic.
*
* @param [in] client: specify the MQTT client.
* @param [in] topic_filter: specify the topic filter.
*
* @retval -1 : Unsubscribe failed.
* @retval >=0 : Unsubscribe successful.
The value is a unique ID of this request.
The ID will be passed back when callback 'iotx_mqtt_param_t:handle_event'.
* @see None.
*/
wrapper_mqtt_publish:
/**
* @brief Publish message to specific topic.
*
* @param [in] client: specify the MQTT client.
* @param [in] topic_name: specify the topic name.
* @param [in] topic_msg: specify the topic message.
*
* @retval -1 : Publish failed.
* @retval 0 : Publish successful, where QoS is 0.
* @retval >0 : Publish successful, where QoS is >= 0.
The value is a unique ID of this request.
The ID will be passed back when callback 'iotx_mqtt_param_t:handle_event'.
* @see None.
*/
wrapper_mqtt_release:
/**
* @brief Release the MQTT client
* This function disconnect MQTT connection and release the related resource.
*
* @param [in] client: pointer of handle, specify the MQTT client.
*
* @retval 0 : Release success.
* @retval -1 : Release failed.
* @see None.
*/
wrapper_mqtt_nwk_event_handler:
/**
* @brief Only used in async network stack and FEATURE_ASYNC_PROTOCOL_STACK must be selected
*
* @param [in] client: specify the MQTT client.
* @param [in] event: specify the network event.
* @param [in] param: specify the network params.
*
* @retval -1 : Handle failed.
* @retval 0 : Handle successful.
*
*/
HAL_SemaphoreCreate:
/**
* @brief create a semaphore
*
* @return semaphore handle.
* @see None.
* @note The recommended value of maximum count of the semaphore is 255.
*/
HAL_SemaphoreDestroy:
/**
* @brief destory a semaphore
*
* @param[in] sem @n the specified sem.
* @return None.
* @see None.
* @note None.
*/
HAL_SemaphorePost:
/**
* @brief signal thread wait on a semaphore
*
* @param[in] sem @n the specified semaphore.
* @return None.
* @see None.
* @note None.
*/
HAL_SemaphoreWait:
/**
* @brief wait on a semaphore
*
* @param[in] sem @n the specified semaphore.
* @param[in] timeout_ms @n timeout interval in millisecond.
If timeout_ms is PLATFORM_WAIT_INFINITE, the function will return only when the semaphore is signaled.
* @return
@verbatim
= 0: The state of the specified object is signaled.
= -1: The time-out interval elapsed, and the object's state is nonsignaled.
@endverbatim
* @see None.
* @note None.
*/
HAL_ThreadCreate:
/**
* @brief create a thread
*
* @param[out] thread_handle @n The new thread handle, memory allocated before thread created and return it, free it after thread joined or exit.
* @param[in] start_routine @n A pointer to the application-defined function to be executed by the thread.
This pointer represents the starting address of the thread.
* @param[in] arg @n A pointer to a variable to be passed to the start_routine.
* @param[in] hal_os_thread_param @n A pointer to stack params.
* @param[out] stack_used @n if platform used stack buffer, set stack_used to 1, otherwise set it to 0.
* @return
@verbatim
= 0: on success.
= -1: error occur.
@endverbatim
* @see None.
* @note None.
*/
HAL_AT_Uart_Init:
/**
* Initialises a UART interface
*
*
* @param[in] uart the interface which should be initialised
*
* @return 0 : on success, EIO : if an error occurred with any step
*/
HAL_AT_Uart_Deinit:
/**
* Deinitialises a UART interface
*
* @param[in] uart the interface which should be deinitialised
*
* @return 0 : on success, EIO : if an error occurred with any step
*/
HAL_AT_Uart_Send:
/**
* Transmit data on a UART interface
*
* @param[in] uart the UART interface
* @param[in] data pointer to the start of data
* @param[in] size number of bytes to transmit
* @param[in] timeout timeout in milisecond, set this value to HAL_WAIT_FOREVER
* if you want to wait forever
*
* @return 0 : on success, EIO : if an error occurred with any step
*/
HAL_AT_Uart_Recv:
/**
* Receive data on a UART interface
*
* @param[in] uart the UART interface
* @param[out] data pointer to the buffer which will store incoming data
* @param[in] expect_size number of bytes to receive
* @param[out] recv_size number of bytes received
* @param[in] timeout timeout in milisecond, set this value to HAL_WAIT_FOREVER
* if you want to wait forever
*
* @return 0 : on success, EIO : if an error occurred with any step
*/
HAL_AT_CONN_Init:
/**
* Module low level init so that it's ready to setup socket connection.
*
* @return 0 - success, -1 - failure
*/
HAL_AT_CONN_Start:
/**
* Start a socket connection via module.
*
* @param[in] conn - connect parameters which are used to setup
* the socket connection.
*
* @return 0 - success, -1 - failure
*/
HAL_AT_CONN_Send:
/**
* Send data via module.
* This function does not return until all data sent.
*
* @param[in] fd - the file descripter to operate on.
* @param[in] data - pointer to data to send.
* @param[in] len - length of the data.
* @param[in] remote_ip - remote port number (optional).
* @param[in] remote_port - remote port number (optional).
*
* @return 0 - success, -1 - failure
*/
HAL_AT_CONN_DomainToIp:
/**
* Get IP information of the corresponding domain.
* Currently only one IP string is returned (even when the domain
* coresponses to mutliple IPs). Note: only IPv4 is supported.
*
* @param[in] domain - the domain string.
* @param[out] ip - the place to hold the dot-formatted ip string.
*
* @return 0 - success, -1 - failure
*/
HAL_AT_CONN_Close:
/**
* Close the socket connection.
*
* @param[in] fd - the file descripter to operate on.
* @param[in] remote_port - remote port number (optional).
*
* @return 0 - success, -1 - failure
*/
HAL_AT_CONN_Deinit:
/**
* Destroy or exit low level state if necessary.
*
* @return 0 - success, -1 - failure
*/
HAL_AT_CONN_RegInputCb:
/**
* Register network connection data input function
* Input data from module.
* This callback should be called when the data is received from the module
* It should tell the sal where the data comes from.
* @param[in] fd - the file descripter to operate on.
* @param[in] data - the received data.
* @param[in] len - expected length of the data when IN,
* and real read len when OUT.
* @param[in] addr - remote ip address. Caller manages the
memory (optional).
* @param[in] port - remote port number (optional).
*
* @return 0 - success, -1 - failure
*/
HAL_AT_MQTT_Init:
/**
* Initialize low layer
*
* @param[in] iotx_mqtt_param_t a struct contain usename, password, etc.
*
* @return 0 - success, -1 - failure
*/
int HAL_AT_MQTT_Deinit:
/**
* Deinit low layer
*
* @return 0 - success, -1 - failure
*/
int HAL_AT_MQTT_Connect:
/**
* Setup MQTT Connection
*
* @param[in] product key (optional).
* @param[in] device name (optional).
* @param[in] device Secret (optional).
*
* @return 0 - success, -1 - failure
*/
HAL_AT_MQTT_Disconnect:
/**
* Close MQTT connection
*
* @return 0 - success, -1 - failure
*/
HAL_AT_MQTT_Subscribe:
/**
* Subscribe topic
*
* @param[in] topic
* @param[in] qos
* @param[in] mqtt_packet_id
* @param[out] mqtt_status
* @param[in] timeout_ms
*
* @return 0 - success, -1 - failure
*/
HAL_AT_MQTT_Unsubscribe:
/**
* Unsubscribe topic
*
* @param[in] topic
* @param[in] mqtt_packet_id
* @param[out] mqtt_status
*
* @return 0 - success, -1 - failure
*/
HAL_AT_MQTT_Publish:
/**
* Publish message
*
* @param[in] topic
* @param[in] qos
* @param[in] message
* @param[in] msg_len
*
* @return 0 - success, -1 - failure
*/
HAL_AT_MQTT_State:
/**
* Check connection status
*
* @return 0 - invalid, 1 - initialized, 2 - connected, 3 - disconnected, 4 - disconnect-reconnecting
*/
HAL_DTLSHooks_set:
/**
* @brief Set malloc/free function.
*
* @param [in] hooks: @n Specify malloc/free function you want to use
*
* @retval DTLS_SUCCESS : Success.
@retval other : Fail.
* @see None.
* @note None.
*/
HAL_DTLSSession_create:
/**
* @brief Establish a DSSL connection.
*
* @param [in] p_options: @n Specify paramter of DTLS
@verbatim
p_host : @n Specify the hostname(IP) of the DSSL server
port : @n Specify the DSSL port of DSSL server
p_ca_cert_pem : @n Specify the root certificate which is PEM format.
@endverbatim
* @return DSSL handle.
* @see None.
* @note None.
*/
HAL_DTLSSession_write:
/**
* @brief Write data into the specific DSSL connection.
*
* @param [in] context @n A descriptor identifying a connection.
* @param [in] p_data @n A pointer to a buffer containing the data to be transmitted.
* @param [in] p_datalen @n The length, in bytes, of the data pointed to by the 'p_data' parameter.
* @retval DTLS_SUCCESS : Success.
@retval other : Fail.
* @see None.
*/
HAL_DTLSSession_read:
/**
* @brief Read data from the specific DSSL connection with timeout parameter.
* The API will return immediately if len be received from the specific DSSL connection.
*
* @param [in] context @n A descriptor identifying a DSSL connection.
* @param [in] p_data @n A pointer to a buffer to receive incoming data.
* @param [in] p_datalen @n The length, in bytes, of the data pointed to by the 'p_data' parameter.
* @param [in] timeout_ms @n Specify the timeout value in millisecond. In other words, the API block 'timeout_ms' millisecond maximumly.
* @return The result of read data from DSSL connection
* @retval DTLS_SUCCESS : Read success.
* @retval DTLS_FATAL_ALERT_MESSAGE : Recv peer fatal alert message.
* @retval DTLS_PEER_CLOSE_NOTIFY : The DTLS session was closed by peer.
* @retval DTLS_READ_DATA_FAILED : Read data fail.
* @see None.
*/
HAL_DTLSSession_free:
/**
* @brief Destroy the specific DSSL connection.
*
* @param[in] context: @n Handle of the specific connection.
*
* @return The result of free dtls session
* @retval DTLS_SUCCESS : Read success.
* @retval DTLS_INVALID_PARAM : Invalid parameter.
* @retval DTLS_INVALID_CA_CERTIFICATE : Invalid CA Certificate.
* @retval DTLS_HANDSHAKE_IN_PROGRESS : Handshake in progress.
* @retval DTLS_HANDSHAKE_FAILED : Handshake failed.
* @retval DTLS_FATAL_ALERT_MESSAGE : Recv peer fatal alert message.
* @retval DTLS_PEER_CLOSE_NOTIFY : The DTLS session was closed by peer.
* @retval DTLS_SESSION_CREATE_FAILED : Create session fail.
* @retval DTLS_READ_DATA_FAILED : Read data fail.
*/

View File

@@ -0,0 +1,92 @@
INFRA_STRING||src/infra/infra_string.[ch]|output/eng/infra
INFRA_CJSON||src/infra/infra_cjson.[ch]|output/eng/infra
INFRA_HTTPC||src/infra/infra_httpc.[ch]|output/eng/infra
INFRA_JSON_PARSER||src/infra/infra_json_parser.[ch]|output/eng/infra
INFRA_LOG||src/infra/infra_log.[ch]|output/eng/infra
INFRA_MD5||src/infra/infra_md5.[ch]|output/eng/infra
INFRA_MEM_STATS||src/infra/infra_mem_stats.[ch]|output/eng/infra
INFRA_NET||src/infra/infra_net.[ch]|output/eng/infra
INFRA_REPORT||src/infra/infra_report.[ch]|output/eng/infra
INFRA_SHA256||src/infra/infra_sha256.[ch]|output/eng/infra
INFRA_AES||src/infra/infra_aes.[ch]|output/eng/infra
INFRA_AES||src/infra/infra_aes_config.h|output/eng/infra
INFRA_SHA1||src/infra/infra_sha1.[ch]|output/eng/infra
INFRA_TIMER||src/infra/infra_timer.[ch]|output/eng/infra
INFRA_TIMER||src/infra/infra_timer.[ch]|output/eng/infra
INFRA_PREAUTH||src/infra/infra_preauth.[ch]|output/eng/infra
INFRA_LOG_NETWORK_PAYLOAD||src/infra/infra_prt_nwk_payload.c|output/eng/infra
SUPPORT_TLS||certs/root_ca.c|output/eng/certs
COAP_DTLS_SUPPORT||certs/root_ca.c|output/eng/certs
DEV_SIGN||src/dev_sign|output/eng/dev_sign
DYNAMIC_REGISTER||src/dynamic_register|output/eng/dynamic_register
OTA_ENABLED||src/ota|output/eng/ota
MQTT_COMM_ENABLED||src/mqtt|output/eng/mqtt
MQTT_DEFAULT_IMPL||src/mqtt/impl|output/eng/mqtt
DEVICE_MODEL_ENABLED||src/dev_model|output/eng/dev_model
DEVICE_MODEL_ENABLED||src/dev_model/client|output/eng/dev_model
DEVICE_MODEL_ENABLED||src/dev_model/server|output/eng/dev_model
DEVICE_MODEL_ENABLED||src/dev_model/deprecated|output/eng/dev_model
DEVICE_MODEL_ENABLED&ALCS_ENABLED||src/dev_model/alcs|output/eng/dev_model
DEVICE_MODEL_ENABLED&DEVICE_MODEL_GATEWAY||src/dev_model|output/eng/dev_model
ATM_ENABLED||src/atm/at_api.[ch] src/atm/at_wrapper.h|output/eng/atm
AT_PARSER_ENABLED||src/atm/at_parser.[ch]|output/eng/atm
AT_TCP_ENABLED||src/atm/at_conn_mbox.[ch] src/atm/at_conn_mgmt.[ch] src/atm/at_tcp.c|output/eng/atm
AT_MQTT_ENABLED|MQTT_DEFAULT_IMPL&AT_TCP_ENABLED|src/atm/at_mqtt.[ch]|output/eng/atm
AT_TCP_ENABLED&AT_TCP_HAL_SIM800||wrappers/atm/at_tcp/sim800.c|output/eng/atm
AT_TCP_ENABLED&AT_TCP_HAL_MK3060||wrappers/atm/at_tcp/mk3060.c|output/eng/atm
AT_MQTT_ENABLED&AT_MQTT_HAL_ICA||wrappers/atm/at_mqtt/mqtt_ica.c|output/eng/atm
AT_MQTT_ENABLED&AT_MQTT_HAL_SIM800||wrappers/atm/at_mqtt/mqtt_sim800.c|output/eng/atm
DEV_RESET||src/dev_reset|output/eng/dev_reset
HTTP_COMM_ENABLED||src/http|output/eng/http
HTTP2_COMM_ENABLED||src/http2|output/eng/http2
HTTP2_COMM_ENABLED||external_libs/nghttp2|output/eng/wrappers/external_libs/nghttp2
COAP_COMM_ENABLED||src/coap/client|output/eng/coap_cloud
COAP_COMM_ENABLED||src/coap/CoAPPacket|output/eng/coap_cloud
COAP_COMM_ENABLED||src/coap|output/eng/coap_cloud
COAP_PACKET||src/coap/CoAPPacket|output/eng/CoAPPacket
COAP_SERVER||src/coap|output/eng/coap_server
COAP_SERVER||src/coap/server|output/eng/coap_server/server
WIFI_PROVISION_ENABLED||src/wifi_provision|output/eng/wifi_provision
AWSS_SUPPORT_SMARTCONFIG||src/wifi_provision/smartconfig|output/eng/wifi_provision/smartconfig
AWSS_SUPPORT_AHA||src/wifi_provision/phone_ap|output/eng/wifi_provision/phone_ap
AWSS_SUPPORT_ADHA||src/wifi_provision/router_ap|output/eng/wifi_provision/router_ap
AWSS_SUPPORT_SMARTCONFIG_WPS||src/wifi_provision/p2p|output/eng/wifi_provision/p2p
AWSS_SUPPORT_ZEROCONFIG||src/wifi_provision/zero_config|output/eng/wifi_provision/zero_config
AWSS_SUPPORT_DEV_AP||src/wifi_provision/dev_ap|output/eng/wifi_provision/dev_ap
AWSS_FRAMEWORKS||src/wifi_provision/frameworks|output/eng/wifi_provision/frameworks
AWSS_FRAMEWORKS||src/wifi_provision/frameworks/aplist|output/eng/wifi_provision/frameworks/aplist
AWSS_FRAMEWORKS||src/wifi_provision/frameworks/ieee80211|output/eng/wifi_provision/frameworks/ieee80211
AWSS_FRAMEWORKS||src/wifi_provision/frameworks/statics|output/eng/wifi_provision/frameworks/statics
AWSS_FRAMEWORKS||src/wifi_provision/frameworks/utils|output/eng/wifi_provision/frameworks/utils
AWSS_SUPPORT_APLIST||src/wifi_provision/frameworks/aplist|output/eng/wifi_provision/frameworks/aplist
DEV_BIND_ENABLED||src/dev_bind/|output/eng/dev_bind
DEV_BIND_ENABLED||src/dev_bind/impl|output/eng/dev_bind/impl
DEV_BIND_ENABLED||src/dev_bind/impl/os|output/eng/dev_bind/impl/os
DEV_BIND_ENABLED||src/dev_bind/impl/awss_reset|output/eng/dev_bind/impl/awss_reset
# example rules
DEV_SIGN||src/dev_sign/examples|output/examples
DYNAMIC_REGISTER||src/dynamic_register/examples|output/examples
OTA_ENABLED||src/ota/examples|output/examples
MQTT_COMM_ENABLED|ATM_ENABLED|src/mqtt/examples/mqtt_example.c|output/examples
MQTT_COMM_ENABLED&ATM_ENABLED||src/mqtt/examples/mqtt_example_at.c|output/examples
DEVICE_MODEL_ENABLED||src/dev_model/examples/cJSON.[ch]|output/eng/wrappers/external_libs
DEVICE_MODEL_ENABLED||src/dev_model/examples/linkkit_example_solo.c|output/examples
DEV_RESET||src/dev_reset/examples|output/examples
HTTP_COMM_ENABLED||src/http/examples|output/examples
HTTP2_COMM_ENABLED||src/http2/examples|output/examples
COAP_COMM_ENABLED||src/coap/examples|output/examples

View File

@@ -0,0 +1,464 @@
SUPPORT_TLS||HAL_Malloc|
SUPPORT_TLS||HAL_Free|
SUPPORT_TLS||HAL_UptimeMs|
SUPPORT_TLS||HAL_GetProductSecret|
DYNAMIC_REGISTER||HAL_Malloc|
DYNAMIC_REGISTER||HAL_Free|
DYNAMIC_REGISTER||HAL_Printf|
DYNAMIC_REGISTER||HAL_SSL_Establish|
DYNAMIC_REGISTER||HAL_SSL_Destroy|
DYNAMIC_REGISTER||HAL_SSL_Write|
DYNAMIC_REGISTER||HAL_SSL_Read|
DYNAMIC_REGISTER||HAL_GetProductKey|
DYNAMIC_REGISTER||HAL_GetProductSecret|
DYNAMIC_REGISTER||HAL_GetDeviceName|
DYNAMIC_REGISTER||HAL_Malloc|
DYNAMIC_REGISTER||HAL_Free|
DYNAMIC_REGISTER||HAL_Snprintf|
DYNAMIC_REGISTER||HAL_SleepMs|
DYNAMIC_REGISTER||HAL_UptimeMs|
OTA_ENABLED||HAL_Malloc|
OTA_ENABLED||HAL_Free|
OTA_ENABLED||HAL_Printf|
OTA_ENABLED||HAL_Snprintf|
MQTT_COMM_ENABLED||HAL_Malloc|
MQTT_COMM_ENABLED||HAL_Free|
MQTT_COMM_ENABLED||HAL_Printf|
MQTT_COMM_ENABLED||HAL_Snprintf|
MQTT_COMM_ENABLED||HAL_UptimeMs|
MQTT_COMM_ENABLED||HAL_SleepMs|
MQTT_COMM_ENABLED||HAL_MutexCreate|
MQTT_COMM_ENABLED||HAL_MutexDestroy|
MQTT_COMM_ENABLED||HAL_MutexLock|
MQTT_COMM_ENABLED||HAL_MutexUnlock|
MQTT_COMM_ENABLED||HAL_GetProductKey|
MQTT_COMM_ENABLED||HAL_GetDeviceName|
MQTT_COMM_ENABLED||HAL_GetDeviceSecret|
MQTT_COMM_ENABLED||HAL_GetFirmwareVersion|
MQTT_COMM_ENABLED&MQTT_DEFAULT_IMPL|AT_TCP_ENABLED&AT_MQTT_ENABLED&SUPPORT_TLS|HAL_TCP_Establish|
MQTT_COMM_ENABLED&MQTT_DEFAULT_IMPL|AT_TCP_ENABLED&AT_MQTT_ENABLED&SUPPORT_TLS|HAL_TCP_Destroy|
MQTT_COMM_ENABLED&MQTT_DEFAULT_IMPL|AT_TCP_ENABLED&AT_MQTT_ENABLED&SUPPORT_TLS|HAL_TCP_Write|
MQTT_COMM_ENABLED&MQTT_DEFAULT_IMPL|AT_TCP_ENABLED&AT_MQTT_ENABLED&SUPPORT_TLS|HAL_TCP_Read|
MQTT_COMM_ENABLED&SUPPORT_TLS&MQTT_DEFAULT_IMPL|AT_TCP_ENABLED&AT_MQTT_ENABLED|HAL_SSL_Establish|
MQTT_COMM_ENABLED&SUPPORT_TLS&MQTT_DEFAULT_IMPL|AT_TCP_ENABLED&AT_MQTT_ENABLED|HAL_SSL_Destroy|
MQTT_COMM_ENABLED&SUPPORT_TLS&MQTT_DEFAULT_IMPL|AT_TCP_ENABLED&AT_MQTT_ENABLED|HAL_SSL_Write|
MQTT_COMM_ENABLED&SUPPORT_TLS&MQTT_DEFAULT_IMPL|AT_TCP_ENABLED&AT_MQTT_ENABLED|HAL_SSL_Read|
MQTT_COMM_ENABLED|MQTT_DEFAULT_IMPL&AT_MQTT_ENABLED|wrapper_mqtt_init|mqtt_api.h
MQTT_COMM_ENABLED|MQTT_DEFAULT_IMPL&AT_MQTT_ENABLED|wrapper_mqtt_connect|mqtt_api.h
MQTT_COMM_ENABLED|MQTT_DEFAULT_IMPL&AT_MQTT_ENABLED|wrapper_mqtt_yield|mqtt_api.h
MQTT_COMM_ENABLED|MQTT_DEFAULT_IMPL&AT_MQTT_ENABLED|wrapper_mqtt_check_state|mqtt_api.h
MQTT_COMM_ENABLED|MQTT_DEFAULT_IMPL&AT_MQTT_ENABLED|wrapper_mqtt_subscribe|mqtt_api.h
MQTT_COMM_ENABLED|MQTT_DEFAULT_IMPL&AT_MQTT_ENABLED|wrapper_mqtt_subscribe_sync|mqtt_api.h
MQTT_COMM_ENABLED|MQTT_DEFAULT_IMPL&AT_MQTT_ENABLED|wrapper_mqtt_unsubscribe|mqtt_api.h
MQTT_COMM_ENABLED|MQTT_DEFAULT_IMPL&AT_MQTT_ENABLED|wrapper_mqtt_publish|mqtt_api.h
MQTT_COMM_ENABLED|MQTT_DEFAULT_IMPL&AT_MQTT_ENABLED|wrapper_mqtt_release|mqtt_api.h
MQTT_COMM_ENABLED&ASYNC_PROTOCOL_STACK|MQTT_DEFAULT_IMPL&AT_MQTT_ENABLED|wrapper_mqtt_nwk_event_handler|mqtt_api.h
MQTT_COMM_ENABLED&DYNAMIC_REGISTER||HAL_SetDeviceSecret|
MQTT_COMM_ENABLED&DYNAMIC_REGISTER||HAL_GetProductSecret|
MQTT_COMM_ENABLED&DYNAMIC_REGISTER||HAL_Kv_Set|
MQTT_COMM_ENABLED&DYNAMIC_REGISTER||HAL_Kv_Get|
DEVICE_MODEL_ENABLED||HAL_GetProductKey|
DEVICE_MODEL_ENABLED||HAL_GetProductSecret|
DEVICE_MODEL_ENABLED||HAL_GetDeviceName|
DEVICE_MODEL_ENABLED||HAL_GetDeviceSecret|
DEVICE_MODEL_ENABLED||HAL_Malloc|
DEVICE_MODEL_ENABLED||HAL_Free|
DEVICE_MODEL_ENABLED||HAL_Snprintf|
DEVICE_MODEL_ENABLED||HAL_Vsnprintf|stdarg.h
DEVICE_MODEL_ENABLED||HAL_UptimeMs|
DEVICE_MODEL_ENABLED||HAL_SleepMs|
DEVICE_MODEL_ENABLED||HAL_Srandom|
DEVICE_MODEL_ENABLED||HAL_Random|
DEVICE_MODEL_ENABLED||HAL_MutexCreate|
DEVICE_MODEL_ENABLED||HAL_MutexDestroy|
DEVICE_MODEL_ENABLED||HAL_MutexLock|
DEVICE_MODEL_ENABLED||HAL_MutexUnlock|
DEVICE_MODEL_ENABLED&DYNAMIC_REGISTER||HAL_SetDeviceSecret|
DEVICE_MODEL_ENABLED&THREAD_COST_INTERNAL||HAL_ThreadCreate|
DEVICE_MODEL_ENABLED&THREAD_COST_INTERNAL||HAL_ThreadDelete|
DEVICE_MODEL_ENABLED&THREAD_COST_INTERNAL||HAL_SemaphoreCreate|
DEVICE_MODEL_ENABLED&THREAD_COST_INTERNAL||HAL_SemaphoreDestroy|
DEVICE_MODEL_ENABLED&THREAD_COST_INTERNAL||HAL_SemaphorePost|
DEVICE_MODEL_ENABLED&THREAD_COST_INTERNAL||HAL_SemaphoreWait|
DEVICE_MODEL_ENABLED&OTA_ENABLED||HAL_Firmware_Persistence_Start|
DEVICE_MODEL_ENABLED&OTA_ENABLED||HAL_Firmware_Persistence_Write|
DEVICE_MODEL_ENABLED&OTA_ENABLED||HAL_Firmware_Persistence_Stop|
DEVICE_MODEL_ENABLED&ALCS_ENABLED||HAL_Kv_Set|
DEVICE_MODEL_ENABLED&ALCS_ENABLED||HAL_Kv_Get|
DEVICE_MODEL_ENABLED&ALCS_ENABLED||HAL_Kv_Del|
DEVICE_MODEL_ENABLED&ALCS_ENABLED||HAL_Aes128_Init|
DEVICE_MODEL_ENABLED&ALCS_ENABLED||HAL_Aes128_Cbc_Encrypt|
DEVICE_MODEL_ENABLED&ALCS_ENABLED||HAL_Aes128_Destroy|
DEVICE_MODEL_ENABLED&ALCS_ENABLED||HAL_Aes128_Cbc_Decrypt|
DEVICE_MODEL_ENABLED||HAL_SetProductKey|
DEVICE_MODEL_ENABLED||HAL_SetProductSecret|
DEVICE_MODEL_ENABLED||HAL_SetDeviceName|
DEVICE_MODEL_ENABLED||HAL_SetDeviceSecret|
COAP_SERVER||HAL_UDP_recvfrom|
COAP_SERVER||HAL_UDP_sendto|
COAP_SERVER||HAL_UDP_create_without_connect|
COAP_SERVER||HAL_UDP_close_without_connect|
COAP_SERVER||HAL_UDP_joinmulticast|
COAP_SERVER||HAL_SemaphoreCreate|
COAP_SERVER||HAL_SemaphoreDestroy|
COAP_SERVER||HAL_SemaphorePost|
COAP_SERVER||HAL_SemaphoreWait|
COAP_SERVER||HAL_ThreadCreate|
COAP_SERVER||HAL_ThreadDelete|
COAP_SERVER||HAL_Wifi_Get_IP|
DEV_RESET||HAL_Snprintf|
AT_TCP_ENABLED||HAL_Malloc|
AT_TCP_ENABLED||HAL_Free|
AT_TCP_ENABLED||HAL_Snprintf|
AT_TCP_ENABLED||HAL_UptimeMs|
AT_TCP_ENABLED||HAL_SleepMs|
AT_TCP_ENABLED||HAL_MutexCreate|
AT_TCP_ENABLED||HAL_MutexDestroy|
AT_TCP_ENABLED||HAL_MutexLock|
AT_TCP_ENABLED||HAL_MutexUnlock|
AT_MQTT_ENABLED||HAL_Malloc|
AT_MQTT_ENABLED||HAL_Free|
AT_MQTT_ENABLED||HAL_Snprintf|
AT_MQTT_ENABLED||HAL_UptimeMs|
AT_MQTT_ENABLED||HAL_SleepMs|
AT_MQTT_ENABLED||HAL_MutexCreate|
AT_MQTT_ENABLED||HAL_MutexDestroy|
AT_MQTT_ENABLED||HAL_MutexLock|
AT_MQTT_ENABLED||HAL_MutexUnlock|
AT_PARSER_ENABLED||HAL_Malloc|
AT_PARSER_ENABLED||HAL_Free|
AT_PARSER_ENABLED||HAL_Snprintf|
AT_PARSER_ENABLED||HAL_UptimeMs|
AT_PARSER_ENABLED||HAL_SleepMs|
AT_PARSER_ENABLED||HAL_MutexCreate|
AT_PARSER_ENABLED||HAL_MutexDestroy|
AT_PARSER_ENABLED||HAL_MutexLock|
AT_PARSER_ENABLED||HAL_MutexUnlock|
AT_PARSER_ENABLED&PLATFORM_HAS_OS||HAL_SemaphoreCreate|at_wrapper.h
AT_PARSER_ENABLED&PLATFORM_HAS_OS||HAL_SemaphoreDestroy|at_wrapper.h
AT_PARSER_ENABLED&PLATFORM_HAS_OS||HAL_SemaphorePost|at_wrapper.h
AT_PARSER_ENABLED&PLATFORM_HAS_OS||HAL_SemaphoreWait|at_wrapper.h
AT_PARSER_ENABLED&PLATFORM_HAS_OS||HAL_ThreadCreate|at_wrapper.h
AT_PARSER_ENABLED||HAL_AT_Uart_Init|at_wrapper.h
AT_PARSER_ENABLED||HAL_AT_Uart_Deinit|at_wrapper.h
AT_PARSER_ENABLED||HAL_AT_Uart_Send|at_wrapper.h
AT_PARSER_ENABLED||HAL_AT_Uart_Recv|at_wrapper.h
AT_TCP_ENABLED|AT_TCP_HAL_SIM800&AT_TCP_HAL_MK3060|HAL_AT_CONN_Init|at_wrapper.h
AT_TCP_ENABLED|AT_TCP_HAL_SIM800&AT_TCP_HAL_MK3060|HAL_AT_CONN_Start|at_wrapper.h
AT_TCP_ENABLED|AT_TCP_HAL_SIM800&AT_TCP_HAL_MK3060|HAL_AT_CONN_Send|at_wrapper.h
AT_TCP_ENABLED|AT_TCP_HAL_SIM800&AT_TCP_HAL_MK3060|HAL_AT_CONN_DomainToIp|at_wrapper.h
AT_TCP_ENABLED|AT_TCP_HAL_SIM800&AT_TCP_HAL_MK3060|HAL_AT_CONN_Close|at_wrapper.h
AT_TCP_ENABLED|AT_TCP_HAL_SIM800&AT_TCP_HAL_MK3060|HAL_AT_CONN_Deinit|at_wrapper.h
AT_TCP_ENABLED|AT_TCP_HAL_SIM800&AT_TCP_HAL_MK3060|HAL_AT_CONN_RegInputCb|at_wrapper.h
AT_MQTT_ENABLED|AT_MQTT_HAL_ICA&AT_MQTT_HAL_SIM800|HAL_AT_MQTT_Init|at_wrapper.h
AT_MQTT_ENABLED|AT_MQTT_HAL_ICA&AT_MQTT_HAL_SIM800|HAL_AT_MQTT_Deinit|at_wrapper.h
AT_MQTT_ENABLED|AT_MQTT_HAL_ICA&AT_MQTT_HAL_SIM800|HAL_AT_MQTT_Connect|at_wrapper.h
AT_MQTT_ENABLED|AT_MQTT_HAL_ICA&AT_MQTT_HAL_SIM800|HAL_AT_MQTT_Disconnect|at_wrapper.h
AT_MQTT_ENABLED|AT_MQTT_HAL_ICA&AT_MQTT_HAL_SIM800|HAL_AT_MQTT_Subscribe|at_wrapper.h
AT_MQTT_ENABLED|AT_MQTT_HAL_ICA&AT_MQTT_HAL_SIM800|HAL_AT_MQTT_Unsubscribe|at_wrapper.h
AT_MQTT_ENABLED|AT_MQTT_HAL_ICA&AT_MQTT_HAL_SIM800|HAL_AT_MQTT_Publish|at_wrapper.h
AT_MQTT_ENABLED|AT_MQTT_HAL_ICA&AT_MQTT_HAL_SIM800|HAL_AT_MQTT_State|at_wrapper.h
HTTP_COMM_ENABLED||HAL_Malloc
HTTP_COMM_ENABLED||HAL_Free
HTTP_COMM_ENABLED||HAL_Snprintf
HTTP_COMM_ENABLED||HAL_UptimeMs
HTTP_COMM_ENABLED||HAL_SleepMs
HTTP_COMM_ENABLED||HAL_SSL_Establish
HTTP_COMM_ENABLED||HAL_SSL_Destroy
HTTP_COMM_ENABLED||HAL_SSL_Write
HTTP_COMM_ENABLED||HAL_SSL_Read
HTTP2_COMM_ENABLED||HAL_Malloc|
HTTP2_COMM_ENABLED||HAL_Realloc|
HTTP2_COMM_ENABLED||HAL_Free|
HTTP2_COMM_ENABLED||HAL_Printf|
HTTP2_COMM_ENABLED||HAL_Snprintf|
HTTP2_COMM_ENABLED||HAL_UptimeMs|
HTTP2_COMM_ENABLED||HAL_SleepMs|
HTTP2_COMM_ENABLED||HAL_MutexCreate|
HTTP2_COMM_ENABLED||HAL_MutexDestroy|
HTTP2_COMM_ENABLED||HAL_MutexLock|
HTTP2_COMM_ENABLED||HAL_MutexUnlock|
HTTP2_COMM_ENABLED||HAL_GetProductKey|
HTTP2_COMM_ENABLED||HAL_GetDeviceName|
HTTP2_COMM_ENABLED||HAL_GetDeviceSecret|
HTTP2_COMM_ENABLED||HAL_GetFirmwareVersion|
HTTP2_COMM_ENABLED||HAL_ThreadCreate|
HTTP2_COMM_ENABLED||HAL_ThreadDelete|
HTTP2_COMM_ENABLED||HAL_ThreadDetach|
HTTP2_COMM_ENABLED||HAL_SemaphoreCreate|
HTTP2_COMM_ENABLED||HAL_SemaphoreDestroy|
HTTP2_COMM_ENABLED||HAL_SemaphorePost|
HTTP2_COMM_ENABLED||HAL_SemaphoreWait|
HTTP2_COMM_ENABLED&FS_ENABLED||HAL_Fopen|
HTTP2_COMM_ENABLED&FS_ENABLED||HAL_Fread|
HTTP2_COMM_ENABLED&FS_ENABLED||HAL_Fwrite|
HTTP2_COMM_ENABLED&FS_ENABLED||HAL_Fseek|
HTTP2_COMM_ENABLED&FS_ENABLED||HAL_Fclose|
HTTP2_COMM_ENABLED&FS_ENABLED||HAL_Ftell|
HTTP2_COMM_ENABLED&SUPPORT_TLS||HAL_SSL_Read|
HTTP2_COMM_ENABLED&SUPPORT_TLS||HAL_SSL_Write|
HTTP2_COMM_ENABLED&SUPPORT_TLS||HAL_SSL_Destroy|
HTTP2_COMM_ENABLED&SUPPORT_TLS||HAL_SSL_Establish|
HTTP2_COMM_ENABLED|SUPPORT_TLS|HAL_TCP_Establish|
HTTP2_COMM_ENABLED|SUPPORT_TLS|HAL_TCP_Destroy|
HTTP2_COMM_ENABLED|SUPPORT_TLS|HAL_TCP_Write|
HTTP2_COMM_ENABLED|SUPPORT_TLS|HAL_TCP_Read|
COAP_COMM_ENABLED||HAL_Malloc|
COAP_COMM_ENABLED||HAL_Free|
COAP_COMM_ENABLED||HAL_Snprintf|
COAP_COMM_ENABLED||HAL_UptimeMs|
COAP_COMM_ENABLED||HAL_Srandom|
COAP_COMM_ENABLED||HAL_SleepMs|
COAP_COMM_ENABLED||HAL_Random|
COAP_COMM_ENABLED||HAL_MutexCreate|
COAP_COMM_ENABLED||HAL_MutexDestroy|
COAP_COMM_ENABLED||HAL_MutexLock|
COAP_COMM_ENABLED||HAL_MutexUnlock|
COAP_COMM_ENABLED||HAL_GetProductKey|
COAP_COMM_ENABLED||HAL_GetDeviceName|
COAP_COMM_ENABLED||HAL_GetDeviceSecret|
COAP_COMM_ENABLED&COAP_DTLS_SUPPORT||HAL_DTLSHooks_set|
COAP_COMM_ENABLED&COAP_DTLS_SUPPORT||HAL_DTLSSession_create|
COAP_COMM_ENABLED&COAP_DTLS_SUPPORT||HAL_DTLSSession_write|
COAP_COMM_ENABLED&COAP_DTLS_SUPPORT||HAL_DTLSSession_read|
COAP_COMM_ENABLED&COAP_DTLS_SUPPORT||HAL_DTLSSession_free|
COAP_COMM_ENABLED||HAL_UDP_create|
COAP_COMM_ENABLED||HAL_UDP_write|
COAP_COMM_ENABLED||HAL_UDP_readTimeout|
COAP_COMM_ENABLED||HAL_UDP_close_without_connect|
DEV_BIND_ENABLED||HAL_Awss_Get_Conn_Encrypt_Type|
DEV_BIND_ENABLED||HAL_Snprintf|
DEV_BIND_ENABLED||HAL_GetProductKey|
DEV_BIND_ENABLED||HAL_GetProductSecret|
DEV_BIND_ENABLED||HAL_GetDeviceName|
DEV_BIND_ENABLED||HAL_GetDeviceSecret|
DEV_BIND_ENABLED||HAL_Timer_Create|
DEV_BIND_ENABLED||HAL_Timer_Stop|
DEV_BIND_ENABLED||HAL_Timer_Start|
DEV_BIND_ENABLED||HAL_Timer_Delete|
DEV_BIND_ENABLED||HAL_Wifi_Get_Mac|
DEV_BIND_ENABLED||HAL_Srandom|
DEV_BIND_ENABLED||HAL_Random|
DEV_BIND_ENABLED||HAL_Reboot|
DEV_BIND_ENABLED||HAL_MutexCreate|
DEV_BIND_ENABLED||HAL_SleepMs|
DEV_BIND_ENABLED||HAL_MutexDestroy|
DEV_BIND_ENABLED||HAL_MutexLock|
DEV_BIND_ENABLED||HAL_MutexUnlock|
DEV_BIND_ENABLED||HAL_Malloc|
DEV_BIND_ENABLED||HAL_Free|
DEV_BIND_ENABLED||HAL_Sys_Net_Is_Ready|
DEV_BIND_ENABLED||HAL_UptimeMs|
DEV_BIND_ENABLED||HAL_Wifi_Get_IP|
DEV_BIND_ENABLED||HAL_Kv_Set|
DEV_BIND_ENABLED||HAL_Kv_Get|
AWSS_SUPPORT_SMARTCONFIG||HAL_Timer_Stop|
AWSS_SUPPORT_SMARTCONFIG||HAL_Timer_Delete|
AWSS_SUPPORT_SMARTCONFIG||HAL_Timer_Create|
AWSS_SUPPORT_SMARTCONFIG||HAL_Timer_Start|
AWSS_SUPPORT_SMARTCONFIG||HAL_SleepMs|
AWSS_SUPPORT_SMARTCONFIG||HAL_Malloc|
AWSS_SUPPORT_SMARTCONFIG||HAL_MutexLock|
AWSS_SUPPORT_SMARTCONFIG||HAL_MutexUnlock|
AWSS_SUPPORT_SMARTCONFIG||HAL_UptimeMs|
AWSS_SUPPORT_SMARTCONFIG||HAL_Free|
AWSS_SUPPORT_SMARTCONFIG||HAL_MutexCreate|
AWSS_SUPPORT_SMARTCONFIG||HAL_MutexDestroy|
AWSS_SUPPORT_SMARTCONFIG||HAL_Awss_Get_Timeout_Interval_Ms|
AWSS_SUPPORT_SMARTCONFIG||HAL_Sys_Net_Is_Ready|
AWSS_SUPPORT_SMARTCONFIG||HAL_Wifi_Get_Ap_Info|
AWSS_SUPPORT_SMARTCONFIG||HAL_GetProductKey|
AWSS_SUPPORT_SMARTCONFIG||HAL_GetProductSecret|
AWSS_SUPPORT_SMARTCONFIG||HAL_GetDeviceName|
AWSS_SUPPORT_SMARTCONFIG||HAL_GetDeviceSecret|
AWSS_SUPPORT_SMARTCONFIG||HAL_Awss_Close_Monitor|
AWSS_SUPPORT_SMARTCONFIG||HAL_Awss_Open_Monitor|
AWSS_SUPPORT_SMARTCONFIG||HAL_Awss_Switch_Channel|
AWSS_SUPPORT_SMARTCONFIG||HAL_Awss_Get_Channelscan_Interval_Ms|
AWSS_SUPPORT_SMARTCONFIG|INFRA_AES|HAL_Aes128_Init|os.h
AWSS_SUPPORT_SMARTCONFIG|INFRA_AES|HAL_Aes128_Destroy|os.h
AWSS_SUPPORT_SMARTCONFIG|INFRA_AES|HAL_Aes128_Cfb_Decrypt|os.h
AWSS_SUPPORT_SMARTCONFIG||HAL_Wifi_Get_Mac|
AWSS_SUPPORT_SMARTCONFIG||HAL_Awss_Get_Conn_Encrypt_Type|
AWSS_SUPPORT_SMARTCONFIG||HAL_Awss_Connect_Ap|iot_import_awss.h
AWSS_SUPPORT_SMARTCONFIG||HAL_Awss_Get_Encrypt_Type|
AWSS_SUPPORT_SMARTCONFIG_WPS||HAL_Timer_Stop|
AWSS_SUPPORT_SMARTCONFIG_WPS||HAL_Timer_Delete|
AWSS_SUPPORT_SMARTCONFIG_WPS||HAL_Timer_Create|
AWSS_SUPPORT_SMARTCONFIG_WPS||HAL_Timer_Start|
AWSS_SUPPORT_SMARTCONFIG_WPS||HAL_SleepMs|
AWSS_SUPPORT_SMARTCONFIG_WPS||HAL_Malloc|
AWSS_SUPPORT_SMARTCONFIG_WPS||HAL_MutexLock|
AWSS_SUPPORT_SMARTCONFIG_WPS||HAL_MutexUnlock|
AWSS_SUPPORT_SMARTCONFIG_WPS||HAL_UptimeMs|
AWSS_SUPPORT_SMARTCONFIG_WPS||HAL_Free|
AWSS_SUPPORT_SMARTCONFIG_WPS||HAL_MutexCreate|
AWSS_SUPPORT_SMARTCONFIG_WPS||HAL_MutexDestroy|
AWSS_SUPPORT_SMARTCONFIG_WPS||HAL_Awss_Get_Timeout_Interval_Ms|
AWSS_SUPPORT_SMARTCONFIG_WPS||HAL_Sys_Net_Is_Ready|
AWSS_SUPPORT_SMARTCONFIG_WPS||HAL_Wifi_Get_Ap_Info|
AWSS_SUPPORT_SMARTCONFIG_WPS||HAL_GetProductKey|
AWSS_SUPPORT_SMARTCONFIG_WPS||HAL_GetProductSecret|
AWSS_SUPPORT_SMARTCONFIG_WPS||HAL_GetDeviceName|
AWSS_SUPPORT_SMARTCONFIG_WPS||HAL_GetDeviceSecret|
AWSS_SUPPORT_SMARTCONFIG_WPS||HAL_Awss_Close_Monitor|
AWSS_SUPPORT_SMARTCONFIG_WPS||HAL_Awss_Open_Monitor|
AWSS_SUPPORT_SMARTCONFIG_WPS||HAL_Awss_Switch_Channel|
AWSS_SUPPORT_SMARTCONFIG_WPS||HAL_Awss_Get_Channelscan_Interval_Ms|
AWSS_SUPPORT_SMARTCONFIG_WPS|INFRA_AES|HAL_Aes128_Init|os.h
AWSS_SUPPORT_SMARTCONFIG_WPS|INFRA_AES|HAL_Aes128_Destroy|os.h
AWSS_SUPPORT_SMARTCONFIG_WPS|INFRA_AES|HAL_Aes128_Cfb_Decrypt|os.h
AWSS_SUPPORT_SMARTCONFIG_WPS||HAL_Wifi_Get_Mac|
AWSS_SUPPORT_SMARTCONFIG_WPS||HAL_Awss_Get_Conn_Encrypt_Type|
AWSS_SUPPORT_SMARTCONFIG_WPS||HAL_Awss_Connect_Ap|iot_import_awss.h
AWSS_SUPPORT_SMARTCONFIG_WPS||HAL_Awss_Get_Encrypt_Type|
AWSS_SUPPORT_ZEROCONFIG||HAL_Timer_Stop|
AWSS_SUPPORT_ZEROCONFIG||HAL_Timer_Delete|
AWSS_SUPPORT_ZEROCONFIG||HAL_Timer_Create|
AWSS_SUPPORT_ZEROCONFIG||HAL_Timer_Start|
AWSS_SUPPORT_ZEROCONFIG||HAL_SleepMs|
AWSS_SUPPORT_ZEROCONFIG||HAL_Malloc|
AWSS_SUPPORT_ZEROCONFIG||HAL_MutexLock|
AWSS_SUPPORT_ZEROCONFIG||HAL_MutexUnlock|
AWSS_SUPPORT_ZEROCONFIG||HAL_UptimeMs|
AWSS_SUPPORT_ZEROCONFIG||HAL_Free|
AWSS_SUPPORT_ZEROCONFIG||HAL_MutexCreate|
AWSS_SUPPORT_ZEROCONFIG||HAL_MutexDestroy|
AWSS_SUPPORT_ZEROCONFIG||HAL_Awss_Get_Timeout_Interval_Ms|
AWSS_SUPPORT_ZEROCONFIG||HAL_Sys_Net_Is_Ready|
AWSS_SUPPORT_ZEROCONFIG||HAL_Wifi_Get_Ap_Info|
AWSS_SUPPORT_ZEROCONFIG||HAL_GetProductKey|
AWSS_SUPPORT_ZEROCONFIG||HAL_GetProductSecret|
AWSS_SUPPORT_ZEROCONFIG||HAL_GetDeviceName|
AWSS_SUPPORT_ZEROCONFIG||HAL_GetDeviceSecret|
AWSS_SUPPORT_ZEROCONFIG||HAL_Awss_Close_Monitor|
AWSS_SUPPORT_ZEROCONFIG||HAL_Awss_Open_Monitor|
AWSS_SUPPORT_ZEROCONFIG||HAL_Awss_Switch_Channel|
AWSS_SUPPORT_ZEROCONFIG||HAL_Awss_Get_Channelscan_Interval_Ms|
AWSS_SUPPORT_ZEROCONFIG|INFRA_AES|HAL_Aes128_Init|os.h
AWSS_SUPPORT_ZEROCONFIG|INFRA_AES|HAL_Aes128_Destroy|os.h
AWSS_SUPPORT_ZEROCONFIG|INFRA_AES|HAL_Aes128_Cfb_Decrypt|os.h
AWSS_SUPPORT_ZEROCONFIG||HAL_Aes128_Cfb_Encrypt|os.h
AWSS_SUPPORT_ZEROCONFIG||HAL_Wifi_Get_Mac|
AWSS_SUPPORT_ZEROCONFIG||HAL_Awss_Get_Conn_Encrypt_Type|
AWSS_SUPPORT_ZEROCONFIG||HAL_Awss_Connect_Ap|iot_import_awss.h
AWSS_SUPPORT_ZEROCONFIG||HAL_Wifi_Enable_Mgmt_Frame_Filter|
AWSS_SUPPORT_ZEROCONFIG||HAL_Wifi_Send_80211_Raw_Frame|
AWSS_SUPPORT_AHA||HAL_Timer_Stop|
AWSS_SUPPORT_AHA||HAL_Timer_Delete|
AWSS_SUPPORT_AHA||HAL_Timer_Create|
AWSS_SUPPORT_AHA||HAL_Timer_Start|
AWSS_SUPPORT_AHA||HAL_SleepMs|
AWSS_SUPPORT_AHA||HAL_Malloc|
AWSS_SUPPORT_AHA||HAL_MutexLock|
AWSS_SUPPORT_AHA||HAL_MutexUnlock|
AWSS_SUPPORT_AHA||HAL_UptimeMs|
AWSS_SUPPORT_AHA||HAL_Free|
AWSS_SUPPORT_AHA||HAL_MutexCreate|
AWSS_SUPPORT_AHA||HAL_MutexDestroy|
AWSS_SUPPORT_AHA||HAL_Awss_Get_Timeout_Interval_Ms|
AWSS_SUPPORT_AHA||HAL_Sys_Net_Is_Ready|
AWSS_SUPPORT_AHA||HAL_Wifi_Get_Ap_Info|
AWSS_SUPPORT_AHA||HAL_GetProductKey|
AWSS_SUPPORT_AHA||HAL_GetProductSecret|
AWSS_SUPPORT_AHA||HAL_GetDeviceName|
AWSS_SUPPORT_AHA||HAL_GetDeviceSecret|
AWSS_SUPPORT_AHA||HAL_Awss_Close_Monitor|
AWSS_SUPPORT_AHA||HAL_Awss_Open_Monitor|
AWSS_SUPPORT_AHA||HAL_Awss_Switch_Channel|
AWSS_SUPPORT_AHA||HAL_Awss_Get_Channelscan_Interval_Ms|
AWSS_SUPPORT_AHA|INFRA_AES|HAL_Aes128_Init|os.h
AWSS_SUPPORT_AHA|INFRA_AES|HAL_Aes128_Destroy|os.h
AWSS_SUPPORT_AHA|INFRA_AES|HAL_Aes128_Cbc_Decrypt|os.h
AWSS_SUPPORT_AHA||HAL_Wifi_Get_Mac|
AWSS_SUPPORT_AHA||HAL_Awss_Get_Conn_Encrypt_Type|
AWSS_SUPPORT_AHA||HAL_Awss_Connect_Ap|iot_import_awss.h
AWSS_SUPPORT_ADHA||HAL_Timer_Stop|
AWSS_SUPPORT_ADHA||HAL_Timer_Delete|
AWSS_SUPPORT_ADHA||HAL_Timer_Create|
AWSS_SUPPORT_ADHA||HAL_Timer_Start|
AWSS_SUPPORT_ADHA||HAL_SleepMs|
AWSS_SUPPORT_ADHA||HAL_Malloc|
AWSS_SUPPORT_ADHA||HAL_MutexLock|
AWSS_SUPPORT_ADHA||HAL_MutexUnlock|
AWSS_SUPPORT_ADHA||HAL_UptimeMs|
AWSS_SUPPORT_ADHA||HAL_Free|
AWSS_SUPPORT_ADHA||HAL_MutexCreate|
AWSS_SUPPORT_ADHA||HAL_MutexDestroy|
AWSS_SUPPORT_ADHA||HAL_Awss_Get_Timeout_Interval_Ms|
AWSS_SUPPORT_ADHA||HAL_Sys_Net_Is_Ready|
AWSS_SUPPORT_ADHA||HAL_Wifi_Get_Ap_Info|
AWSS_SUPPORT_ADHA||HAL_GetProductKey|
AWSS_SUPPORT_ADHA||HAL_GetProductSecret|
AWSS_SUPPORT_ADHA||HAL_GetDeviceName|
AWSS_SUPPORT_ADHA||HAL_GetDeviceSecret|
AWSS_SUPPORT_ADHA||HAL_Awss_Close_Monitor|
AWSS_SUPPORT_ADHA||HAL_Awss_Open_Monitor|
AWSS_SUPPORT_ADHA||HAL_Awss_Switch_Channel|
AWSS_SUPPORT_ADHA||HAL_Awss_Get_Channelscan_Interval_Ms|
AWSS_SUPPORT_ADHA||HAL_Aes128_Init|os.h
AWSS_SUPPORT_ADHA||HAL_Aes128_Destroy|os.h
AWSS_SUPPORT_ADHA||HAL_Aes128_Cbc_Decrypt|os.h
AWSS_SUPPORT_ADHA||HAL_Aes128_Cfb_Decrypt|os.h
AWSS_SUPPORT_ADHA||HAL_Wifi_Get_Mac|
AWSS_SUPPORT_ADHA||HAL_Awss_Get_Conn_Encrypt_Type|
AWSS_SUPPORT_ADHA||HAL_Awss_Connect_Ap|iot_import_awss.h
AWSS_SUPPORT_DEV_AP||HAL_Awss_Connect_Ap|iot_import_awss.h
AWSS_SUPPORT_DEV_AP||HAL_Timer_Stop|
AWSS_SUPPORT_DEV_AP||HAL_Timer_Delete|
AWSS_SUPPORT_DEV_AP||HAL_Timer_Create|
AWSS_SUPPORT_DEV_AP||HAL_Timer_Start|
AWSS_SUPPORT_DEV_AP||HAL_SleepMs|
AWSS_SUPPORT_DEV_AP||HAL_Malloc|
AWSS_SUPPORT_DEV_AP||HAL_MutexLock|
AWSS_SUPPORT_DEV_AP||HAL_MutexUnlock|
AWSS_SUPPORT_DEV_AP||HAL_UptimeMs|
AWSS_SUPPORT_DEV_AP||HAL_Free|
AWSS_SUPPORT_DEV_AP||HAL_MutexCreate|
AWSS_SUPPORT_DEV_AP||HAL_MutexDestroy|
AWSS_SUPPORT_DEV_AP||HAL_Sys_Net_Is_Ready|
AWSS_SUPPORT_DEV_AP||HAL_Wifi_Get_Ap_Info|
AWSS_SUPPORT_DEV_AP||HAL_GetProductKey|
AWSS_SUPPORT_DEV_AP||HAL_GetProductSecret|
AWSS_SUPPORT_DEV_AP||HAL_GetDeviceName|
AWSS_SUPPORT_DEV_AP||HAL_GetDeviceSecret|
AWSS_SUPPORT_DEV_AP|INFRA_AES|HAL_Aes128_Init|os.h
AWSS_SUPPORT_DEV_AP|INFRA_AES|HAL_Aes128_Destroy|os.h
AWSS_SUPPORT_DEV_AP|INFRA_AES|HAL_Aes128_Cbc_Decrypt|os.h
AWSS_SUPPORT_DEV_AP|INFRA_AES|HAL_Aes128_Cfb_Decrypt|os.h
AWSS_SUPPORT_DEV_AP||HAL_Wifi_Get_Mac|
AWSS_SUPPORT_DEV_AP||HAL_Awss_Get_Conn_Encrypt_Type|
AWSS_SUPPORT_DEV_AP||HAL_Awss_Close_Ap|
AWSS_SUPPORT_DEV_AP||HAL_Awss_Open_Ap|
AWSS_SUPPORT_AHA||HAL_Wifi_Scan|
AWSS_SUPPORT_AHA||HAL_Wifi_Send_80211_Raw_Frame|

View File

@@ -0,0 +1,4 @@
ifeq (y,$(strip $(FEATURE_HTTP2_COMM_ENABLED)))
CFLAGS := $(filter-out -DFORCE_SSL_VERIFY,$(CFLAGS))
endif

View File

@@ -0,0 +1,17 @@
include $(CURDIR)/tools/internal_make_funcs.mk
SWITCH_VARS := \
$(shell grep '''config [_A-Z]*''' \
$$(find -L $(TOP_DIR)/tools -name 'Config.*') \
| cut -d: -f2 \
| grep -v menuconfig \
| grep -v SRCPATH \
| awk '{ print $$NF }' \
)
SWITCH_VARS := $(foreach V,$(sort $(SWITCH_VARS)),FEATURE_$(V))
$(foreach v, \
$(SWITCH_VARS), \
$(if $(filter y,$($(v))), \
$(eval CFLAGS += -D$(subst FEATURE_,,$(v)))) \
)

View File

@@ -0,0 +1,14 @@
Authors of kconfig-frontends.
The developers of the Linux kernel are the original authors of the kconfig
parser and frontends. The list is too long to reproduce here, but you can
get a pretty complete list from the Linux kernel repository logs:
git shortlog scripts/kconfig
The packaging uses the GNU autotools build system, of which I
will not try to list the many authors here.
The initial packaging was done by:
"Yann E. MORIN" <yann.morin.1998@free.fr>
For a complete list, see the commit-logs of the kconfig repository.

View File

@@ -0,0 +1,357 @@
The kconfig parser and frontends are extracted from the Linux kernel
source tree, which is covered by the GPLv2 only. As Linus Torvalds puts it:
> Also note that the only valid version of the GPL as far as the kernel
> is concerned is _this_ particular version of the license (ie v2, not
> v2.2 or v3.x or whatever), unless explicitly otherwise stated.
Although the above quote explictly mentions the Linux kernel, it is my
understanding that the whole Linux kernel source tree is covered by this
sentence, even non-kernel source code. As such, the license that applies
to the kconfig parser and frontends, as published in this package, are
also covered by this sentence, and available under the GPLv2, and not any
other version of the GPL, unless otherwise stated.
----------------------------------------
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.

View File

@@ -0,0 +1,626 @@
Introduction
------------
The configuration database is a collection of configuration options
organized in a tree structure:
+- Code maturity level options
| +- Prompt for development and/or incomplete code/drivers
+- General setup
| +- Networking support
| +- System V IPC
| +- BSD Process Accounting
| +- Sysctl support
+- Loadable module support
| +- Enable loadable module support
| +- Set version information on all module symbols
| +- Kernel module loader
+- ...
Every entry has its own dependencies. These dependencies are used
to determine the visibility of an entry. Any child entry is only
visible if its parent entry is also visible.
Menu entries
------------
Most entries define a config option; all other entries help to organize
them. A single configuration option is defined like this:
config MODVERSIONS
bool "Set version information on all module symbols"
depends on MODULES
help
Usually, modules have to be recompiled whenever you switch to a new
kernel. ...
Every line starts with a key word and can be followed by multiple
arguments. "config" starts a new config entry. The following lines
define attributes for this config option. Attributes can be the type of
the config option, input prompt, dependencies, help text and default
values. A config option can be defined multiple times with the same
name, but every definition can have only a single input prompt and the
type must not conflict.
Menu attributes
---------------
A menu entry can have a number of attributes. Not all of them are
applicable everywhere (see syntax).
- type definition: "bool"/"tristate"/"string"/"hex"/"int"
Every config option must have a type. There are only two basic types:
tristate and string; the other types are based on these two. The type
definition optionally accepts an input prompt, so these two examples
are equivalent:
bool "Networking support"
and
bool
prompt "Networking support"
- input prompt: "prompt" <prompt> ["if" <expr>]
Every menu entry can have at most one prompt, which is used to display
to the user. Optionally dependencies only for this prompt can be added
with "if".
- default value: "default" <expr> ["if" <expr>]
A config option can have any number of default values. If multiple
default values are visible, only the first defined one is active.
Default values are not limited to the menu entry where they are
defined. This means the default can be defined somewhere else or be
overridden by an earlier definition.
The default value is only assigned to the config symbol if no other
value was set by the user (via the input prompt above). If an input
prompt is visible the default value is presented to the user and can
be overridden by him.
Optionally, dependencies only for this default value can be added with
"if".
- type definition + default value:
"def_bool"/"def_tristate" <expr> ["if" <expr>]
This is a shorthand notation for a type definition plus a value.
Optionally dependencies for this default value can be added with "if".
- dependencies: "depends on" <expr>
This defines a dependency for this menu entry. If multiple
dependencies are defined, they are connected with '&&'. Dependencies
are applied to all other options within this menu entry (which also
accept an "if" expression), so these two examples are equivalent:
bool "foo" if BAR
default y if BAR
and
depends on BAR
bool "foo"
default y
- reverse dependencies: "select" <symbol> ["if" <expr>]
While normal dependencies reduce the upper limit of a symbol (see
below), reverse dependencies can be used to force a lower limit of
another symbol. The value of the current menu symbol is used as the
minimal value <symbol> can be set to. If <symbol> is selected multiple
times, the limit is set to the largest selection.
Reverse dependencies can only be used with boolean or tristate
symbols.
Note:
select should be used with care. select will force
a symbol to a value without visiting the dependencies.
By abusing select you are able to select a symbol FOO even
if FOO depends on BAR that is not set.
In general use select only for non-visible symbols
(no prompts anywhere) and for symbols with no dependencies.
That will limit the usefulness but on the other hand avoid
the illegal configurations all over.
- weak reverse dependencies: "imply" <symbol> ["if" <expr>]
This is similar to "select" as it enforces a lower limit on another
symbol except that the "implied" symbol's value may still be set to n
from a direct dependency or with a visible prompt.
Given the following example:
config FOO
tristate
imply BAZ
config BAZ
tristate
depends on BAR
The following values are possible:
FOO BAR BAZ's default choice for BAZ
--- --- ------------- --------------
n y n N/m/y
m y m M/y/n
y y y Y/n
y n * N
This is useful e.g. with multiple drivers that want to indicate their
ability to hook into a secondary subsystem while allowing the user to
configure that subsystem out without also having to unset these drivers.
- limiting menu display: "visible if" <expr>
This attribute is only applicable to menu blocks, if the condition is
false, the menu block is not displayed to the user (the symbols
contained there can still be selected by other symbols, though). It is
similar to a conditional "prompt" attribute for individual menu
entries. Default value of "visible" is true.
- numerical ranges: "range" <symbol> <symbol> ["if" <expr>]
This allows to limit the range of possible input values for int
and hex symbols. The user can only input a value which is larger than
or equal to the first symbol and smaller than or equal to the second
symbol.
- help text: "help" or "---help---"
This defines a help text. The end of the help text is determined by
the indentation level, this means it ends at the first line which has
a smaller indentation than the first line of the help text.
"---help---" and "help" do not differ in behaviour, "---help---" is
used to help visually separate configuration logic from help within
the file as an aid to developers.
- misc options: "option" <symbol>[=<value>]
Various less common options can be defined via this option syntax,
which can modify the behaviour of the menu entry and its config
symbol. These options are currently possible:
- "defconfig_list"
This declares a list of default entries which can be used when
looking for the default configuration (which is used when the main
.config doesn't exists yet.)
- "modules"
This declares the symbol to be used as the MODULES symbol, which
enables the third modular state for all config symbols.
At most one symbol may have the "modules" option set.
- "env"=<value>
This imports the environment variable into Kconfig. It behaves like
a default, except that the value comes from the environment, this
also means that the behaviour when mixing it with normal defaults is
undefined at this point. The symbol is currently not exported back
to the build environment (if this is desired, it can be done via
another symbol).
- "allnoconfig_y"
This declares the symbol as one that should have the value y when
using "allnoconfig". Used for symbols that hide other symbols.
Menu dependencies
-----------------
Dependencies define the visibility of a menu entry and can also reduce
the input range of tristate symbols. The tristate logic used in the
expressions uses one more state than normal boolean logic to express the
module state. Dependency expressions have the following syntax:
<expr> ::= <symbol> (1)
<symbol> '=' <symbol> (2)
<symbol> '!=' <symbol> (3)
'(' <expr> ')' (4)
'!' <expr> (5)
<expr> '&&' <expr> (6)
<expr> '||' <expr> (7)
Expressions are listed in decreasing order of precedence.
(1) Convert the symbol into an expression. Boolean and tristate symbols
are simply converted into the respective expression values. All
other symbol types result in 'n'.
(2) If the values of both symbols are equal, it returns 'y',
otherwise 'n'.
(3) If the values of both symbols are equal, it returns 'n',
otherwise 'y'.
(4) Returns the value of the expression. Used to override precedence.
(5) Returns the result of (2-/expr/).
(6) Returns the result of min(/expr/, /expr/).
(7) Returns the result of max(/expr/, /expr/).
An expression can have a value of 'n', 'm' or 'y' (or 0, 1, 2
respectively for calculations). A menu entry becomes visible when its
expression evaluates to 'm' or 'y'.
There are two types of symbols: constant and non-constant symbols.
Non-constant symbols are the most common ones and are defined with the
'config' statement. Non-constant symbols consist entirely of alphanumeric
characters or underscores.
Constant symbols are only part of expressions. Constant symbols are
always surrounded by single or double quotes. Within the quote, any
other character is allowed and the quotes can be escaped using '\'.
Menu structure
--------------
The position of a menu entry in the tree is determined in two ways. First
it can be specified explicitly:
menu "Network device support"
depends on NET
config NETDEVICES
...
endmenu
All entries within the "menu" ... "endmenu" block become a submenu of
"Network device support". All subentries inherit the dependencies from
the menu entry, e.g. this means the dependency "NET" is added to the
dependency list of the config option NETDEVICES.
The other way to generate the menu structure is done by analyzing the
dependencies. If a menu entry somehow depends on the previous entry, it
can be made a submenu of it. First, the previous (parent) symbol must
be part of the dependency list and then one of these two conditions
must be true:
- the child entry must become invisible, if the parent is set to 'n'
- the child entry must only be visible, if the parent is visible
config MODULES
bool "Enable loadable module support"
config MODVERSIONS
bool "Set version information on all module symbols"
depends on MODULES
comment "module support disabled"
depends on !MODULES
MODVERSIONS directly depends on MODULES, this means it's only visible if
MODULES is different from 'n'. The comment on the other hand is only
visible when MODULES is set to 'n'.
Kconfig syntax
--------------
The configuration file describes a series of menu entries, where every
line starts with a keyword (except help texts). The following keywords
end a menu entry:
- config
- menuconfig
- choice/endchoice
- comment
- menu/endmenu
- if/endif
- source
The first five also start the definition of a menu entry.
config:
"config" <symbol>
<config options>
This defines a config symbol <symbol> and accepts any of above
attributes as options.
menuconfig:
"menuconfig" <symbol>
<config options>
This is similar to the simple config entry above, but it also gives a
hint to front ends, that all suboptions should be displayed as a
separate list of options. To make sure all the suboptions will really
show up under the menuconfig entry and not outside of it, every item
from the <config options> list must depend on the menuconfig symbol.
In practice, this is achieved by using one of the next two constructs:
(1):
menuconfig M
if M
config C1
config C2
endif
(2):
menuconfig M
config C1
depends on M
config C2
depends on M
In the following examples (3) and (4), C1 and C2 still have the M
dependency, but will not appear under menuconfig M anymore, because
of C0, which doesn't depend on M:
(3):
menuconfig M
config C0
if M
config C1
config C2
endif
(4):
menuconfig M
config C0
config C1
depends on M
config C2
depends on M
choices:
"choice" [symbol]
<choice options>
<choice block>
"endchoice"
This defines a choice group and accepts any of the above attributes as
options. A choice can only be of type bool or tristate. If no type is
specified for a choice, it's type will be determined by the type of
the first choice element in the group or remain unknown if none of the
choice elements have a type specified, as well.
While a boolean choice only allows a single config entry to be
selected, a tristate choice also allows any number of config entries
to be set to 'm'. This can be used if multiple drivers for a single
hardware exists and only a single driver can be compiled/loaded into
the kernel, but all drivers can be compiled as modules.
A choice accepts another option "optional", which allows to set the
choice to 'n' and no entry needs to be selected.
If no [symbol] is associated with a choice, then you can not have multiple
definitions of that choice. If a [symbol] is associated to the choice,
then you may define the same choice (ie. with the same entries) in another
place.
comment:
"comment" <prompt>
<comment options>
This defines a comment which is displayed to the user during the
configuration process and is also echoed to the output files. The only
possible options are dependencies.
menu:
"menu" <prompt>
<menu options>
<menu block>
"endmenu"
This defines a menu block, see "Menu structure" above for more
information. The only possible options are dependencies and "visible"
attributes.
if:
"if" <expr>
<if block>
"endif"
This defines an if block. The dependency expression <expr> is appended
to all enclosed menu entries.
source:
"source" <prompt>
This reads the specified configuration file. This file is always parsed.
mainmenu:
"mainmenu" <prompt>
This sets the config program's title bar if the config program chooses
to use it. It should be placed at the top of the configuration, before any
other statement.
Kconfig hints
-------------
This is a collection of Kconfig tips, most of which aren't obvious at
first glance and most of which have become idioms in several Kconfig
files.
Adding common features and make the usage configurable
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
It is a common idiom to implement a feature/functionality that are
relevant for some architectures but not all.
The recommended way to do so is to use a config variable named HAVE_*
that is defined in a common Kconfig file and selected by the relevant
architectures.
An example is the generic IOMAP functionality.
We would in lib/Kconfig see:
# Generic IOMAP is used to ...
config HAVE_GENERIC_IOMAP
config GENERIC_IOMAP
depends on HAVE_GENERIC_IOMAP && FOO
And in lib/Makefile we would see:
obj-$(CONFIG_GENERIC_IOMAP) += iomap.o
For each architecture using the generic IOMAP functionality we would see:
config X86
select ...
select HAVE_GENERIC_IOMAP
select ...
Note: we use the existing config option and avoid creating a new
config variable to select HAVE_GENERIC_IOMAP.
Note: the use of the internal config variable HAVE_GENERIC_IOMAP, it is
introduced to overcome the limitation of select which will force a
config option to 'y' no matter the dependencies.
The dependencies are moved to the symbol GENERIC_IOMAP and we avoid the
situation where select forces a symbol equals to 'y'.
Build as module only
~~~~~~~~~~~~~~~~~~~~
To restrict a component build to module-only, qualify its config symbol
with "depends on m". E.g.:
config FOO
depends on BAR && m
limits FOO to module (=m) or disabled (=n).
Kconfig recursive dependency limitations
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If you've hit the Kconfig error: "recursive dependency detected" you've run
into a recursive dependency issue with Kconfig, a recursive dependency can be
summarized as a circular dependency. The kconfig tools need to ensure that
Kconfig files comply with specified configuration requirements. In order to do
that kconfig must determine the values that are possible for all Kconfig
symbols, this is currently not possible if there is a circular relation
between two or more Kconfig symbols. For more details refer to the "Simple
Kconfig recursive issue" subsection below. Kconfig does not do recursive
dependency resolution; this has a few implications for Kconfig file writers.
We'll first explain why this issues exists and then provide an example
technical limitation which this brings upon Kconfig developers. Eager
developers wishing to try to address this limitation should read the next
subsections.
Simple Kconfig recursive issue
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Read: Documentation/kbuild/Kconfig.recursion-issue-01
Test with:
make KBUILD_KCONFIG=Documentation/kbuild/Kconfig.recursion-issue-01 allnoconfig
Cumulative Kconfig recursive issue
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Read: Documentation/kbuild/Kconfig.recursion-issue-02
Test with:
make KBUILD_KCONFIG=Documentation/kbuild/Kconfig.recursion-issue-02 allnoconfig
Practical solutions to kconfig recursive issue
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Developers who run into the recursive Kconfig issue have three options
at their disposal. We document them below and also provide a list of
historical issues resolved through these different solutions.
a) Remove any superfluous "select FOO" or "depends on FOO"
b) Match dependency semantics:
b1) Swap all "select FOO" to "depends on FOO" or,
b2) Swap all "depends on FOO" to "select FOO"
c) Consider the use of "imply" instead of "select"
The resolution to a) can be tested with the sample Kconfig file
Documentation/kbuild/Kconfig.recursion-issue-01 through the removal
of the "select CORE" from CORE_BELL_A_ADVANCED as that is implicit already
since CORE_BELL_A depends on CORE. At times it may not be possible to remove
some dependency criteria, for such cases you can work with solution b).
The two different resolutions for b) can be tested in the sample Kconfig file
Documentation/kbuild/Kconfig.recursion-issue-02.
Below is a list of examples of prior fixes for these types of recursive issues;
all errors appear to involve one or more select's and one or more "depends on".
commit fix
====== ===
06b718c01208 select A -> depends on A
c22eacfe82f9 depends on A -> depends on B
6a91e854442c select A -> depends on A
118c565a8f2e select A -> select B
f004e5594705 select A -> depends on A
c7861f37b4c6 depends on A -> (null)
80c69915e5fb select A -> (null) (1)
c2218e26c0d0 select A -> depends on A (1)
d6ae99d04e1c select A -> depends on A
95ca19cf8cbf select A -> depends on A
8f057d7bca54 depends on A -> (null)
8f057d7bca54 depends on A -> select A
a0701f04846e select A -> depends on A
0c8b92f7f259 depends on A -> (null)
e4e9e0540928 select A -> depends on A (2)
7453ea886e87 depends on A > (null) (1)
7b1fff7e4fdf select A -> depends on A
86c747d2a4f0 select A -> depends on A
d9f9ab51e55e select A -> depends on A
0c51a4d8abd6 depends on A -> select A (3)
e98062ed6dc4 select A -> depends on A (3)
91e5d284a7f1 select A -> (null)
(1) Partial (or no) quote of error.
(2) That seems to be the gist of that fix.
(3) Same error.
Future kconfig work
~~~~~~~~~~~~~~~~~~~
Work on kconfig is welcomed on both areas of clarifying semantics and on
evaluating the use of a full SAT solver for it. A full SAT solver can be
desirable to enable more complex dependency mappings and / or queries,
for instance on possible use case for a SAT solver could be that of handling
the current known recursive dependency issues. It is not known if this would
address such issues but such evaluation is desirable. If support for a full SAT
solver proves too complex or that it cannot address recursive dependency issues
Kconfig should have at least clear and well defined semantics which also
addresses and documents limitations or requirements such as the ones dealing
with recursive dependencies.
Further work on both of these areas is welcomed on Kconfig. We elaborate
on both of these in the next two subsections.
Semantics of Kconfig
~~~~~~~~~~~~~~~~~~~~
The use of Kconfig is broad, Linux is now only one of Kconfig's users:
one study has completed a broad analysis of Kconfig use in 12 projects [0].
Despite its widespread use, and although this document does a reasonable job
in documenting basic Kconfig syntax a more precise definition of Kconfig
semantics is welcomed. One project deduced Kconfig semantics through
the use of the xconfig configurator [1]. Work should be done to confirm if
the deduced semantics matches our intended Kconfig design goals.
Having well defined semantics can be useful for tools for practical
evaluation of depenencies, for instance one such use known case was work to
express in boolean abstraction of the inferred semantics of Kconfig to
translate Kconfig logic into boolean formulas and run a SAT solver on this to
find dead code / features (always inactive), 114 dead features were found in
Linux using this methodology [1] (Section 8: Threats to validity).
Confirming this could prove useful as Kconfig stands as one of the the leading
industrial variability modeling languages [1] [2]. Its study would help
evaluate practical uses of such languages, their use was only theoretical
and real world requirements were not well understood. As it stands though
only reverse engineering techniques have been used to deduce semantics from
variability modeling languages such as Kconfig [3].
[0] http://www.eng.uwaterloo.ca/~shshe/kconfig_semantics.pdf
[1] http://gsd.uwaterloo.ca/sites/default/files/vm-2013-berger.pdf
[2] http://gsd.uwaterloo.ca/sites/default/files/ase241-berger_0.pdf
[3] http://gsd.uwaterloo.ca/sites/default/files/icse2011.pdf
Full SAT solver for Kconfig
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Although SAT solvers [0] haven't yet been used by Kconfig directly, as noted in
the previous subsection, work has been done however to express in boolean
abstraction the inferred semantics of Kconfig to translate Kconfig logic into
boolean formulas and run a SAT solver on it [1]. Another known related project
is CADOS [2] (former VAMOS [3]) and the tools, mainly undertaker [4], which has
been introduced first with [5]. The basic concept of undertaker is to exract
variability models from Kconfig, and put them together with a propositional
formula extracted from CPP #ifdefs and build-rules into a SAT solver in order
to find dead code, dead files, and dead symbols. If using a SAT solver is
desirable on Kconfig one approach would be to evaluate repurposing such efforts
somehow on Kconfig. There is enough interest from mentors of existing projects
to not only help advise how to integrate this work upstream but also help
maintain it long term. Interested developers should visit:
http://kernelnewbies.org/KernelProjects/kconfig-sat
[0] http://www.cs.cornell.edu/~sabhar/chapters/SATSolvers-KR-Handbook.pdf
[1] http://gsd.uwaterloo.ca/sites/default/files/vm-2013-berger.pdf
[2] https://cados.cs.fau.de
[3] https://vamos.cs.fau.de
[4] https://undertaker.cs.fau.de
[5] https://www4.cs.fau.de/Publications/2011/tartler_11_eurosys.pdf

View File

@@ -0,0 +1,212 @@
#! /bin/sh
SCRIPTDIR=`dirname $0`
SCRIPTNAME=`basename $0`
# frontends/mconf/$SCRIPTNAME - temporary wrapper script for .libs/$SCRIPTNAME
# Generated by libtool (GNU libtool) 2.4.6
#
# The frontends/mconf/$SCRIPTNAME program cannot be directly executed until all the libtool
# libraries that it depends on are installed.
#
# This wrapper script should never be moved out of the build directory.
# If it is, it will not operate correctly.
# Sed substitution that helps us do robust quoting. It backslashifies
# metacharacters that are still active within double-quoted strings.
sed_quote_subst='s|\([`"$\\]\)|\\\1|g'
# Be Bourne compatible
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
emulate sh
NULLCMD=:
# Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
# is contrary to our usage. Disable this feature.
alias -g '${1+"$@"}'='"$@"'
setopt NO_GLOB_SUBST
else
case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
fi
BIN_SH=xpg4; export BIN_SH # for Tru64
DUALCASE=1; export DUALCASE # for MKS sh
# The HP-UX ksh and POSIX shell print the target directory to stdout
# if CDPATH is set.
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
relink_command=""
# This environment variable determines our operation mode.
if test "$libtool_install_magic" = "%%%MAGIC variable%%%"; then
# install mode needs the following variables:
generated_by_libtool_version='2.4.6'
notinst_deplibs=' ./libs/parser/libkconfig-parser.la'
else
# When we are sourced in execute mode, $file and $ECHO are already set.
if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then
file="$0"
# A function that is used when there is no print builtin or printf.
func_fallback_echo ()
{
eval 'cat <<_LTECHO_EOF
$1
_LTECHO_EOF'
}
ECHO="printf %s\\n"
fi
# Very basic option parsing. These options are (a) specific to
# the libtool wrapper, (b) are identical between the wrapper
# /script/ and the wrapper /executable/ that is used only on
# windows platforms, and (c) all begin with the string --lt-
# (application programs are unlikely to have options that match
# this pattern).
#
# There are only two supported options: --lt-debug and
# --lt-dump-script. There is, deliberately, no --lt-help.
#
# The first argument to this parsing function should be the
# script's ./libtool value, followed by no.
lt_option_debug=
func_parse_lt_options ()
{
lt_script_arg0=$0
shift
for lt_opt
do
case "$lt_opt" in
--lt-debug) lt_option_debug=1 ;;
--lt-dump-script)
lt_dump_D=`$ECHO "X$lt_script_arg0" | /usr/bin/sed -e 's/^X//' -e 's%/[^/]*$%%'`
test "X$lt_dump_D" = "X$lt_script_arg0" && lt_dump_D=.
lt_dump_F=`$ECHO "X$lt_script_arg0" | /usr/bin/sed -e 's/^X//' -e 's%^.*/%%'`
cat "$lt_dump_D/$lt_dump_F"
exit 0
;;
--lt-*)
$ECHO "Unrecognized --lt- option: '$lt_opt'" 1>&2
exit 1
;;
esac
done
# Print the debug banner immediately:
if test -n "$lt_option_debug"; then
echo "$SCRIPTNAME:frontends/mconf/$SCRIPTNAME:$LINENO: libtool wrapper (GNU libtool) 2.4.6" 1>&2
fi
}
# Used when --lt-debug. Prints its arguments to stdout
# (redirection is the responsibility of the caller)
func_lt_dump_args ()
{
lt_dump_args_N=1;
for lt_arg
do
$ECHO "$SCRIPTNAME:frontends/mconf/$SCRIPTNAME:$LINENO: newargv[$lt_dump_args_N]: $lt_arg"
lt_dump_args_N=`expr $lt_dump_args_N + 1`
done
}
# Core function for launching the target application
func_exec_program_core ()
{
if test -n "$lt_option_debug"; then
$ECHO "$SCRIPTNAME:frontends/mconf/$SCRIPTNAME:$LINENO: newargv[0]: $progdir/$program" 1>&2
func_lt_dump_args ${1+"$@"} 1>&2
fi
exec "$progdir/$program" ${1+"$@"}
$ECHO "$0: cannot exec $program $*" 1>&2
exit 1
}
# A function to encapsulate launching the target application
# Strips options in the --lt-* namespace from $@ and
# launches target application with the remaining arguments.
func_exec_program ()
{
case " $* " in
*\ --lt-*)
for lt_wr_arg
do
case $lt_wr_arg in
--lt-*) ;;
*) set x "$@" "$lt_wr_arg"; shift;;
esac
shift
done ;;
esac
func_exec_program_core ${1+"$@"}
}
# Parse options
func_parse_lt_options "$0" ${1+"$@"}
# Find the directory that this script lives in.
thisdir=`$ECHO "$file" | /usr/bin/sed 's%/[^/]*$%%'`
test "x$thisdir" = "x$file" && thisdir=.
# Follow symbolic links until we get to the real thisdir.
file=`ls -ld "$file" | /usr/bin/sed -n 's/.*-> //p'`
while test -n "$file"; do
destdir=`$ECHO "$file" | /usr/bin/sed 's%/[^/]*$%%'`
# If there was a directory component, then change thisdir.
if test "x$destdir" != "x$file"; then
case "$destdir" in
[\\/]* | [A-Za-z]:[\\/]*) thisdir="$destdir" ;;
*) thisdir="$thisdir/$destdir" ;;
esac
fi
file=`$ECHO "$file" | /usr/bin/sed 's%^.*/%%'`
file=`ls -ld "$thisdir/$file" | /usr/bin/sed -n 's/.*-> //p'`
done
# Usually 'no', except on cygwin/mingw when embedded into
# the cwrapper.
WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=no
if test "$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR" = "yes"; then
# special case for '.'
if test "$thisdir" = "."; then
thisdir=`pwd`
fi
# remove .libs from thisdir
case "$thisdir" in
*[\\/].libs ) thisdir=`$ECHO "$thisdir" | /usr/bin/sed 's%[\\/][^\\/]*$%%'` ;;
.libs ) thisdir=. ;;
esac
fi
# Try to get the absolute directory name.
absdir=`cd "$thisdir" && pwd`
test -n "$absdir" && thisdir="$absdir"
program="$SCRIPTNAME"
progdir="$SCRIPTDIR/.libs"
if test -f "$progdir/$program"; then
# Add our own library path to DYLD_LIBRARY_PATH
DYLD_LIBRARY_PATH="$SCRIPTDIR/.libs:$DYLD_LIBRARY_PATH"
# Some systems cannot cope with colon-terminated DYLD_LIBRARY_PATH
# The second colon is a workaround for a bug in BeOS R4 sed
DYLD_LIBRARY_PATH=`$ECHO "$DYLD_LIBRARY_PATH" | /usr/bin/sed 's/::*$//'`
export DYLD_LIBRARY_PATH
if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then
# Run the actual program with our arguments.
func_exec_program ${1+"$@"}
fi
else
# The program doesn't exist.
$ECHO "$0: error: '$progdir/$program' does not exist" 1>&2
$ECHO "This script is just a wrapper for $program." 1>&2
$ECHO "See the libtool documentation for more information." 1>&2
exit 1
fi
fi

View File

@@ -0,0 +1,359 @@
This package contains the PDCurses library. For license information
related to PDCurses see libs/pdcurses-3.4/README
The kconfig parser and frontends are extracted from the Linux kernel
source tree, which is covered by the GPLv2 only. As Linus Torvalds puts it:
> Also note that the only valid version of the GPL as far as the kernel
> is concerned is _this_ particular version of the license (ie v2, not
> v2.2 or v3.x or whatever), unless explicitly otherwise stated.
Although the above quote explictly mentions the Linux kernel, it is my
understanding that the whole Linux kernel source tree is covered by this
sentence, even non-kernel source code. As such, the license that applies
to the kconfig parser and frontends, as published in this package, are
also covered by this sentence, and available under the GPLv2, and not any
other version of the GPL, unless otherwise stated.
----------------------------------------
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.

View File

@@ -0,0 +1,20 @@
This package contains the kconfig frontends and parser.
Kconfig is the configuration language used by the Linux kernel. This package
is a simple copy of the frontends and the parser found in the Linux kernel
source tree, with very minor changes to adapt them to being built out of
the kernel build infrastructure.
This package has been ported to Windows so the code has been changed to get
it work properly. The package also contains a copy PDCurses with some minor
changes.
Under non Windows platforms use the original package from:
http://ymorin.is-a-geek.org/projects/kconfig-frontends
---
All required .dll files were added to the original package from uvc.de.
This package and info about it can be found on http://distortos.org/ website.

View File

@@ -0,0 +1,592 @@
Manifest-Version: 1.0
Name: ./ansi2knr.exe
Digest-Algorithms: SHA MD5
SHA-Digest: JKFAHL0h6kS65/tDdaJMy4e/C0Q=
MD5-Digest: 8IyafiIzNoYb/f6GU3Tmug==
Name: ./awk.exe
Digest-Algorithms: SHA MD5
SHA-Digest: k/Rky5hqlfv35clsxIRZO7/rPQc=
MD5-Digest: NDbqtpiOipEYlRIu0YYoNg==
Name: ./basename.exe
Digest-Algorithms: SHA MD5
SHA-Digest: 5XWEe6QDzdyPJk+XorFG3P2P22A=
MD5-Digest: BNV0TGg42RtjGC+Ojd7jlQ==
Name: ./bash.exe
Digest-Algorithms: SHA MD5
SHA-Digest: iYAwMhbi3+/3i29ZxCPpU/14O5I=
MD5-Digest: AyAkHxQ999gAkLiAJqt5Eg==
Name: ./bc.exe
Digest-Algorithms: SHA MD5
SHA-Digest: M8/ndVOyOotd1DhANwKflbT87aU=
MD5-Digest: T3k4qI5OSgaesuLr/UZkcQ==
Name: ./bison.exe
Digest-Algorithms: SHA MD5
SHA-Digest: v0t85wyFNIrtqW8rlAjy8a/x6Hc=
MD5-Digest: 8vji+jlhya1JO5AQ7Z20Bw==
Name: ./cat.exe
Digest-Algorithms: SHA MD5
SHA-Digest: qcfd22kRyKg+z4Rwu39rrlxGxOI=
MD5-Digest: +/rpWvc+7I1BJxhDpyrcRw==
Name: ./chgrp.exe
Digest-Algorithms: SHA MD5
SHA-Digest: IZlzwsWAIiRUhwjcY03EitLoAlA=
MD5-Digest: QypiYNdzzo9FQUSBY6Q5Cw==
Name: ./chmod.exe
Digest-Algorithms: SHA MD5
SHA-Digest: IZlzwsWAIiRUhwjcY03EitLoAlA=
MD5-Digest: QypiYNdzzo9FQUSBY6Q5Cw==
Name: ./chown.exe
Digest-Algorithms: SHA MD5
SHA-Digest: IZlzwsWAIiRUhwjcY03EitLoAlA=
MD5-Digest: QypiYNdzzo9FQUSBY6Q5Cw==
Name: ./cksum.exe
Digest-Algorithms: SHA MD5
SHA-Digest: stTCi4nqYJWrhoPIM3yoISmiCvk=
MD5-Digest: lcrEEK3ar0yd362rBVlWrw==
Name: ./cmp.exe
Digest-Algorithms: SHA MD5
SHA-Digest: 3xSXy2reU6j2z7NOh6+lZdT3UIo=
MD5-Digest: DoLrUYwa3V7jtH4AShAVJw==
Name: ./comm.exe
Digest-Algorithms: SHA MD5
SHA-Digest: 4Mt4QRihXIF2nFlPX/XdrYnKqLg=
MD5-Digest: cQsqAWbxZbTQ4f9quQkStw==
Name: ./cp.exe
Digest-Algorithms: SHA MD5
SHA-Digest: 4VCa9+PMzPgNEfnqU2BbtBAcT6I=
MD5-Digest: bZJu/l/NiZLoN0Yx+OcY5Q==
Name: ./cpp.exe
Digest-Algorithms: SHA MD5
SHA-Digest: 7Uba6JXgI9MAJUAwJMQj9cUTNmc=
MD5-Digest: 19b1K6u3/rAVx2itnpI5oA==
Name: ./csplit.exe
Digest-Algorithms: SHA MD5
SHA-Digest: TR5ohrygiMx5xMiWdKrNzwCwezk=
MD5-Digest: 9u0w2X/xvBNR1PUECsRC6g==
Name: ./cut.exe
Digest-Algorithms: SHA MD5
SHA-Digest: YpgJ9NI880lLIeAyFM6B1W9B3LM=
MD5-Digest: Ve+LmiS1qZKWxp6yYda53w==
Name: ./cygwin1.dll
Digest-Algorithms: SHA MD5
SHA-Digest: LFtvLMNmwHjLEkm5vkk/ASIFOWs=
MD5-Digest: UljXvjv2g77fsGd43vF2mw==
Name: ./cygwinb19.dll
Digest-Algorithms: SHA MD5
SHA-Digest: DdI5+XOqL+elSBig3Jl0YGTmnGA=
MD5-Digest: guKghiEGxe4BfHq7cvfGgg==
Name: ./date.exe
Digest-Algorithms: SHA MD5
SHA-Digest: Pz1aEfcGWqAUqdtWkSoMvYGkMPM=
MD5-Digest: YBJPtMk9mIUQ4ZRgesMa+Q==
Name: ./dc.exe
Digest-Algorithms: SHA MD5
SHA-Digest: NGT96obq5i5iFSz8VgOX0MfwJHc=
MD5-Digest: 7yl+3uanuddPClG6WcflvQ==
Name: ./dd.exe
Digest-Algorithms: SHA MD5
SHA-Digest: 7pIV1exiJOSqVPGP2YmnOO8gwS8=
MD5-Digest: lBcySrRQwlzUeuLgT9rIww==
Name: ./df.exe
Digest-Algorithms: SHA MD5
SHA-Digest: H7pPzErOi33wBNPPm5PKfyH3p/o=
MD5-Digest: psChbGkuiJJSQVfZvD+7vg==
Name: ./diff.exe
Digest-Algorithms: SHA MD5
SHA-Digest: FKFWq7Vsj+OC9SYFCQDitLbyKyg=
MD5-Digest: kI3nu7h5AeKxHsadXaeC1A==
Name: ./diff3.exe
Digest-Algorithms: SHA MD5
SHA-Digest: xToeIrxWKV20uHu73pDX1T0Ljko=
MD5-Digest: cCwyIOb+CX6Z4lAlPJ2ykA==
Name: ./dircolors.exe
Digest-Algorithms: SHA MD5
SHA-Digest: lHeezXBwgb/lSz8i9NsvNUI0g0o=
MD5-Digest: uv1c+x/UiWoOuizhZO8ONQ==
Name: ./dirname.exe
Digest-Algorithms: SHA MD5
SHA-Digest: rjv+wRLDoIu7aBddixTlJqhffw0=
MD5-Digest: 8z4Hjl0SGnz8kGA1wFG0yw==
Name: ./du.exe
Digest-Algorithms: SHA MD5
SHA-Digest: 27117qhDWABCGp5hqYp4ZiRMx50=
MD5-Digest: DBLl328pcvhnF1hfSS+UdA==
Name: ./echo.exe
Digest-Algorithms: SHA MD5
SHA-Digest: fObe34obY3WZNkwSW5APp6ijo4Q=
MD5-Digest: U8BIZqj3xripkGWFtRdE2w==
Name: ./egrep.exe
Digest-Algorithms: SHA MD5
SHA-Digest: G3usO1KmsIWWjygZcDH7yTyX2Uk=
MD5-Digest: n2s2xAWsMNqXY3co3VFRgw==
Name: ./env.exe
Digest-Algorithms: SHA MD5
SHA-Digest: xp6IX8kPIAPLNONo+V4IgrA7RB8=
MD5-Digest: mQLmxOBGADTpj9pG0vHwMw==
Name: ./expand.exe
Digest-Algorithms: SHA MD5
SHA-Digest: 3svTfj6dOjuomHP7R3UkLJ7/1OA=
MD5-Digest: OxaQ3tyNBYic7i2Xw4cSKQ==
Name: ./expr.exe
Digest-Algorithms: SHA MD5
SHA-Digest: LpJe0Cn+xVu98TtAs/cwHO/3ZVY=
MD5-Digest: jFOMdUivuB6PA3L1R0DZzw==
Name: ./factor.exe
Digest-Algorithms: SHA MD5
SHA-Digest: d76usAQ+uS3/eDcYSaZILHv6Pu0=
MD5-Digest: Dmhhgfb6MpCH1z5uLb2tGA==
Name: ./false
Digest-Algorithms: SHA MD5
SHA-Digest: /mge3+3WhBgfpDDn+qAXGTef6AU=
MD5-Digest: NJvyl8tIKJrr9ECWsWq6+w==
Name: ./fgrep.exe
Digest-Algorithms: SHA MD5
SHA-Digest: uZ3Nt9xEsIIbEAQu7czke2Ptkwc=
MD5-Digest: ZZqMR7wf3jzmcFh0mjgWZw==
Name: ./find.exe
Digest-Algorithms: SHA MD5
SHA-Digest: b13wdvWGwCZ/sAot8dgWTDtmr5M=
MD5-Digest: MwoofSNIDL4drf2OmaNFGg==
Name: ./flex.exe
Digest-Algorithms: SHA MD5
SHA-Digest: rS0byk70JuEoPcoRHKcI5mM1TnA=
MD5-Digest: QVsDromFcEH0goeXf6iUFg==
Name: ./fltcr.exe
Digest-Algorithms: SHA MD5
SHA-Digest: SbT/6Lcq+K34IXi54C8MGiw+TRU=
MD5-Digest: Q4LwYBksRa3fn5jVm7Rq1Q==
Name: ./fmt.exe
Digest-Algorithms: SHA MD5
SHA-Digest: pGVUaNqfCqFLHuHoDvXwAzuMXoE=
MD5-Digest: zm37qlLIXEnSAPWxwwINZA==
Name: ./fold.exe
Digest-Algorithms: SHA MD5
SHA-Digest: WHtrQ5mODZhPnjcj+actuXT7xi0=
MD5-Digest: e5ycGHLKQ49oFR53iMPkWA==
Name: ./gawk.exe
Digest-Algorithms: SHA MD5
SHA-Digest: k/Rky5hqlfv35clsxIRZO7/rPQc=
MD5-Digest: NDbqtpiOipEYlRIu0YYoNg==
Name: ./GPL.txt
Digest-Algorithms: SHA MD5
SHA-Digest: CxhK1Ruip56F0iiNX8+KHqBIHqQ=
MD5-Digest: OTpcpEX2llhz7KAlmhf4Mw==
Name: ./gplay.exe
Digest-Algorithms: SHA MD5
SHA-Digest: vPnwhS3wC4nlUvFDKiITkzf3k1Q=
MD5-Digest: y0VHY8wvZtK2bfcuwFnMjw==
Name: ./grep.exe
Digest-Algorithms: SHA MD5
SHA-Digest: X/MP8UmEggwBlB92fOR/Dzm94mU=
MD5-Digest: uzUKmsIjaz4p8iKed3CfQA==
Name: ./gsar.exe
Digest-Algorithms: SHA MD5
SHA-Digest: TiLHqfyJWHrdxNXdq3EZngjqW1A=
MD5-Digest: 1qAF+PrP+I4mBojdt64AwQ==
Name: ./gunzip.exe
Digest-Algorithms: SHA MD5
SHA-Digest: lffjcQNfJ4uyCbuK9SptwnMXKtk=
MD5-Digest: wpJSIYMCdD/3LpxjWJVAQw==
Name: ./gzip.exe
Digest-Algorithms: SHA MD5
SHA-Digest: lffjcQNfJ4uyCbuK9SptwnMXKtk=
MD5-Digest: wpJSIYMCdD/3LpxjWJVAQw==
Name: ./head.exe
Digest-Algorithms: SHA MD5
SHA-Digest: fx0iHHE9rt55nf5JM7C+ncJJG+o=
MD5-Digest: mFHiYPX2TR6BwkifZg3K1w==
Name: ./id.exe
Digest-Algorithms: SHA MD5
SHA-Digest: Wy/SwrSf3nkC/xIFayu0Cbi55vY=
MD5-Digest: 2HcyZZQfwdONU1wQF1Py4Q==
Name: ./indent.exe
Digest-Algorithms: SHA MD5
SHA-Digest: MaiLj8JtixChhDA2SMifIoNFomg=
MD5-Digest: zGRjQQUI6Y2jPohEJC4yXQ==
Name: ./install.exe
Digest-Algorithms: SHA MD5
SHA-Digest: 7aBZ+QHUGnEX00boySo6Oe4fyGw=
MD5-Digest: QAglgS63+Q9/oKWOhRZv/Q==
Name: ./join.exe
Digest-Algorithms: SHA MD5
SHA-Digest: if9EEGyJsZ4OAxNGlvgZd0uQ+No=
MD5-Digest: KCA0atRPntINaH5RsJ4fJQ==
Name: ./jwhois.exe
Digest-Algorithms: SHA MD5
SHA-Digest: JRgo8ebqWBlz5mvTzkM1bOIvcp4=
MD5-Digest: q6WaPuFxGCXMnI5oo4v4CQ==
Name: ./less.exe
Digest-Algorithms: SHA MD5
SHA-Digest: ymw4p/hm9QEm7LK+cQ0iq0XKvgA=
MD5-Digest: sOcPrRZPb9236grO556shw==
Name: ./ln.exe
Digest-Algorithms: SHA MD5
SHA-Digest: 55ZV7KoP50StvQlE2snPtKR+xbo=
MD5-Digest: YvCPChFbrFvYU7YstqUABw==
Name: ./logname.exe
Digest-Algorithms: SHA MD5
SHA-Digest: oe7RZoYtKyqg7ilH022he7g2baA=
MD5-Digest: 25PZosTcI6Z0nmuwiYZdOA==
Name: ./ls.exe
Digest-Algorithms: SHA MD5
SHA-Digest: lbNGlcmjQWeqy75TFUIwhyT+MHc=
MD5-Digest: VIYZTqgdZUw1s/+GNvTCsg==
Name: ./m4.exe
Digest-Algorithms: SHA MD5
SHA-Digest: a3KaEQVMbRBpxNu9Jz7SytFKu4s=
MD5-Digest: kWtJdlaFJTKmMATFKtlbZg==
Name: ./make.exe
Digest-Algorithms: SHA MD5
SHA-Digest: sNdZjhImpEMoOPaBosP8OXj8rfM=
MD5-Digest: qjlASGNHEEFiDG/Nh00E4g==
Name: ./md5sum.exe
Digest-Algorithms: SHA MD5
SHA-Digest: 7bODklNUx5y7zt2YUGTn8lb8Sf4=
MD5-Digest: BnB7b/9IqpYtSGW6AzhG4g==
Name: ./mkdir.exe
Digest-Algorithms: SHA MD5
SHA-Digest: Uny81RsB03JUtQQngJP0nGp7Izw=
MD5-Digest: 5Y88rozyb3JUcI3MRWMoJw==
Name: ./mkfifo.exe
Digest-Algorithms: SHA MD5
SHA-Digest: v54RHkV6WxudpcZiflZ2ETDMAaI=
MD5-Digest: I+cdfZ0kovmnhZ6IGK2W3A==
Name: ./mknod.exe
Digest-Algorithms: SHA MD5
SHA-Digest: WxCBhxlhk83aAjnHu7F4dMgygmA=
MD5-Digest: 1vytk9o/lkKBY0hmcmPFEw==
Name: ./more.exe
Digest-Algorithms: SHA MD5
SHA-Digest: FNnOalJp7/OpzW4r0ncVY+gdmhM=
MD5-Digest: pV9ZIms9LNTfRJLWGK8Ctw==
Name: ./MSVCRT40.DLL
Digest-Algorithms: SHA MD5
SHA-Digest: 34uloBBEvOU5SCkuwkPgdy4CO4E=
MD5-Digest: eyy2HZJKVmVKJ8m1/XR9UQ==
Name: ./mv.exe
Digest-Algorithms: SHA MD5
SHA-Digest: QdV8xPosVQX/S+PLVrzFV9UDWm0=
MD5-Digest: 3G+pio+z0sEQmzGDwPpxzA==
Name: ./mvdir.exe
Digest-Algorithms: SHA MD5
SHA-Digest: tcB11JKJiZvTv/q52yQJKCTb3w0=
MD5-Digest: NnSW5uWuZhKxez80w1BITQ==
Name: ./nl.exe
Digest-Algorithms: SHA MD5
SHA-Digest: OnIwf2Wy9rIcg64wU7+lJknyXAI=
MD5-Digest: wfURdM5gX/1+gn20pWbueA==
Name: ./od.exe
Digest-Algorithms: SHA MD5
SHA-Digest: Xb9H+hDDO1exFJRoCPvZik4qO4w=
MD5-Digest: B9edA3XkW2ixLu4Uy+p7og==
Name: ./paste.exe
Digest-Algorithms: SHA MD5
SHA-Digest: +oqRs6PEUGiuPheWgbfyzsfNkb4=
MD5-Digest: KMHumnKz/Ggnnza2apgSmw==
Name: ./patch.exe
Digest-Algorithms: SHA MD5
SHA-Digest: qtTFN8TW3OSrfJUejkkgeqqLltA=
MD5-Digest: 6jaqD5CYL58p0CDZ1aqayQ==
Name: ./pr.exe
Digest-Algorithms: SHA MD5
SHA-Digest: cXZR+erjSacLXIb0pIS5JgnawWE=
MD5-Digest: PCG198H3Zbx+LvKKojQVTA==
Name: ./printenv.exe
Digest-Algorithms: SHA MD5
SHA-Digest: VO+wHEvVuXHE/Xhz/Xg54NE/Q7U=
MD5-Digest: Fib3HE9J9OfewxM8ZXB12Q==
Name: ./printf.exe
Digest-Algorithms: SHA MD5
SHA-Digest: prGkgEJ6Oz1y35BqZqI91aWOmfA=
MD5-Digest: pEStlVseF2qqI8/g9tbM+A==
Name: ./Psapi.Dll
Digest-Algorithms: SHA MD5
SHA-Digest: 2b9fC2wROCgbtF5M/r7CxNl1P7I=
MD5-Digest: s9IqSDh1phyyBgx9UY7/wg==
Name: ./pwd.exe
Digest-Algorithms: SHA MD5
SHA-Digest: m+zR6XmKPqAcSzsgxJl1GtYDesI=
MD5-Digest: vQFS8FMQnLHph4eC34Gf3g==
Name: ./README.txt
Digest-Algorithms: SHA MD5
SHA-Digest: rywkWZrP39jcI/7njgsh1rPburc=
MD5-Digest: zGyPVc3VGlr1Ip81kXubFw==
Name: ./recode.exe
Digest-Algorithms: SHA MD5
SHA-Digest: oZZqh6IbdOt0A+zt87bY084tGaA=
MD5-Digest: vucYGgc8di7hhWlMBOF8lA==
Name: ./rm.exe
Digest-Algorithms: SHA MD5
SHA-Digest: ONV4fz0K6DfnV3EYk/48kA9Oxgw=
MD5-Digest: 81ousuDbVLfTu1XxfxHfYg==
Name: ./rman.exe
Digest-Algorithms: SHA MD5
SHA-Digest: M8GP5NGp4Vf6hyAMsmCMLGntYqU=
MD5-Digest: AwEssN+VDv2vEN4ke5kEfw==
Name: ./rmdir.exe
Digest-Algorithms: SHA MD5
SHA-Digest: C+sbFaD3LTzAaUiY91wqfTh/5eQ=
MD5-Digest: Zhrp5bcW2BpSNMSsa+9ZuA==
Name: ./sdiff.exe
Digest-Algorithms: SHA MD5
SHA-Digest: LYWx9CmHLs8SPoDuCvz/KOKk8g0=
MD5-Digest: 33VCVA8//w5w0tmbaEaeKw==
Name: ./sed.exe
Digest-Algorithms: SHA MD5
SHA-Digest: ybbT2hwpbWgnNFNn+Gb83yFUu5U=
MD5-Digest: OjTQF6pOXBHyoymrBNoX9A==
Name: ./seq.exe
Digest-Algorithms: SHA MD5
SHA-Digest: Y5Rxz2793ED2vHLqlPm5jVW8Kig=
MD5-Digest: Qnz2yoeHPKLaqs73CRIYNA==
Name: ./sh.exe
Digest-Algorithms: SHA MD5
SHA-Digest: iYAwMhbi3+/3i29ZxCPpU/14O5I=
MD5-Digest: AyAkHxQ999gAkLiAJqt5Eg==
Name: ./shar.exe
Digest-Algorithms: SHA MD5
SHA-Digest: cPC22nKVT3ywQHW0oGY0iZjLA7s=
MD5-Digest: s7RJ0kyvy7qvxtrnqh1uIQ==
Name: ./sleep.exe
Digest-Algorithms: SHA MD5
SHA-Digest: WhctGKY6ZqjwJoj0XmIqvIqsVCA=
MD5-Digest: HbRAS/SCi9WKzxeFKH2fxA==
Name: ./sort.exe
Digest-Algorithms: SHA MD5
SHA-Digest: OHJfWEJNfv+AgjDm8HWSelUNpr0=
MD5-Digest: a2ZUjxg5arO/KBN9RE5tuw==
Name: ./split.exe
Digest-Algorithms: SHA MD5
SHA-Digest: u1ZBF869Cj3OaeyCuwbF7HihVRE=
MD5-Digest: EigJUq/QWPHwCtM5i3Fo3Q==
Name: ./start_shell.bat
Digest-Algorithms: SHA MD5
SHA-Digest: DY6KU2oyQfs6Su/s4T35X3dildQ=
MD5-Digest: Hq20c3tiCkF3bQeBvOKaYg==
Name: ./su.exe
Digest-Algorithms: SHA MD5
SHA-Digest: K+dYZuoPFwJtZaZKm6rORorVVjg=
MD5-Digest: uKITTDnOc+VaHfzueV2AAw==
Name: ./sum.exe
Digest-Algorithms: SHA MD5
SHA-Digest: 1U/NRj6ONUhIyF//dp6BjFu78u0=
MD5-Digest: gr8PbqEgFrSN5SwqQmxiHg==
Name: ./sync.exe
Digest-Algorithms: SHA MD5
SHA-Digest: BGrRI8i2+4OQDRUgDGwDf/CDXsg=
MD5-Digest: GgMNT6A3KtFQwVqR9VwiyQ==
Name: ./tac.exe
Digest-Algorithms: SHA MD5
SHA-Digest: 3/juVoy86vU00e1rqcnZBq8vEcA=
MD5-Digest: ki4Jc2RXWlwsaKalTJQnaQ==
Name: ./tail.exe
Digest-Algorithms: SHA MD5
SHA-Digest: QfvPdWUi6GlB401ugZUCznJ+ve4=
MD5-Digest: dGC0urlA4iNKOieLsNhDWw==
Name: ./tar.exe
Digest-Algorithms: SHA MD5
SHA-Digest: gKbvkjks18JuMhaFBvYsqoU9GoE=
MD5-Digest: roR2er7Fp2mwx8taNW10xQ==
Name: ./tee.exe
Digest-Algorithms: SHA MD5
SHA-Digest: 50deojLP+keKqJKMs1DaVrXudDc=
MD5-Digest: EW7ClqYbTOmYLZONHCEtVQ==
Name: ./test.exe
Digest-Algorithms: SHA MD5
SHA-Digest: csXkTsQKnySSIggC83H71/wmEQw=
MD5-Digest: c9hnp/SE7DregcG2ChtNFg==
Name: ./touch.exe
Digest-Algorithms: SHA MD5
SHA-Digest: XrKFH7IM52ZgVaQt8sm124vmNwY=
MD5-Digest: juOWFbUBjWZuchK9LifsNA==
Name: ./tr.exe
Digest-Algorithms: SHA MD5
SHA-Digest: cJSLRr5uTYFlvwFLexhVChAp1mE=
MD5-Digest: T98eKS1fbE+mRwDs42qddQ==
Name: ./true
Digest-Algorithms: SHA MD5
SHA-Digest: CfjwAscibty3Es/3u5aJcHq4N24=
MD5-Digest: mn/oRo696E84GqqRoYbf5Q==
Name: ./type.exe
Digest-Algorithms: SHA MD5
SHA-Digest: 3BSLUwhaSVzwisaLb/n7wv5vCLI=
MD5-Digest: vfjOgFq/U9UIvajp6tEFhA==
Name: ./uname.exe
Digest-Algorithms: SHA MD5
SHA-Digest: tURbJRTRnvspZmD08gVlyTLYFDQ=
MD5-Digest: nCIYW/zbT/nc9V02hMEvzQ==
Name: ./unexpand.exe
Digest-Algorithms: SHA MD5
SHA-Digest: DR3cQipnn4zSeVxrDTukEubisRU=
MD5-Digest: yTk0CJwRJ1/SFz3VFvrg5w==
Name: ./uniq.exe
Digest-Algorithms: SHA MD5
SHA-Digest: DVw0wMSRGuSPtvlLyARTvhmj+3A=
MD5-Digest: AtY5Uyrj07C+jeq8MDIoGA==
Name: ./unshar.exe
Digest-Algorithms: SHA MD5
SHA-Digest: 3DbpsDWRAjrsQGn9rRo+IywG0Gs=
MD5-Digest: fIVluyQkA8DWdSk93r4iqg==
Name: ./uudecode.exe
Digest-Algorithms: SHA MD5
SHA-Digest: 6xrB6SwWVmbuWJ0t8KBhCN4tc14=
MD5-Digest: /LTJKQ+6BV2caS0NCLKhaw==
Name: ./uuencode.exe
Digest-Algorithms: SHA MD5
SHA-Digest: UXh+84ex8tHXN+tTWiz2J0S7clI=
MD5-Digest: 1Uo5WNiMkHeWhefTZ+V4ug==
Name: ./vi.exe
Digest-Algorithms: SHA MD5
SHA-Digest: eLMdtPlvVzlvrxTLsgygDnofxEw=
MD5-Digest: SILA5noGpgcvJFtN2ZqfAw==
Name: ./wc.exe
Digest-Algorithms: SHA MD5
SHA-Digest: AW2LWXtyy1FGd1uZaQzH4yVSvks=
MD5-Digest: 1PBaJ8PCv8l3krRxWAl63Q==
Name: ./wget.exe
Digest-Algorithms: SHA MD5
SHA-Digest: IcRXl7PIffXXrsILTUXs+L2JIao=
MD5-Digest: iZvNoV1dA6loNztwgdkSHw==
Name: ./wget.hlp
Digest-Algorithms: SHA MD5
SHA-Digest: vexInI3Qu8xZlnb0vK5324XSE+k=
MD5-Digest: QdEBW1C7EBRoMgdJ6ZAYlw==
Name: ./which.exe
Digest-Algorithms: SHA MD5
SHA-Digest: nA9Ig7l1VxtP+ojfDHL76CApIsA=
MD5-Digest: f9qttYMGCr/lRuzCUNNwAg==
Name: ./whoami.exe
Digest-Algorithms: SHA MD5
SHA-Digest: EdHLe4Iq1IKe2eeB8wlUTP8rh8Q=
MD5-Digest: 0WY3TSZ6K0z49eAKvovt8Q==
Name: ./win32gnu.dll
Digest-Algorithms: SHA MD5
SHA-Digest: 0vRU5Vl+vbuTYUEfizlW8YCiXvo=
MD5-Digest: m9toBnjh+NwUPyI00+9i7w==
Name: ./xargs.exe
Digest-Algorithms: SHA MD5
SHA-Digest: 2HBp4NBDKgZcDOhA37hhHK9a+E8=
MD5-Digest: wamGczNUdDIHkfTji6QWZw==
Name: ./yes.exe
Digest-Algorithms: SHA MD5
SHA-Digest: jDbH+XLN0N5hLp8l4gjlIKEOnDs=
MD5-Digest: geW+vMkigcOesR0237RCWg==

Some files were not shown because too many files have changed in this diff Show More