From 26066618aea9f9e391fe053857ef8f050cd2e178 Mon Sep 17 00:00:00 2001 From: zhang Date: Thu, 11 Nov 2021 18:53:28 +0800 Subject: [PATCH 1/2] add hcs macro config Signed-off-by: zhang --- Makefile | 1 + test/hcs_macro/Makefile | 55 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+) create mode 100755 test/hcs_macro/Makefile diff --git a/Makefile b/Makefile index 8cd9a97..68f4bca 100644 --- a/Makefile +++ b/Makefile @@ -32,6 +32,7 @@ ifeq ($(CONFIG_DRIVERS_HDF), y) ifeq ($(CONFIG_DRIVERS_HDF_TEST), y) obj-$(CONFIG_DRIVERS_HDF) += ../../../../$(PRODUCT_PATH)/hdf_config/$(SUB_DIR)/hdf_test/ obj-$(CONFIG_DRIVERS_HDF) += test/ +obj-$(CONFIG_DRIVERS_HDF) += test/hcs_macro/ else obj-$(CONFIG_DRIVERS_HDF) += ../../../../$(PRODUCT_PATH)/hdf_config/$(SUB_DIR) endif diff --git a/test/hcs_macro/Makefile b/test/hcs_macro/Makefile new file mode 100755 index 0000000..3d9229c --- /dev/null +++ b/test/hcs_macro/Makefile @@ -0,0 +1,55 @@ +# Copyright (c) 2020 Huawei Device Co., Ltd. +# 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. + +ccflags-$(CONFIG_DRIVERS_HDF_TEST) += -I$(srctree)/include/hdf \ + -I$(srctree)/include/hdf/osal \ + -I$(srctree)/include/hdf/utils \ + -I$(srctree)/drivers/hdf/khdf/osal/include \ + -I$(srctree)/drivers/hdf/framework/utils/include + +CURRENT_DIR := $(abspath $(dir $(realpath $(lastword $(MAKEFILE_LIST))))) + +SOURCE_ROOT := $(abspath $(CURRENT_DIR)/../../../../../../) + +HDF_FRAMWORK_TEST_ROOT = $(abspath $(SOURCE_ROOT)/drivers/framework/test/unittest/utils/hcs_parser/unittest) + +HC_GEN_DIR := $(abspath $(SOURCE_ROOT)/drivers/framework/tools/hc-gen) + +HC_GEN := $(HC_GEN_DIR)/build/hc-gen + +HCS_MACRO_OBJ := hcs_macro_cases.o + +HCS_MACRO_SRC := $(HDF_FRAMWORK_TEST_ROOT)/hcs_macro_cases.c + +HCS_DEP := $(HDF_FRAMWORK_TEST_ROOT)/hdf_macro_test.h + +HCS_MACRO_FILE := $(subst .h,, $(HCS_DEP)) + +HCS_FILE := $(SOURCE_ROOT)/$(PRODUCT_PATH)/hdf_config/hdf_test/hdf.hcs + +$(warning CURRENT_DIR = $(CURRENT_DIR)) +$(warning HCS_MACRO_SRC = $(HCS_MACRO_SRC)) +$(warning HCS_MACRO_FILE = $(HCS_MACRO_FILE)) +$(warning HCS_FILE = $(HCS_FILE)) + +$(obj)/$(HCS_MACRO_OBJ): $(HCS_MACRO_SRC) $(HCS_DEP) + $(Q)$(CC) $(c_flags) -c -o $@ $< + +$(HCS_DEP): $(HC_GEN) + $(Q)echo gen hdf built-in config macro + $(Q)$(HC_GEN) -m -o $(HCS_MACRO_FILE) $(HCS_FILE) + +$(HC_GEN): + $(HIDE)make -C $(HC_GEN_DIR) + +obj-$(CONFIG_DRIVERS_HDF) += $(HCS_MACRO_OBJ) -- Gitee From 11bd9301abf9ee5107881d2ff78fc7679f3df632 Mon Sep 17 00:00:00 2001 From: zhang Date: Thu, 11 Nov 2021 20:21:56 +0800 Subject: [PATCH 2/2] add hcs macro config Signed-off-by: zhang --- test/hcs_macro/Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/hcs_macro/Makefile b/test/hcs_macro/Makefile index 3d9229c..7704bde 100755 --- a/test/hcs_macro/Makefile +++ b/test/hcs_macro/Makefile @@ -17,6 +17,10 @@ ccflags-$(CONFIG_DRIVERS_HDF_TEST) += -I$(srctree)/include/hdf \ -I$(srctree)/drivers/hdf/khdf/osal/include \ -I$(srctree)/drivers/hdf/framework/utils/include +SUPPORT_LEVEL_STD_H := $(shell [ "$(CONFIG_HDF_SUPPORT_LEVEL)" -ge 2 ] && echo true) +ifeq ($(SUPPORT_LEVEL_STD_H), true) +SUB_DIR:=khdf/ +endif CURRENT_DIR := $(abspath $(dir $(realpath $(lastword $(MAKEFILE_LIST))))) SOURCE_ROOT := $(abspath $(CURRENT_DIR)/../../../../../../) @@ -35,7 +39,7 @@ HCS_DEP := $(HDF_FRAMWORK_TEST_ROOT)/hdf_macro_test.h HCS_MACRO_FILE := $(subst .h,, $(HCS_DEP)) -HCS_FILE := $(SOURCE_ROOT)/$(PRODUCT_PATH)/hdf_config/hdf_test/hdf.hcs +HCS_FILE := $(SOURCE_ROOT)/$(PRODUCT_PATH)/hdf_config/$(SUB_DIR)/hdf_test/hdf.hcs $(warning CURRENT_DIR = $(CURRENT_DIR)) $(warning HCS_MACRO_SRC = $(HCS_MACRO_SRC)) -- Gitee