From b3d96d166c0024baf8f0a162c3cc66b26eed444a Mon Sep 17 00:00:00 2001 From: arvinzzz Date: Sat, 11 Sep 2021 16:05:23 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E6=B8=85=E7=90=86Makefile=E5=86=97?= =?UTF-8?q?=E4=BD=99=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 清理Makefile冗余项,各模块Makefile里不需要再次引用公共路径,只需引用私有头文件路径 close: #I49MOO Signed-off-by: arvinzzz Change-Id: I2dd7189c866498896461f78bfed5444ae1d86876 --- apps/config.mk | 2 +- arch/arm/arm/Makefile | 4 +-- bsd/Makefile | 2 -- bsd/compat/linuxkpi/Makefile | 2 -- bsd/dev/usb/Makefile | 2 -- compat/posix/Makefile | 2 +- drivers/block/disk/Makefile | 2 -- drivers/char/bch/Makefile | 2 +- drivers/char/trace/Makefile | 2 +- drivers/mtd/multi_partition/Makefile | 3 +- fs/fat/Makefile | 8 ++--- fs/fat/virpart/Makefile | 6 ++-- fs/jffs2/Makefile | 3 +- fs/nfs/Makefile | 2 +- fs/proc/Makefile | 2 -- fs/ramfs/Makefile | 2 -- fs/romfs/Makefile | 2 -- fs/rootfs/Makefile | 5 +-- fs/vfs/Makefile | 11 +------ fs/vfs/bcache/Makefile | 5 --- fs/zpfs/Makefile | 2 +- kernel/base/Makefile | 8 +---- kernel/common/Makefile | 2 +- kernel/extended/blackbox/Makefile | 8 ++--- kernel/extended/cppsupport/Makefile | 5 +-- kernel/extended/cpup/Makefile | 5 --- kernel/extended/dynload/Makefile | 6 +--- kernel/extended/hidumper/Makefile | 6 ---- kernel/extended/hilog/Makefile | 4 +-- kernel/extended/liteipc/Makefile | 4 +-- kernel/extended/pipes | 1 - kernel/extended/pipes/BUILD.gn | 46 ++++++++++++++++++++++++++++ kernel/extended/pipes/Makefile | 37 ++++++++++++++++++++++ kernel/extended/power/Makefile | 6 ---- kernel/extended/trace/Makefile | 2 +- kernel/extended/vdso/src/Makefile | 4 +-- lib/libc/Makefile | 5 ++- lib/libscrew/Makefile | 6 ---- security/Makefile | 2 +- security/cap/Makefile | 5 --- shell/Makefile | 7 ++--- syscall/Makefile | 6 ---- tools/build/mk/los_config.mk | 4 +-- 43 files changed, 115 insertions(+), 135 deletions(-) delete mode 120000 kernel/extended/pipes create mode 100644 kernel/extended/pipes/BUILD.gn create mode 100644 kernel/extended/pipes/Makefile diff --git a/apps/config.mk b/apps/config.mk index 3862ce07..6e15ccab 100644 --- a/apps/config.mk +++ b/apps/config.mk @@ -30,7 +30,7 @@ include $(LITEOSTOPDIR)/config.mk # common flags config -BASE_OPTS := -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE $(LITEOS_GCOV_OPTS) +BASE_OPTS := -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE ASFLAGS := CFLAGS := $(LITEOS_COPTS) $(BASE_OPTS) -fPIE diff --git a/arch/arm/arm/Makefile b/arch/arm/arm/Makefile index f12ec1cc..f6cb6a1e 100644 --- a/arch/arm/arm/Makefile +++ b/arch/arm/arm/Makefile @@ -43,8 +43,6 @@ else LOCAL_SRCS += src/startup/reset_vector_up.S endif -LOCAL_FLAGS := $(LITEOS_GCOV_OPTS) - AS_OBJS_LIBC_FLAGS = -D__ASSEMBLY__ # linux style macros LINUX_ARCH_$(LOSCFG_ARCH_ARM_V7A) = -D__LINUX_ARM_ARCH__=7 @@ -56,6 +54,6 @@ LINUX_ARCH_$(LOSCFG_ARCH_ARM_V8M) = -D__LINUX_ARM_ARCH__=8 AS_OBJS_LIBC_FLAGS += $(LINUX_ARCH_y) ifeq ($(LOSCFG_GDB), y) -LOCAL_FLAGS += $(AS_OBJS_LIBC_FLAGS) +LOCAL_FLAGS := $(AS_OBJS_LIBC_FLAGS) endif include $(MODULE) diff --git a/bsd/Makefile b/bsd/Makefile index 33101c2c..353779cd 100644 --- a/bsd/Makefile +++ b/bsd/Makefile @@ -43,6 +43,4 @@ LOCAL_SRCS += $(wildcard crypto/rijndael/*.c) \ $(wildcard libkern/*.c) endif -LOCAL_FLAGS := $(LITEOS_GCOV_OPTS) - include $(MODULE) diff --git a/bsd/compat/linuxkpi/Makefile b/bsd/compat/linuxkpi/Makefile index 1eb41c16..d4e304db 100644 --- a/bsd/compat/linuxkpi/Makefile +++ b/bsd/compat/linuxkpi/Makefile @@ -37,6 +37,4 @@ ifneq ($(LOSCFG_HRTIMER_ENABLE), y) LOCAL_SRCS := $(filter-out src/linux_hrtimer.c, $(LOCAL_SRCS)) endif -LOCAL_FLAGS := $(LITEOS_GCOV_OPTS) - include $(MODULE) diff --git a/bsd/dev/usb/Makefile b/bsd/dev/usb/Makefile index a0fb6e88..f01ea12d 100644 --- a/bsd/dev/usb/Makefile +++ b/bsd/dev/usb/Makefile @@ -135,6 +135,4 @@ LOCAL_SRCS += $(INPUT_SRC)/uhid.c \ $(CORE_SRC)/usb_hid.c endif -LOCAL_FLAGS += $(LITEOS_GCOV_OPTS) - include $(HDF_DRIVER) diff --git a/compat/posix/Makefile b/compat/posix/Makefile index 85c4fedb..cfeb6a3a 100644 --- a/compat/posix/Makefile +++ b/compat/posix/Makefile @@ -35,6 +35,6 @@ LOCAL_SRCS := $(wildcard src/*.c) LOCAL_INCLUDE := -I $(LITEOSTOPDIR)/compat/posix/src -LOCAL_FLAGS := $(LOCAL_INCLUDE) $(LITEOS_GCOV_OPTS) +LOCAL_FLAGS := $(LOCAL_INCLUDE) include $(MODULE) diff --git a/drivers/block/disk/Makefile b/drivers/block/disk/Makefile index e743b7d5..4e35bd1b 100644 --- a/drivers/block/disk/Makefile +++ b/drivers/block/disk/Makefile @@ -33,6 +33,4 @@ MODULE_NAME := $(notdir $(shell pwd)) LOCAL_SRCS := $(wildcard src/*.c) -LOCAL_FLAGS := $(LITEOS_GCOV_OPTS) - include $(MODULE) diff --git a/drivers/char/bch/Makefile b/drivers/char/bch/Makefile index 76ebc566..6774a104 100644 --- a/drivers/char/bch/Makefile +++ b/drivers/char/bch/Makefile @@ -36,6 +36,6 @@ LOCAL_SRCS := $(wildcard $(LITEOSTHIRDPARTY)/NuttX/drivers/bch/*.c) LOCAL_INCLUDE := \ -I $(LITEOSTHIRDPARTY)/NuttX/drivers/bch -LOCAL_FLAGS := $(LOCAL_INCLUDE) $(LITEOS_GCOV_OPTS) +LOCAL_FLAGS := $(LOCAL_INCLUDE) include $(MODULE) diff --git a/drivers/char/trace/Makefile b/drivers/char/trace/Makefile index a79a9cf3..f4fa8887 100644 --- a/drivers/char/trace/Makefile +++ b/drivers/char/trace/Makefile @@ -35,6 +35,6 @@ LOCAL_SRCS := $(wildcard src/*.c) LOCAL_INCLUDE := -I $(LITEOSTOPDIR)/drivers/char/trace/include -LOCAL_FLAGS := $(LOCAL_INCLUDE) $(LITEOS_GCOV_OPTS) +LOCAL_FLAGS := $(LOCAL_INCLUDE) include $(MODULE) diff --git a/drivers/mtd/multi_partition/Makefile b/drivers/mtd/multi_partition/Makefile index e3c6f639..ff995946 100644 --- a/drivers/mtd/multi_partition/Makefile +++ b/drivers/mtd/multi_partition/Makefile @@ -35,13 +35,12 @@ LOCAL_SRCS := $(wildcard src/*.c) LOCAL_INCLUDE := \ -I $(LITEOSTOPDIR)/fs/jffs2/include \ - -I $(LITEOSTOPDIR)/drivers/mtd/multi_partition/include \ -I $(LITEOSTOPDIR)/../../device/hisilicon/drivers/include/mtd/common/include ifeq ($(LOSCFG_PLATFORM_QEMU_ARM_VIRT_CA7), y) LOCAL_INCLUDE += -I $(LITEOSTOPDIR)/../../device/qemu/drivers/cfiflash endif -LOCAL_FLAGS := $(LOCAL_INCLUDE) $(LITEOS_GCOV_OPTS) +LOCAL_FLAGS := $(LOCAL_INCLUDE) include $(MODULE) diff --git a/fs/fat/Makefile b/fs/fat/Makefile index 72b987f3..cc615847 100644 --- a/fs/fat/Makefile +++ b/fs/fat/Makefile @@ -34,13 +34,9 @@ MODULE_NAME := $(notdir $(shell pwd)) LOCAL_SRCS := $(wildcard os_adapt/*.c) LOCAL_SRCS += $(wildcard $(LITEOSTHIRDPARTY)/FatFs/source/*.c) -LOCAL_INCLUDE := \ - -I $(LITEOSTHIRDPARTY)/FatFs/source \ - -I $(LITEOSTOPDIR)/fs/fat/os_adapt \ - -I $(LITEOSTOPDIR)/fs/fat/virpart/include \ - -I $(LITEOSTOPDIR)/fs/vfs \ +LOCAL_INCLUDE := -I $(LITEOSTOPDIR)/fs/fat/os_adapt -LOCAL_FLAGS := $(LOCAL_INCLUDE) $(LITEOS_GCOV_OPTS) +LOCAL_FLAGS := $(LOCAL_INCLUDE) include $(MODULE) diff --git a/fs/fat/virpart/Makefile b/fs/fat/virpart/Makefile index 3ba118c3..d06b559d 100644 --- a/fs/fat/virpart/Makefile +++ b/fs/fat/virpart/Makefile @@ -33,10 +33,8 @@ MODULE_NAME := $(notdir $(shell pwd)) LOCAL_SRCS := $(wildcard src/*.c) -LOCAL_INCLUDE := \ - -I $(LITEOSTOPDIR)/fs/fat/virpart/include \ - -I $(LITEOSTOPDIR)/fs/fat/os_adapt +LOCAL_INCLUDE := -I $(LITEOSTOPDIR)/fs/fat/os_adapt -LOCAL_FLAGS := $(LOCAL_INCLUDE) $(LITEOS_GCOV_OPTS) +LOCAL_FLAGS := $(LOCAL_INCLUDE) include $(MODULE) diff --git a/fs/jffs2/Makefile b/fs/jffs2/Makefile index a778ca55..09c9fefd 100644 --- a/fs/jffs2/Makefile +++ b/fs/jffs2/Makefile @@ -35,10 +35,9 @@ LOCAL_SRCS := $(wildcard src/*.c) \ $(wildcard $(LITEOSTHIRDPARTY)/Linux_Kernel/fs/jffs2/*.c) LOCAL_INCLUDE := \ -I $(LITEOSTOPDIR)/fs/jffs2/include \ - -I $(LITEOSTOPDIR)/drivers/mtd/multi_partition/include \ -I $(LITEOSTHIRDPARTY)/Linux_Kernel/fs/jffs2 \ -I $(LITEOSTHIRDPARTY)/Linux_Kernel/fs -LOCAL_FLAGS := $(LOCAL_INCLUDE) $(LITEOS_GCOV_OPTS) +LOCAL_FLAGS := $(LOCAL_INCLUDE) include $(MODULE) diff --git a/fs/nfs/Makefile b/fs/nfs/Makefile index 5b999391..4991913a 100644 --- a/fs/nfs/Makefile +++ b/fs/nfs/Makefile @@ -33,6 +33,6 @@ MODULE_NAME := $(notdir $(shell pwd)) LOCAL_SRCS := $(wildcard $(LITEOSTHIRDPARTY)/NuttX/fs/nfs/*.c) -LOCAL_FLAGS := $(LOCAL_INCLUDE) $(LITEOS_GCOV_OPTS) +LOCAL_FLAGS := $(LOCAL_INCLUDE) include $(MODULE) diff --git a/fs/proc/Makefile b/fs/proc/Makefile index 2b8d72e6..943fa35b 100644 --- a/fs/proc/Makefile +++ b/fs/proc/Makefile @@ -33,6 +33,4 @@ MODULE_NAME := $(notdir $(shell pwd)) LOCAL_SRCS := $(wildcard os_adapt/*.c) $(wildcard src/*.c) -LOCAL_FLAGS := $(LITEOS_GCOV_OPTS) - include $(MODULE) \ No newline at end of file diff --git a/fs/ramfs/Makefile b/fs/ramfs/Makefile index 4f8e3b9f..dce8aef8 100644 --- a/fs/ramfs/Makefile +++ b/fs/ramfs/Makefile @@ -33,6 +33,4 @@ MODULE_NAME := $(notdir $(shell pwd)) LOCAL_SRCS := $(wildcard $(LITEOSTHIRDPARTY)/NuttX/fs/tmpfs/*.c) -LOCAL_FLAGS := $(LOCAL_INCLUDE) $(LITEOS_GCOV_OPTS) - include $(MODULE) diff --git a/fs/romfs/Makefile b/fs/romfs/Makefile index 49d97302..4d40ec5c 100644 --- a/fs/romfs/Makefile +++ b/fs/romfs/Makefile @@ -32,6 +32,4 @@ MODULE_NAME := $(notdir $(shell pwd)) LOCAL_SRCS := $(wildcard $(LITEOSTHIRDPARTY)/NuttX/fs/romfs/*.c) -LOCAL_FLAGS := $(LOCAL_INCLUDE) $(LITEOS_GCOV_OPTS) - include $(MODULE) diff --git a/fs/rootfs/Makefile b/fs/rootfs/Makefile index 6762cab4..a5e8213c 100644 --- a/fs/rootfs/Makefile +++ b/fs/rootfs/Makefile @@ -33,14 +33,11 @@ MODULE_NAME := rootfs LOCAL_SRCS := $(wildcard los_rootfs.c los_bootargs.c) -LOCAL_INCLUDE := \ - -I $(LITEOSTOPDIR)/kernel/common \ - ifeq ($(LOSCFG_PLATFORM_QEMU_ARM_VIRT_CA7), y) LOCAL_INCLUDE += -I $(LITEOSTOPDIR)/../../device/qemu/drivers/cfiflash endif -LOCAL_FLAGS := $(LOCAL_INCLUDE) $(LITEOS_GCOV_OPTS) +LOCAL_FLAGS := $(LOCAL_INCLUDE) include $(MODULE) diff --git a/fs/vfs/Makefile b/fs/vfs/Makefile index c45a4f30..240db04b 100644 --- a/fs/vfs/Makefile +++ b/fs/vfs/Makefile @@ -95,19 +95,10 @@ $(LITEOSTHIRDPARTY)/NuttX/fs/driver/fs_unregisterdriver.c \ $(wildcard vfs_cmd/*.c) LOCAL_INCLUDE := \ - -I $(LITEOSTOPDIR)/fs/vfs/include \ - -I $(LITEOSTOPDIR)/fs/vfs/include/bcache\ - -I $(LITEOSTOPDIR)/drivers/block/disk/include\ -I $(LITEOSTOPDIR)/drivers/char/bch/include\ - -I $(LITEOSTOPDIR)/drivers/mtd/multi_partition/include\ - -I $(LITEOSTOPDIR)/fs/vfs/include/operation\ -I $(LITEOSTOPDIR)/syscall\ -I $(LITEOSTOPDIR)/fs/zpfs/include -ifeq ($(LOSCFG_FS_FAT), y) -LOCAL_INCLUDE += -I $(LITEOSTHIRDPARTY)/FatFs/source -endif - -LOCAL_FLAGS := $(LOCAL_INCLUDE) $(LITEOS_GCOV_OPTS) +LOCAL_FLAGS := $(LOCAL_INCLUDE) include $(MODULE) diff --git a/fs/vfs/bcache/Makefile b/fs/vfs/bcache/Makefile index 0fb1100a..01e51cb4 100644 --- a/fs/vfs/bcache/Makefile +++ b/fs/vfs/bcache/Makefile @@ -33,10 +33,5 @@ MODULE_NAME := $(notdir $(shell pwd)) LOCAL_SRCS := $(wildcard src/*.c) -LOCAL_INCLUDE := \ - -I $(LITEOSTHIRDPARTY)/FatFs/source - -LOCAL_FLAGS := $(LOCAL_INCLUDE) $(LITEOS_GCOV_OPTS) - include $(MODULE) diff --git a/fs/zpfs/Makefile b/fs/zpfs/Makefile index a3339c33..9584e738 100644 --- a/fs/zpfs/Makefile +++ b/fs/zpfs/Makefile @@ -35,6 +35,6 @@ LOCAL_SRCS := $(wildcard src/*.c) LOCAL_INCLUDE := \ -I $(LITEOSTOPDIR)/fs/zpfs/include -LOCAL_FLAGS := $(LOCAL_INCLUDE) $(LITEOS_GCOV_OPTS) +LOCAL_FLAGS := $(LOCAL_INCLUDE) include $(MODULE) diff --git a/kernel/base/Makefile b/kernel/base/Makefile index d20fc229..b805e2b9 100644 --- a/kernel/base/Makefile +++ b/kernel/base/Makefile @@ -40,12 +40,6 @@ LOCAL_SRCS := $(wildcard ipc/*.c) $(wildcard core/*.c) $(wildcard mem/membox/*. $(wildcard sched/sched_sq/*.c) \ $(wildcard vm/*.c) -LOCAL_INCLUDE := \ - -I $(LITEOSTOPDIR)/kernel/base/include \ - -I $(LITEOSTOPDIR)/kernel/extended/include \ - -I $(LITEOSTOPDIR)/kernel/base/mem \ - -I $(LITEOSTOPDIR)/kernel/base/vm - -LOCAL_FLAGS := $(LITEOS_CFLAGS_INTERWORK) $(LOCAL_INCLUDE) $(LITEOS_GCOV_OPTS) +LOCAL_FLAGS := $(LITEOS_CFLAGS_INTERWORK) include $(MODULE) diff --git a/kernel/common/Makefile b/kernel/common/Makefile index 0bfc44e8..4a474095 100644 --- a/kernel/common/Makefile +++ b/kernel/common/Makefile @@ -41,6 +41,6 @@ ifneq ($(LOSCFG_FS_VFS), y) LOCAL_SRCS := $(filter-out console.c virtual_serial.c, $(LOCAL_SRCS)) endif -LOCAL_FLAGS := $(LOCAL_INCLUDE) $(LITEOS_GCOV_OPTS) +LOCAL_FLAGS := $(LOCAL_INCLUDE) include $(MODULE) diff --git a/kernel/extended/blackbox/Makefile b/kernel/extended/blackbox/Makefile index 190bcb42..cc7a3cc4 100644 --- a/kernel/extended/blackbox/Makefile +++ b/kernel/extended/blackbox/Makefile @@ -4,12 +4,8 @@ MODULE_NAME := $(notdir $(shell pwd)) LOCAL_SRCS := $(wildcard *.c) -LOCAL_INCLUDE := \ - -I $(LITEOSTOPDIR)/kernel/common \ - -I $(LITEOSTOPDIR)/kernel/common/blackbox \ - -I $(LITEOSTOPDIR)/syscall \ - -I $(LITEOSTOPDIR)/kernel/base/include +LOCAL_INCLUDE := -I $(LITEOSTOPDIR)/syscall -LOCAL_FLAGS := $(LOCAL_INCLUDE) $(LITEOS_GCOV_OPTS) +LOCAL_FLAGS := $(LOCAL_INCLUDE) include $(MODULE) diff --git a/kernel/extended/cppsupport/Makefile b/kernel/extended/cppsupport/Makefile index 826bd05a..7d3a2662 100644 --- a/kernel/extended/cppsupport/Makefile +++ b/kernel/extended/cppsupport/Makefile @@ -35,9 +35,6 @@ MODULE_NAME := $(notdir $(shell pwd)) LOCAL_SRCS := $(wildcard *.c) -LOCAL_INCLUDE := \ - -I $(LITEOSTOPDIR)/kernel/base/include -I $(LITEOSTOPDIR)/kernel/extended/include - -LOCAL_FLAGS := $(LITEOS_CFLAGS_INTERWORK) $(LOCAL_INCLUDE) $(LITEOS_GCOV_OPTS) +LOCAL_FLAGS := $(LITEOS_CFLAGS_INTERWORK) include $(MODULE) diff --git a/kernel/extended/cpup/Makefile b/kernel/extended/cpup/Makefile index 61b09029..8d11bbf2 100644 --- a/kernel/extended/cpup/Makefile +++ b/kernel/extended/cpup/Makefile @@ -33,9 +33,4 @@ MODULE_NAME := $(notdir $(shell pwd)) LOCAL_SRCS := $(wildcard *.c) -LOCAL_INCLUDE := \ - -I $(LITEOSTOPDIR)/kernel/base/include -I $(LITEOSTOPDIR)/kernel/extended/include - -LOCAL_FLAGS := $(LOCAL_INCLUDE) $(LITEOS_GCOV_OPTS) - include $(MODULE) diff --git a/kernel/extended/dynload/Makefile b/kernel/extended/dynload/Makefile index 6d719c2c..a0ffc4d0 100644 --- a/kernel/extended/dynload/Makefile +++ b/kernel/extended/dynload/Makefile @@ -33,10 +33,6 @@ MODULE_NAME := $(notdir $(shell pwd)) LOCAL_SRCS := $(wildcard src/*.c) -LOCAL_INCLUDE := \ - -I $(LITEOSTOPDIR)/kernel/base/include \ - -I $(LITEOSTOPDIR)/fs/include - -LOCAL_FLAGS := $(LITEOS_CFLAGS_INTERWORK) $(LOCAL_INCLUDE) $(LITEOS_GCOV_OPTS) +LOCAL_FLAGS := $(LITEOS_CFLAGS_INTERWORK) include $(MODULE) diff --git a/kernel/extended/hidumper/Makefile b/kernel/extended/hidumper/Makefile index 230c1d8a..eab29ad3 100644 --- a/kernel/extended/hidumper/Makefile +++ b/kernel/extended/hidumper/Makefile @@ -4,10 +4,4 @@ MODULE_NAME := $(notdir $(shell pwd)) LOCAL_SRCS := $(wildcard *.c) -LOCAL_INCLUDE := \ - -I $(LITEOSTOPDIR)/kernel/common \ - -I $(LITEOSTOPDIR)/kernel/common/hidumper \ - -LOCAL_FLAGS := $(LOCAL_INCLUDE) $(LITEOS_GCOV_OPTS) - include $(MODULE) diff --git a/kernel/extended/hilog/Makefile b/kernel/extended/hilog/Makefile index eef9b37a..1ae10896 100644 --- a/kernel/extended/hilog/Makefile +++ b/kernel/extended/hilog/Makefile @@ -33,8 +33,6 @@ MODULE_NAME := $(notdir $(shell pwd)) LOCAL_SRCS := $(wildcard *.c) -LOCAL_INCLUDE := -I $(LITEOSTOPDIR)/kernel/base/include - -LOCAL_FLAGS := $(LITEOS_CFLAGS_INTERWORK) $(LOCAL_INCLUDE) $(LITEOS_GCOV_OPTS) +LOCAL_FLAGS := $(LITEOS_CFLAGS_INTERWORK) include $(MODULE) diff --git a/kernel/extended/liteipc/Makefile b/kernel/extended/liteipc/Makefile index 3af1a504..f94e8b8c 100644 --- a/kernel/extended/liteipc/Makefile +++ b/kernel/extended/liteipc/Makefile @@ -30,8 +30,6 @@ include $(LITEOSTOPDIR)/config.mk MODULE_NAME := $(notdir $(shell pwd)) -ifeq ($(LOSCFG_KERNEL_LITEIPC), y) - LOCAL_SRCS += $(wildcard ./*.c) -endif +LOCAL_SRCS := $(wildcard ./*.c) include $(MODULE) diff --git a/kernel/extended/pipes b/kernel/extended/pipes deleted file mode 120000 index 9ab05035..00000000 --- a/kernel/extended/pipes +++ /dev/null @@ -1 +0,0 @@ -../../../../third_party/NuttX/drivers/pipes \ No newline at end of file diff --git a/kernel/extended/pipes/BUILD.gn b/kernel/extended/pipes/BUILD.gn new file mode 100644 index 00000000..85058ea0 --- /dev/null +++ b/kernel/extended/pipes/BUILD.gn @@ -0,0 +1,46 @@ +# Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. +# Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, this list of +# conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, this list +# of conditions and the following disclaimer in the documentation and/or other materials +# provided with the distribution. +# +# 3. Neither the name of the copyright holder nor the names of its contributors may be used +# to endorse or promote products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import("//kernel/liteos_a/liteos.gni") + +module_switch = defined(LOSCFG_KERNEL_PIPE) +module_name = get_path_info(rebase_path("."), "name") +kernel_module(module_name) { + sources = [ + "//third_party/NuttX/drivers/pipes/fifo.c", + "//third_party/NuttX/drivers/pipes/pipe.c", + "//third_party/NuttX/drivers/pipes/pipe_common.c", + ] + + public_configs = [ ":public" ] +} + +config("public") { + include_dirs = [ "//third_party/NuttX/drivers/pipes" ] +} diff --git a/kernel/extended/pipes/Makefile b/kernel/extended/pipes/Makefile new file mode 100644 index 00000000..72b274bd --- /dev/null +++ b/kernel/extended/pipes/Makefile @@ -0,0 +1,37 @@ +# Copyright (c) 2013-2019, Huawei Technologies Co., Ltd. All rights reserved. +# Copyright (c) 2020, Huawei Device Co., Ltd. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, this list of +# conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, this list +# of conditions and the following disclaimer in the documentation and/or other materials +# provided with the distribution. +# +# 3. Neither the name of the copyright holder nor the names of its contributors may be used +# to endorse or promote products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +include $(LITEOSTOPDIR)/config.mk + +MODULE_NAME := $(notdir $(shell pwd)) + +LOCAL_DIR := $(LITEOSTOPDIR)/../../third_party/NuttX/drivers/pipes + +LOCAL_SRCS := $(wildcard $(LOCAL_DIR)/*.c) + +include $(MODULE) diff --git a/kernel/extended/power/Makefile b/kernel/extended/power/Makefile index eb849846..8d11bbf2 100644 --- a/kernel/extended/power/Makefile +++ b/kernel/extended/power/Makefile @@ -33,10 +33,4 @@ MODULE_NAME := $(notdir $(shell pwd)) LOCAL_SRCS := $(wildcard *.c) -LOCAL_INCLUDE := -I $(LITEOSTOPDIR)/kernel/base/include \ - -I $(LITEOSTOPDIR)/kernel/extended/include \ - -I $(LITEOSTOPDIR)/arch/arm/include - -LOCAL_FLAGS := $(LOCAL_INCLUDE) $(LITEOS_GCOV_OPTS) - include $(MODULE) diff --git a/kernel/extended/trace/Makefile b/kernel/extended/trace/Makefile index 2fe469d8..68fa8315 100644 --- a/kernel/extended/trace/Makefile +++ b/kernel/extended/trace/Makefile @@ -56,7 +56,7 @@ LOCAL_SRCS += $(wildcard pipeline/serial/*.c) LOCAL_INCLUDE += -I $(LITEOSTOPDIR)/kernel/extended/trace/pipeline/serial endif -LOCAL_FLAGS := $(LOCAL_INCLUDE) $(LITEOS_GCOV_OPTS) +LOCAL_FLAGS := $(LOCAL_INCLUDE) include $(MODULE) diff --git a/kernel/extended/vdso/src/Makefile b/kernel/extended/vdso/src/Makefile index eacf8d24..ee2c229d 100644 --- a/kernel/extended/vdso/src/Makefile +++ b/kernel/extended/vdso/src/Makefile @@ -33,8 +33,6 @@ MODULE_NAME := $(notdir $(shell pwd)/../vdso) LOCAL_SRCS := $(wildcard *.c) $(wildcard *.S) -LOCAL_INCLUDE := -I $(LITEOSTOPDIR)/kernel/base/include -I ../include - -LOCAL_FLAGS := $(LOCAL_INCLUDE) -DOHOS_VDSO_SO=\"$(OUT)/lib/OHOS-vdso.so\" +LOCAL_FLAGS := -DOHOS_VDSO_SO=\"$(OUT)/lib/OHOS-vdso.so\" include $(MODULE) \ No newline at end of file diff --git a/lib/libc/Makefile b/lib/libc/Makefile index 7671a46a..562d957b 100644 --- a/lib/libc/Makefile +++ b/lib/libc/Makefile @@ -49,12 +49,11 @@ endif LOCAL_INCLUDE := \ -I $(LITEOSTOPDIR)/syscall \ - -I $(LITEOSTOPDIR)/bsd/dev/random \ - -I $(LITEOSTOPDIR)/bsd/compat/linuxkpi/include + -I $(LITEOSTOPDIR)/bsd/dev/random LOCAL_INCLUDE += $(addprefix -I$(MUSLPORTINGDIR)/, src/include src/internal) -LOCAL_FLAGS := $(LOCAL_INCLUDE) $(LITEOS_GCOV_OPTS) $(LOCAL_CMACRO) +LOCAL_FLAGS := $(LOCAL_INCLUDE) $(LOCAL_CMACRO) ifeq ($(LOSCFG_COMPILER_CLANG_LLVM), y) LOCAL_FLAGS +=-Wno-char-subscripts -Wno-unknown-pragmas else diff --git a/lib/libscrew/Makefile b/lib/libscrew/Makefile index 4f0f70a5..a9d14d08 100644 --- a/lib/libscrew/Makefile +++ b/lib/libscrew/Makefile @@ -6,10 +6,4 @@ LOCAL_SRCS := \ $(wildcard src/*.c) \ $(LITEOSTOPDIR)/../../third_party/FreeBSD/sys/libkern/crc32.c -LOCAL_INCLUDE := \ - -I $(LITEOSTOPDIR)/kernel/include \ - -I $(LITEOSTOPDIR)/lib/libscrew/include \ - -LOCAL_FLAGS := $(LOCAL_INCLUDE) $(LITEOS_GCOV_OPTS) - include $(MODULE) diff --git a/security/Makefile b/security/Makefile index a300fb89..e17501e9 100644 --- a/security/Makefile +++ b/security/Makefile @@ -43,6 +43,6 @@ LOCAL_SRCS += $(wildcard vid/*.c) LOCAL_INCLUDE += -I $(LITEOSTOPDIR)/security/vid endif -LOCAL_FLAGS := $(LOCAL_INCLUDE) $(LITEOS_GCOV_OPTS) +LOCAL_FLAGS := $(LOCAL_INCLUDE) include $(MODULE) diff --git a/security/cap/Makefile b/security/cap/Makefile index a32f48af..8d11bbf2 100644 --- a/security/cap/Makefile +++ b/security/cap/Makefile @@ -33,9 +33,4 @@ MODULE_NAME := $(notdir $(shell pwd)) LOCAL_SRCS := $(wildcard *.c) -LOCAL_INCLUDE := \ - -I $(LITEOSTOPDIR)/security/cap - -LOCAL_FLAGS := $(LOCAL_INCLUDE) $(LITEOS_GCOV_OPTS) - include $(MODULE) diff --git a/shell/Makefile b/shell/Makefile index d49850a1..c5cd6a3d 100644 --- a/shell/Makefile +++ b/shell/Makefile @@ -35,13 +35,10 @@ ifeq ($(LOSCFG_SHELL), y) LOCAL_SRCS := $(wildcard full/src/base/*.c) $(wildcard full/src/cmds/*.c) LOCAL_INCLUDE := \ -I $(LITEOSTOPDIR)/fs/nfs \ - -I $(LITEOSTOPDIR)/shell/full/include \ - -I $(LITEOSTOPDIR)/fs/ramfs \ - -I $(LITEOSTOPDIR)/fs/fat \ - -I $(LITEOSTOPDIR)/kernel/base/include \ + -I $(LITEOSTOPDIR)/fs/ramfs endif -LOCAL_FLAGS := $(LOCAL_INCLUDE) $(LITEOS_GCOV_OPTS) +LOCAL_FLAGS := $(LOCAL_INCLUDE) include $(MODULE) diff --git a/syscall/Makefile b/syscall/Makefile index d4dc0c72..cf93130d 100644 --- a/syscall/Makefile +++ b/syscall/Makefile @@ -37,10 +37,4 @@ ifneq ($(LOSCFG_NET_LWIP_SACK), y) LOCAL_SRCS := $(filter-out net_syscall.c, $(LOCAL_SRCS)) endif -LOCAL_INCLUDE := -I $(LITEOSTOPDIR)/kernel/base/include \ - -I $(LITEOSTOPDIR)/kernel/extended/dynload/include \ - -I $(LITEOSTOPDIR)/fs/include \ - -I $(LITEOSTOPDIR)/compat/posix/include \ - -I $(LITEOSTOPDIR)/bsd/compat/linuxkpi/include \ - -I $(LITEOSTOPDIR)/../../third_party/musl/kernel/include include $(MODULE) diff --git a/tools/build/mk/los_config.mk b/tools/build/mk/los_config.mk index 13306c66..b9bad187 100644 --- a/tools/build/mk/los_config.mk +++ b/tools/build/mk/los_config.mk @@ -166,7 +166,7 @@ endif ifeq ($(LOSCFG_KERNEL_PIPE), y) LITEOS_BASELIB += -lpipes LIB_SUBDIRS += kernel/extended/pipes - LITEOS_PIPE_INCLUDE += -I $(LITEOSTOPDIR)/kernel/extended/pipes + LITEOS_PIPE_INCLUDE += -I $(LITEOSTOPDIR)/../../third_party/NuttX/drivers/pipes endif ifeq ($(LOSCFG_KERNEL_PM), y) @@ -241,7 +241,6 @@ endif -I $(LITEOSTOPDIR)/fs/vfs/include LITEOS_VFS_INCLUDE += -I $(LITEOSTOPDIR)/fs/vfs/include/operation LITEOS_VFS_MTD_INCLUDE := -I $(LITEOSTOPDIR)/drivers/mtd/multi_partition/include - LITEOS_VFS_DISK_INCLUDE := -I $(LITEOSTOPDIR)/drivers/block/disk/include endif ifeq ($(LOSCFG_FS_FAT), y) @@ -259,6 +258,7 @@ endif ifeq ($(LOSCFG_FS_FAT_DISK), y) LITEOS_BASELIB += -ldisk LIB_SUBDIRS += $(LITEOSTOPDIR)/drivers/block/disk + LITEOS_VFS_DISK_INCLUDE := -I $(LITEOSTOPDIR)/drivers/block/disk/include endif ifeq ($(LOSCFG_FS_FAT_CACHE), y) -- GitLab