提交 0e260949 编写于 作者: C Caoruihong

feat(make): optimize makefiles and remove some unused files

Signed-off-by: NCaoruihong <crh.cao@huawei.com>
Change-Id: Ie2dfa7334417ccd55bd56a19a7882a982ce49cab
上级 752aa490
......@@ -32,6 +32,7 @@ import("//build/lite/config/component/lite_component.gni")
declare_args() {
tee_enable = false
liteos_name = "OHOS_Image"
liteos_skip_make = false
}
cmd = "if [ -f $device_path/BUILD.gn ]; then echo true; else echo false; fi"
......@@ -189,6 +190,9 @@ config("los_common") {
]
defines = [ "__LITEOS__" ]
if (!defined(LOSCFG_DEBUG_VERSION)) {
defines += [ "NDEBUG" ]
}
cflags_c = [ "-std=c99" ]
......@@ -262,6 +266,11 @@ config("los_common") {
"-mthumb",
"-Wa,-mimplicit-it=thumb",
]
if (defined(LOSCFG_COMPILER_CLANG_LLVM)) {
# llvm-as do not support "-mimplicit-it=thumb" option currently,
# so we remove it temporary.
cflags -= [ "-Wa,-mimplicit-it=thumb" ]
}
}
asmflags = cflags
......@@ -375,7 +384,11 @@ build_ext_component("make") {
outdir = rebase_path(get_path_info(".", "out_dir"))
sysroot_path = rebase_path(ohos_current_sysroot)
arch_cflags = string_join(" ", target_arch_cflags)
command = "./build.sh ${board_name} ${ohos_build_compiler} ${root_build_dir} ${ohos_build_type} \"${tee_enable}\""
command += " \"${device_company}\" \"${product_path}\" $outdir \"${ohos_version}\" ${sysroot_path} \"${arch_cflags}\""
command += " \"${device_path}\""
command = "./build.sh \"$board_name\" \"$ohos_build_compiler\" \"$root_build_dir\" \"$ohos_build_type\" \"$tee_enable\""
command += " \"$device_company\" \"$product_path\" \"$outdir\" \"$ohos_version\" \"$sysroot_path\" \"$arch_cflags\""
command += " \"$device_path\" \"$compile_prefix\""
if (liteos_skip_make) {
print("build_ext_component \"$target_name\" skipped:", command)
command = "true"
}
}
......@@ -193,8 +193,8 @@ config DEBUG_VERSION
default n
help
If you do not select this option that means you enable a release version for LiteOS.
It also means you do not want to use debug modules, like shell,telnet,tftp,
,nfs,ramfs proc and memory check.
It also means you do not want to use debug modules, like shell,telnet,tftp,nfs and
memory check, etc.
If you select this option that means you enable a debug version for LiteOS.
That means you want a opposite behaviour compared to release version.
......
......@@ -28,51 +28,26 @@
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
LITEOSTOPDIR := $(realpath $(dir $(firstword $(MAKEFILE_LIST))))
LITEOSTHIRDPARTY := $(LITEOSTOPDIR)/../../third_party
export LITEOSTOPDIR
export LITEOSTHIRDPARTY
APPS = apps
ROOTFS = rootfs
LITEOS_TARGET = liteos
LITEOS_LIBS_TARGET = libs
KCONFIG_CMDS := $(notdir $(wildcard $(dir $(shell which menuconfig))*config))
# by the following eval, we would got some variables like these:
# ohos_root_path=/xx
# ohos_board=hispark_taurus
# ohos_kernel=liteos_a
# ohos_product=ipcamera_hispark_taurus
# ohos_product_path=/xx/vendor/hisilicon/hispark_taurus
# ohos_device_path=/xx/device/hisilicon/hispark_taurus/sdk_liteos
ohos_kernel ?= liteos_a
$(foreach line,$(shell hb env | sed 's/\[OHOS INFO\]/ohos/g;s/ /_/g;s/:_/=/g' || true),$(eval $(line)))
ifneq ($(ohos_kernel),liteos_a)
$(error The selected product ($(ohos_product)) is not a liteos_a kernel type product)
endif
export CONFIG_=LOSCFG_
export srctree=$(LITEOSTOPDIR)
SYSROOT_PATH ?= $(LITEOSTOPDIR)/../../prebuilts/lite/sysroot
export SYSROOT_PATH
LITEOS_MENUCONFIG_H ?= $(LITEOSTOPDIR)/config.h
export LITEOS_MENUCONFIG_H
CONFIG_FILE ?= $(LITEOSTOPDIR)/.config
export CONFIG_FILE
ifeq ($(PRODUCT_PATH),)
PRODUCT_PATH:=$(ohos_product_path)
endif
export PRODUCT_PATH
ifeq ($(DEVICE_PATH),)
DEVICE_PATH:=$(ohos_device_path)
endif
export DEVICE_PATH
ifeq ($(TEE:1=y),y)
tee = _tee
......@@ -84,9 +59,25 @@ CONFIG ?= $(PRODUCT_PATH)/kernel_configs/debug$(tee).config
endif
KCONFIG_CONFIG ?= $(CONFIG)
export KCONFIG_CONFIG
SYSROOT_PATH ?= $(LITEOSTOPDIR)/../../prebuilts/lite/sysroot
LITEOS_MENUCONFIG_H ?= $(LITEOSTOPDIR)/config.h
LITEOS_CONFIG_FILE ?= $(LITEOSTOPDIR)/.config
-include $(LITEOSTOPDIR)/tools/build/config.mk
# export los_config.mk related environment variables
export LITEOSTOPDIR
export LITEOS_MENUCONFIG_H
export LITEOS_CONFIG_FILE
# export subdir Makefile related environment variables
export SYSROOT_PATH
export PRODUCT_PATH
export DEVICE_PATH
# export kconfig related environment variables
export CONFIG_=LOSCFG_
export srctree=$(LITEOSTOPDIR)
include $(LITEOSTOPDIR)/config.mk
ifeq ($(LOSCFG_STORAGE_SPINOR), y)
FSTYPE = jffs2
......@@ -112,16 +103,19 @@ Targets:
clean: clean compiled objects
cleanall: clean all build outputs
all: make liteos kernel image and rootfs image (Default target)
rootfs: make a original rootfs image
$(APPS): build all apps
$(ROOTFS): make a original rootfs image
$(LITEOS_LIBS_TARGET): compile all kernel modules (libraries)
$(LITEOS_TARGET): make liteos kernel image
update_config: update product kernel config (use menuconfig)
xxconfig: invoke xxconfig command of kconfiglib (xxconfig is one of $(KCONFIG_CMDS))
Parameters:
FSTYPE: value should be one of (jffs2 vfat yaffs2)
TEE: boolean value(1 or y for true), enable tee
RELEASE: boolean value(1 or y for true), build release version
CONFIG: kernel config file to be use
args: arguments for xxconfig command
-------------------------------------------------------
endef
export HELP
......@@ -139,27 +133,22 @@ endif
$(HIDE)echo "sysroot:" $(abspath $(SYSROOT_PATH))
endif
KCONFIG_CMDS := $(notdir $(wildcard $(dir $(shell which menuconfig))*config))
$(KCONFIG_CMDS):
$(HIDE)$@ $(args)
$(LITEOS_MENUCONFIG_H) $(CONFIG_FILE): $(KCONFIG_CONFIG)
$(HIDE)genconfig --config-out $(CONFIG_FILE) --header-path $(LITEOS_MENUCONFIG_H) $(args)
$(LITEOS_CONFIG_FILE): $(KCONFIG_CONFIG)
$(HIDE)env KCONFIG_CONFIG=$< genconfig --config-out $@ --header-path $(LITEOS_MENUCONFIG_H)
update_config:
$(HIDE)test -f "$(CONFIG)" && cp -v "$(CONFIG)" .config && menuconfig && savedefconfig --out "$(CONFIG)"
prepare: $(LITEOS_MENUCONFIG_H)
$(HIDE)mkdir -p $(OUT)/musl $(OUT)/lib $(BUILD)
$(LITEOS_LIBS_TARGET): prepare
$(HIDE)touch $(LOSCFG_ENTRY_SRC)
$(HIDE)for dir in $(LITEOS_SUBDIRS); do $(MAKE) -C $$dir all || exit 1; done
$(LITEOS_LIBS_TARGET):
$(HIDE)for dir in $(LIB_SUBDIRS); do $(MAKE) -C $$dir all || exit 1; done
$(LITEOS_TARGET): $(OUT)/$(LITEOS_TARGET)
$(LITEOS_TARGET): $(OUT)/$(LITEOS_TARGET).map
#$(LITEOS_TARGET): $(OUT)/$(LITEOS_TARGET).objsize
$(LITEOS_TARGET): $(LITEOS_TARGET_DIR)/$(LITEOS_TARGET).bin
$(LITEOS_TARGET): $(OUT)/$(LITEOS_TARGET).bin
$(LITEOS_TARGET): $(OUT)/$(LITEOS_TARGET).sym.sorted
$(LITEOS_TARGET): $(OUT)/$(LITEOS_TARGET).asm
#$(LITEOS_TARGET): $(OUT)/$(LITEOS_TARGET).size
......@@ -169,7 +158,7 @@ $(OUT)/$(LITEOS_TARGET): $(LITEOS_LIBS_TARGET)
$(OUT)/$(LITEOS_TARGET).map: $(OUT)/$(LITEOS_TARGET)
$(OUT)/$(LITEOS_TARGET).objsize: $(LITEOS_LIBS_TARGET)
$(SIZE) -t --common $(OUT)/lib/*.a >$@
$(LITEOS_TARGET_DIR)/$(LITEOS_TARGET).bin: $(OUT)/$(LITEOS_TARGET)
$(OUT)/$(LITEOS_TARGET).bin: $(OUT)/$(LITEOS_TARGET)
$(OBJCOPY) -O binary $< $@
$(OUT)/$(LITEOS_TARGET).sym.sorted: $(OUT)/$(LITEOS_TARGET)
$(OBJDUMP) -t $< |sort >$@
......@@ -178,10 +167,11 @@ $(OUT)/$(LITEOS_TARGET).asm: $(OUT)/$(LITEOS_TARGET)
$(OUT)/$(LITEOS_TARGET).size: $(OUT)/$(LITEOS_TARGET)
$(NM) -S --size-sort $< >$@
$(APPS): prepare
$(APPS):
$(HIDE)$(MAKE) -C apps all
$(ROOTFS): $(APPS)
$(HIDE)mkdir -p $(OUT)/musl
ifeq ($(LOSCFG_COMPILER_CLANG_LLVM), y)
$(HIDE)cp -fp $$($(CC) --target=$(LLVM_TARGET) --sysroot=$(SYSROOT_PATH) $(LITEOS_CFLAGS) -print-file-name=libc.so) $(OUT)/musl
$(HIDE)cp -fp $$($(GPP) --target=$(LLVM_TARGET) --sysroot=$(SYSROOT_PATH) $(LITEOS_CXXFLAGS) -print-file-name=libc++.so) $(OUT)/musl
......@@ -190,23 +180,22 @@ else
$(HIDE)cp -fp $$($(CC) $(LITEOS_CFLAGS) -print-file-name=libgcc_s.so.1) $(OUT)/musl
$(HIDE)cp -fp $$($(GPP) $(LITEOS_CXXFLAGS) -print-file-name=libstdc++.so.6) $(OUT)/musl
endif
$(STRIP) $(OUT)/musl/*
$(HIDE)$(LITEOSTOPDIR)/tools/scripts/make_rootfs/rootfsdir.sh $(OUT) $(ROOTFS_DIR) $(LITEOS_TARGET_DIR)
$(HIDE)$(STRIP) $(OUT)/musl/*
$(HIDE)$(LITEOS_SCRIPTPATH)/make_rootfs/rootfsdir.sh $(OUT) $(ROOTFS_DIR)
ifneq ($(VERSION),)
$(HIDE)$(LITEOSTOPDIR)/tools/scripts/make_rootfs/releaseinfo.sh "$(VERSION)" $(ROOTFS_DIR) $(LITEOS_TARGET_DIR)
$(HIDE)$(LITEOS_SCRIPTPATH)/make_rootfs/releaseinfo.sh "$(VERSION)" $(ROOTFS_DIR)
endif
$(HIDE)$(LITEOSTOPDIR)/tools/scripts/make_rootfs/rootfsimg.sh $(ROOTFS_DIR) $(FSTYPE)
$(HIDE)$(LITEOS_SCRIPTPATH)/make_rootfs/rootfsimg.sh $(ROOTFS_DIR) $(FSTYPE)
$(HIDE)cd $(ROOTFS_DIR)/.. && zip -r $(ROOTFS_ZIP) $(ROOTFS)
clean:
$(HIDE)for dir in $(LITEOS_SUBDIRS); do $(MAKE) -C $$dir clean || exit 1; done
$(HIDE)$(MAKE) -C apps clean
$(HIDE)$(RM) $(LITEOS_MENUCONFIG_H) $(CONFIG_FILE)
$(HIDE)for dir in $(LIB_SUBDIRS) apps; do $(MAKE) -C $$dir clean || exit 1; done
$(HIDE)$(RM) $(LITEOS_MENUCONFIG_H)
$(HIDE)echo "clean $(LOSCFG_PLATFORM) finish"
cleanall: clean
$(HIDE)$(RM) $(LITEOSTOPDIR)/out
$(HIDE)$(RM) $(LITEOSTOPDIR)/out $(LITEOS_CONFIG_FILE)
$(HIDE)echo "clean all done"
.PHONY: all clean cleanall prepare sysroot help update_config
.PHONY: $(LITEOS_TARGET) $(ROOTFS) $(APPS) $(KCONFIG_CMDS) $(LITEOS_LIBS_TARGET)
.PHONY: all clean cleanall sysroot help update_config
.PHONY: $(LITEOS_TARGET) $(ROOTFS) $(APPS) $(KCONFIG_CMDS) $(LITEOS_LIBS_TARGET) $(KCONFIG_CONFIG)
......@@ -27,11 +27,12 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
LITEOSTOPDIR := $(shell pwd)/../
APPSTOPDIR := $(shell pwd)
LITEOSTOPDIR ?= $(APPSTOPDIR)/..
export LITEOSTOPDIR
export APPSTOPDIR
include $(LITEOSTOPDIR)/.config
include ./config.mk
include ./module.mk
include $(APPSTOPDIR)/config.mk
HIDE := @
APPS := app
......
......@@ -27,27 +27,77 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
SRC_MODULES := fs/proc
OBJOUT := $(BUILD)$(dir $(subst $(LITEOSTOPDIR),,$(shell pwd)))$(APP_NAME)
ifeq ($(LOSCFG_USER_TEST_LLT), y)
LLT_MODULES := fs/proc/llt
endif
APP := $(OUT)/bin/$(APP_NAME)
ifeq ($(LOSCFG_USER_TEST_SMOKE), y)
SMOKE_MODULES := fs/proc/smoke
endif
# create a separate list of objects per source type
ifeq ($(LOSCFG_USER_TEST_FULL), y)
FULL_MODULES := fs/proc/full
endif
LOCAL_CSRCS := $(filter %.c,$(LOCAL_SRCS))
LOCAL_CPPSRCS := $(filter %.cpp,$(LOCAL_SRCS))
LOCAL_ASMSRCS := $(filter %.S,$(LOCAL_SRCS))
LOCAL_ASMSRCS2 := $(filter %.s,$(LOCAL_SRCS))
LOCAL_CCSRCS := $(filter %.cc,$(LOCAL_SRCS))
ifeq ($(LOSCFG_USER_TEST_PRESSURE), y)
PRESSURE_MODULES := fs/proc/pressure
endif
LOCAL_COBJS := $(patsubst %.c,$(OBJOUT)/%.o,$(LOCAL_CSRCS))
LOCAL_CPPOBJS := $(patsubst %.cpp,$(OBJOUT)/%.o,$(LOCAL_CPPSRCS))
LOCAL_ASMOBJS := $(patsubst %.S,$(OBJOUT)/%.o,$(LOCAL_ASMSRCS))
LOCAL_ASMOBJS2 := $(patsubst %.s,$(OBJOUT)/%.o,$(LOCAL_ASMSRCS2))
LOCAL_CCOBJS := $(patsubst %.cc,$(OBJOUT)/%.o,$(LOCAL_CCSRCS))
LOCAL_MODULES := $(SRC_MODULES) $(LLT_MODULES) $(PRESSURE_MODULES) $(SMOKE_MODULES) $(FULL_MODULES)
LOCAL_OBJS := $(LOCAL_COBJS) $(LOCAL_CPPOBJS) $(LOCAL_ASMOBJS) $(LOCAL_ASMOBJS2) $(LOCAL_CCOBJS)
LOCAL_SRCS += $(foreach dir,$(LOCAL_MODULES),$(wildcard $(dir)/*.c))
LOCAL_CHS += $(foreach dir,$(LOCAL_MODULES),$(wildcard $(dir)/*.h))
LOCAL_CGCH := $(patsubst %.h,%.h.gch,$(LOCAL_CHS))
LOCAL_CPPGCH := $(patsubst %.h,%.h.gch,$(LOCAL_CPPHS))
LOCAL_FLAGS += -I./fs/proc
all : $(APP)
$(LOCAL_COBJS): $(OBJOUT)/%.o: %.c
$(HIDE)$(OBJ_MKDIR)
$(HIDE)$(CC) $(CFLAGS) $(LOCAL_FLAGS) $(LOCAL_CFLAGS) -c $< -o $@
$(LOCAL_CPPOBJS): $(OBJOUT)/%.o: %.cpp
$(HIDE)$(OBJ_MKDIR)
$(HIDE)$(GPP) $(CXXFLAGS) $(LOCAL_FLAGS) $(LOCAL_CPPFLAGS) -c $< -o $@
$(LOCAL_ASMOBJS): $(OBJOUT)/%.o: %.S
$(HIDE)$(OBJ_MKDIR)
$(HIDE)$(CC) $(CFLAGS) $(LOCAL_FLAGS) $(LOCAL_ASFLAGS) -c $< -o $@
$(LOCAL_ASMOBJS2): $(OBJOUT)/%.o: %.s
$(HIDE)$(OBJ_MKDIR)
$(HIDE)$(AS) $(ASFLAGS) $(LOCAL_FLAGS) $(LOCAL_ASFLAGS) -c $< -o $@
$(LOCAL_CCOBJS): $(OBJOUT)/%.o: %.cc
$(HIDE)$(OBJ_MKDIR)
$(HIDE)$(GPP) $(CXXFLAGS) $(LOCAL_FLAGS) $(LOCAL_CPPFLAGS) -c $< -o $@
$(LOCAL_CGCH): %.h.gch : %.h
$(HIDE)$(CC) $(CFLAGS) $(LOCAL_FLAGS) $(LOCAL_CFLAGS) $> $^
$(LOCAL_CPPGCH): %.h.gch : %.h
$(HIDE)$(GPP) $(CXXFLAGS) $(LOCAL_FLAGS) $(LOCAL_CPPFLAGS) -x c++-header $> $^
LOCAL_GCH := $(LOCAL_CGCH) $(LOCAL_CPPGCH)
$(LOCAL_OBJS): $(LOCAL_GCH)
$(APP): $(LOCAL_OBJS)
$(HIDE)$(OBJ_MKDIR)
$(HIDE)$(GPP) $(LDFLAGS) $^ -o $@
clean:
$(HIDE)$(RM) $(APP) $(OBJOUT) $(LOCAL_GCH) *.bak *~
.PHONY: all clean
# clear some variables we set here
LOCAL_CSRCS :=
LOCAL_CPPSRCS :=
LOCAL_ASMSRCS :=
LOCAL_COBJS :=
LOCAL_CPPOBJS :=
LOCAL_ASMOBJS :=
LOCAL_ASMOBJS2 :=
# LOCAL_OBJS is passed back
#LOCAL_OBJS :=
......@@ -27,30 +27,19 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# common dir config
include $(LITEOSTOPDIR)/config.mk
# output dir config
OBJOUT := $(APPSTOPDIR)/out
APPSOUT := $(OBJOUT)/apps
LIBSOUT := $(OBJOUT)/libs
IMGOUT := $(OUT)
ifeq ($(LOSCFG_COMPILER_CLANG_LLVM), y)
LLVM_SYSROOT := --sysroot=$(SYSROOT_PATH) $(ARCH_CFLAGS)
endif
# common flags config
BASE_OPTS := -ffunction-sections -fdata-sections -fno-omit-frame-pointer -fno-common -fno-strict-aliasing -D_GNU_SOURCE \
$(LITEOS_SSP) $(LITEOS_CORE_COPTS) $(WARNING_AS_ERROR) $(LLVM_EXTRA_OPTS) $(LITEOS_GCOV_OPTS)
$(LITEOS_SSP) $(LITEOS_CORE_COPTS) $(WARNING_AS_ERROR) $(LLVM_EXTRA_OPTS) $(LLVM_SYSROOT) $(LITEOS_GCOV_OPTS)
CFLAGS := -std=c99 -fno-exceptions $(BASE_OPTS) $(LITEOS_COPTS_OPTMIZE)
CXXFLAGS := -std=c++11 -fexceptions -fpermissive -frtti $(BASE_OPTS) $(LITEOS_COPTS_OPTMIZE)
LDCFLAGS := -lc
ifeq ($(LOSCFG_COMPILER_CLANG_LLVM), y)
LLVM_SYSROOT := --sysroot=$(SYSROOT_PATH) $(ARCH_CFLAGS)
LDCXXFLGS := -lc++ -lc++abi -lc
else
BASE_OPTS += -Wl,-z,relro,-z,now
LDCXXFLGS := -lstdc++ -lsupc++ -lc
endif
COMMON_INCLUDE := -I $(LITEOSTHIRDPARTY)/bounds_checking_function/include
CFLAGS := -std=c99 -fPIE -fno-exceptions $(BASE_OPTS) $(LITEOS_COPTS_OPTMIZE)
CXXFLAGS := -std=c++11 -fPIE -fexceptions -fpermissive -frtti $(BASE_OPTS) $(LITEOS_COPTS_OPTMIZE)
LDFLAGS := -pie -s -Wl,-z,relro,-z,now $(BASE_OPTS) $(LLVM_EXTRA_LD_OPTS)
# alias variable config
HIDE := @
......@@ -58,3 +47,22 @@ MAKE := make
RM := rm -rf
CP := cp -rf
MV := mv -f
APP := $(APPSTOPDIR)/app.mk
APP_SUBDIRS :=
##build modules config##
ifeq ($(LOSCFG_SHELL), y)
APP_SUBDIRS += shell
#APP_SUBDIRS += mksh
#APP_SUBDIRS += toybox
endif
ifeq ($(LOSCFG_USER_INIT_DEBUG), y)
APP_SUBDIRS += init
endif
ifeq ($(LOSCFG_NET_LWIP_SACK_TFTP), y)
APP_SUBDIRS += tftp
endif
......@@ -27,43 +27,15 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
INIT_DIR := $(dir $(shell pwd))/init/
include $(APPSTOPDIR)/config.mk
ifeq ($(APPSTOPDIR), )
APPSTOPDIR := $(shell pwd)/../
LITEOSTOPDIR = $(APPSTOPDIR)/../
endif
include $(INIT_DIR)/../config.mk
APP_NAME := $(notdir $(shell pwd))
APPS_OUT := $(OUT)/bin
LOCAL_SRCS := src/init.c
LOCAL_OBJ := src/init.o
ifeq ($(LOSCFG_COMPILER_CLANG_LLVM), y)
LOCAL_FLAGS += -Wno-shift-op-parentheses -Wno-bitwise-op-parentheses -Wnonnull $(LLVM_SYSROOT)
LDCFLAGS += $(LLVM_EXTRA_LD_OPTS) $(LLVM_SYSROOT)
endif
ifeq ($(LOSCFG_QUICK_START), y)
LDCFLAGS += --static
LDFLAGS += --static
CFLAGS += -DLOSCFG_QUICK_START
endif
INITNAME := init
all: $(INITNAME)
$(LOCAL_OBJ): %.o : %.c
$(HIDE) $(CC) $(CFLAGS) $(LOCAL_FLAGS) -fPIE $(LOCAL_INCLUDE) -c $< -o $@
$(INITNAME):$(LOCAL_OBJ)
$(HIDE) $(CC) -pie -s $(LDPATH) $(BASE_OPTS) -o $(INITNAME) $^ $(LDCFLAGS)
$(HIDE) mkdir -p $(APPS_OUT)
$(HIDE) $(MV) $(INITNAME) $(APPS_OUT)
$(HIDE) $(RM) $(LOCAL_OBJ)
clean:
$(HIDE) $(RM) $(LOCAL_OBJ)
$(HIDE) $(RM) $(INITNAME)
.PHONY: all $(INITNAME) clean
include $(APP)
......@@ -27,11 +27,11 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
include $(APPSTOPDIR)/config.mk
MKSH := mksh
MKSH_DIR := $(shell pwd)/
LITEOSTOPDIR = $(MKSH_DIR)/../../
include $(MKSH_DIR)/../config.mk
APPS_OUT := $(OUT)/bin
ETC_OUT := $(OUT)/etc
......
# 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.
APP_SUBDIRS :=
##build modules config##
ifeq ($(LOSCFG_SHELL), y)
APP_SUBDIRS += shell
#APP_SUBDIRS += mksh
#APP_SUBDIRS += toybox
endif
ifeq ($(LOSCFG_USER_INIT_DEBUG), y)
APP_SUBDIRS += init
endif
ifeq ($(LOSCFG_NET_LWIP_SACK_TFTP), y)
APP_SUBDIRS += tftp
endif
......@@ -27,14 +27,9 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
SHELL_DIR := $(dir $(shell pwd))/shell/
include $(APPSTOPDIR)/config.mk
ifeq ($(APPSTOPDIR), )
APPSTOPDIR := $(shell pwd)/../
LITEOSTOPDIR = $(APPSTOPDIR)/../
endif
include $(SHELL_DIR)/../config.mk
APPS_OUT := $(OUT)/bin
APP_NAME := $(notdir $(shell pwd))
SECUREC_INCLUDE := $(LITEOSTHIRDPARTY)/bounds_checking_function/include
......@@ -44,35 +39,11 @@ LOCAL_SRCS = $(wildcard src/main.c)\
$(wildcard src/shcmdparse.c)\
$(wildcard builtin/cd.c)
LOCAL_SRCS += $(wildcard $(LITEOSTHIRDPARTY)/bounds_checking_function/src/*.c)
LOCAL_OBJ := $(LOCAL_SRCS:.c=.o)
LOCAL_INCLUDE := \
-I $(SHELL_DIR)/include/ \
-I include/ \
-I $(SECUREC_INCLUDE)\
LOCAL_FLAGS += $(CFLAGS)
LOCAL_FLAGS += $(LOCAL_INCLUDE)
LDPATH := -L$(SHELL_DIR)/
ifeq ($(LOSCFG_COMPILER_CLANG_LLVM), y)
LOCAL_FLAGS += -Wno-shift-op-parentheses -Wno-bitwise-op-parentheses $(LLVM_SYSROOT)
LDCFLAGS += $(LLVM_EXTRA_LD_OPTS) $(LLVM_SYSROOT)
endif
SHELLNAME := shell
all: $(SHELLNAME)
$(LOCAL_OBJ): %.o : %.c
$(HIDE) $(CC) $(LOCAL_FLAGS) -fPIE $(LOCAL_INCLUDE) -c $< -o $@
$(SHELLNAME): $(LOCAL_OBJ)
$(HIDE) $(CC) -pie -s $(LDPATH) $(BASE_OPTS) -o $(SHELLNAME) $^ $(LDCFLAGS)
$(HIDE) mkdir -p $(APPS_OUT)
$(HIDE) $(MV) $(SHELLNAME) $(APPS_OUT)
$(HIDE) $(RM) $(LOCAL_OBJ)
clean:
$(HIDE) $(RM) $(LOCAL_OBJ)
$(HIDE) $(RM) $(SHELLNAME)
.PHONY: all $(SHELLNAME) clean
include $(APP)
......@@ -27,14 +27,9 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
ROOT_DIR := $(dir $(shell pwd))/tftp/
include $(APPSTOPDIR)/config.mk
ifeq ($(APPSTOPDIR), )
APPSTOPDIR := $(shell pwd)/../
LITEOSTOPDIR = $(APPSTOPDIR)/../
endif
include $(ROOT_DIR)/../config.mk
APPS_OUT := $(OUT)/bin
APP_NAME := $(notdir $(shell pwd))
SECUREC_DIR := $(LITEOSTHIRDPARTY)/bounds_checking_function
......@@ -43,35 +38,11 @@ LOCAL_SRCS += $(wildcard $(SECUREC_DIR)/src/strncpy_s.c)
LOCAL_SRCS += $(wildcard $(SECUREC_DIR)/src/memcpy_s.c)
LOCAL_SRCS += $(wildcard $(SECUREC_DIR)/src/memset_s.c)
LOCAL_SRCS += $(wildcard $(SECUREC_DIR)/src/strncat_s.c)
LOCAL_OBJ := $(LOCAL_SRCS:.c=.o)
LOCAL_INCLUDE := \
-I $(ROOT_DIR)/include/ \
-I include/ \
-I $(SECUREC_DIR)/include/\
LOCAL_FLAGS += $(CFLAGS)
LOCAL_FLAGS += $(LOCAL_INCLUDE)
LDPATH := -L$(ROOT_DIR)/
ifeq ($(LOSCFG_COMPILER_CLANG_LLVM), y)
LOCAL_FLAGS += -Wno-shift-op-parentheses -Wno-bitwise-op-parentheses $(LLVM_SYSROOT)
LDCFLAGS += $(LLVM_EXTRA_LD_OPTS) $(LLVM_SYSROOT)
endif
TARGETNAME := tftp
all: $(TARGETNAME)
$(LOCAL_OBJ): %.o : %.c
$(HIDE) $(CC) $(LOCAL_FLAGS) -fPIE $(LOCAL_INCLUDE) -c $< -o $@
$(TARGETNAME): $(LOCAL_OBJ)
$(HIDE) $(CC) -pie -s $(LDPATH) $(BASE_OPTS) -o $(TARGETNAME) $^ $(LDCFLAGS)
$(HIDE) mkdir -p $(APPS_OUT)
$(HIDE) $(MV) $(TARGETNAME) $(APPS_OUT)
$(HIDE) $(RM) $(LOCAL_OBJ)
clean:
$(HIDE) $(RM) $(LOCAL_OBJ)
$(HIDE) $(RM) $(TARGETNAME)
.PHONY: all $(TARGETNAME) clean
include $(APP)
......@@ -27,11 +27,11 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
include $(APPSTOPDIR)/config.mk
TOYBOX:= toybox
TOYBOX_DIR := $(shell pwd)
LITEOSTOPDIR = $(TOYBOX_DIR)/../../
include $(TOYBOX_DIR)/../config.mk
APPS_OUT := $(OUT)/bin
BUILD_DIR := $(TOYBOX_DIR)/build
......
......@@ -42,17 +42,20 @@ ohos_version=${9}
sysroot_path=${10}
arch_cflags=${11}
device_path=${12}
compile_prefix=${13}
echo "${board_name}" "${device_company}"
echo "sh param:" "$@"
destination="defconfig"
destination="${outdir}/defconfig"
function main() {
tee=""
if [ "${tee_enable}" = "true" ]; then
tee="_tee"
fi
mkdir -p "${destination%/*}"
config_file="${product_path}/kernel_configs/${ohos_build_type}${tee}.config"
if [ -f "${config_file}" ]; then
cp "${config_file}" "${destination}"
......@@ -88,9 +91,13 @@ fi
export PRODUCT_PATH="${product_path}"
export DEVICE_PATH="${device_path}"
OUTDIR="${outdir}"
CONFIG="$(realpath ${destination})"
export OUTDIR="${outdir}"
export KCONFIG_CONFIG="${destination}"
export LITEOS_MENUCONFIG_H="${destination%/*}/config.h"
export LITEOS_CONFIG_FILE="${destination%/*}/.config"
export LITEOS_COMPILER_PATH="${compile_prefix%/*}/"
export CROSS_COMPILE="${compile_prefix##*/}"
main && \
make clean CONFIG="$CONFIG" OUTDIR="$OUTDIR" && \
make -j all VERSION="${ohos_version}" CONFIG="$CONFIG" OUTDIR="$OUTDIR"
make clean && \
make -j all VERSION="${ohos_version}"
tools/build/config.mk
\ No newline at end of file
# 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.
############### this is a makefile that you can config it ###############
-include $(LITEOSTOPDIR)/tools/build/mk/los_config.mk
##### liteos tables -u ldflags #####
-include $(LITEOSTOPDIR)/tools/build/mk/liteos_tables_ldflags.mk
LITEOS_COPTS := $(LITEOS_COPTS_DEBUG) $(LITEOS_COPTS_BASE) \
$(LITEOS_COPTS_EXTRA) $(LITEOS_CORE_COPTS)
LITEOS_CXXOPTS := $(LITEOS_CXXOPTS_BASE)
LITEOS_INCLUDE := $(LITEOS_KERNEL_INCLUDE) $(LITEOS_EXTKERNEL_INCLUDE) \
$(LITEOS_COMPAT_INCLUDE) $(LITEOS_FS_INCLUDE) \
$(LITEOS_NET_INCLUDE) $(LITEOS_LIB_INCLUDE) \
$(LITEOS_DRIVERS_INCLUDE) $(LOSCFG_TOOLS_DEBUG_INCLUDE) \
$(LITEOS_PLATFORM_INCLUDE) $(LITEOS_DFX_INCLUDE) \
$(LITEOS_SECURITY_INCLUDE)
LITEOS_LIBDEP := $(LITEOS_BASELIB)
LITEOS_ASFLAGS := $(LITEOS_ASOPTS) $(LITEOS_INCLUDE)
LITEOS_CFLAGS := $(LITEOS_COPTS) $(LITEOS_CMACRO) \
$(LITEOS_CMACRO_TEST) $(LITEOS_IMAGE_MACRO) \
$(LITEOS_INCLUDE)
LITEOS_CXXFLAGS := $(LITEOS_CXXOPTS) $(LITEOS_CXXMACRO) \
$(LITEOS_CMACRO) $(LITEOS_CXXINCLUDE)
LITEOS_LDFLAGS := $(LITEOS_LD_OPTS) $(LITEOS_LD_PATH) \
$(LITEOS_LD_SCRIPT)
......@@ -3,5 +3,6 @@ config FS_NFS
default y
depends on FS_VFS
depends on NET_LWIP_SACK
depends on DEBUG_VERSION
help
Answer Y to enable LiteOS support nfs filesystem.
......@@ -46,8 +46,10 @@ config("public") {
include_dirs = [ "include" ]
}
copy("copy_ohos_vdso") {
deps = [ "usr:OHOS-vdso" ]
sources = [ get_path_info("usr/", "out_dir") + "/libOHOS-vdso.so" ]
outputs = [ "$root_out_dir/OHOS-vdso.so" ]
if (module_switch) {
copy("copy_ohos_vdso") {
deps = [ "usr:OHOS-vdso" ]
sources = [ get_path_info("usr/", "out_dir") + "/libOHOS-vdso.so" ]
outputs = [ "$root_out_dir/OHOS-vdso.so" ]
}
}
......@@ -33,8 +33,8 @@ MODULE_NAME := $(notdir $(shell pwd)/../vdso)
LOCAL_SRCS := $(wildcard *.c) $(wildcard *.S)
LOCAL_INCLUDE := -I $(LITEOSTOPDIR)/kernel/base/include -I $(LITEOSTOPDIR)/kernel/extended/include -I $(LITEOSTOPDIR)/kernel/extended/vdso/include
LOCAL_INCLUDE := -I $(LITEOSTOPDIR)/kernel/base/include -I ../include
LOCAL_FLAGS := $(LOCAL_INCLUDE) -DOHOS_VDSO_SO=\"../usr/OHOS-vdso.so\"
LOCAL_FLAGS := $(LOCAL_INCLUDE) -DOHOS_VDSO_SO=\"$(OUT)/lib/OHOS-vdso.so\"
include $(MODULE)
\ No newline at end of file
......@@ -53,7 +53,6 @@ shared_library("OHOS-vdso") {
defines = [ "_XOPEN_SOURCE=700" ]
ldflags = [
"-Wl,-s",
"-Wl,-Bsymbolic",
"-Wl,-T" + rebase_path("los_vdso.ld", root_build_dir),
]
......
......@@ -29,7 +29,7 @@
include $(LITEOSTOPDIR)/config.mk
VDSO_SO = OHOS-vdso
VDSO_SO = $(OUT)/lib/OHOS-vdso.so
VDSO_SRCS := los_vdso_sys.c
VDSO_INCLUDE := -I $(LITEOSTOPDIR)/kernel/extended/vdso/include \
......@@ -41,14 +41,14 @@ VDSO_CCFLAGS := -nostdlib -fPIC -fno-common -fno-strict-aliasing \
$(LITEOS_SSP) $(LITEOS_CORE_COPTS) $(WARNING_AS_ERROR) $(LITEOS_COPTS_OPTMIZE)
ifeq ($(LOSCFG_COMPILER_CLANG_LLVM), y)
VDSO_CCFLAGS += $(LLVM_EXTRA_OPTS) --sysroot=$(SYSROOT_PATH)
VDSO_CCFLAGS += -O2
endif
VDSO_LDFLAGS := -shared -s -Bsymbolic -T los_vdso.ld
VDSO_LDFLAGS := -shared -Wl,-s,-Bsymbolic,-Tlos_vdso.ld
all: $(VDSO_SO)
$(VDSO_SO):
$(HIDE)$(CC) $(VDSO_INCLUDE) $(VDSO_CCFLAGS) -c -o $@.o $(VDSO_SRCS)
$(HIDE)$(LD) $(VDSO_LDFLAGS) -o $@.so $@.o
$(VDSO_SO): $(VDSO_SRCS)
$(HIDE)$(CC) $(VDSO_INCLUDE) $(VDSO_CCFLAGS) $(VDSO_LDFLAGS) -o $@ $^
clean:
$(HIDE)$(RM) -rf *.o *.so
$(HIDE)$(RM) $(VDSO_SO)
......@@ -45,7 +45,7 @@ config PLATFORM_QEMU_ARM_VIRT_CA7
endchoice
choice
prompt "Porduct"
prompt "Product"
help
Select your target board.
......@@ -64,15 +64,15 @@ config PRODUCT_QEMU_ARM
endchoice
config BOARD_CONFIG_PATH
string "BOARD CONFIG PATH"
string "Board config path"
default "config/board"
config TEE_ENABLE
bool "ENABLE TEE"
bool "Enable TEE"
default n
depends on PLATFORM_HI3516DV300
help
ENABLE teeos in platform
Enable teeos in platform
config HRTIMER_ENABLE
bool "HR TIMER enable"
......
......@@ -41,7 +41,7 @@ USB_SRC :=
########################## Qemu ARM Virt Options##############################
LITEOS_BASELIB += -lbsp
LITEOS_BASELIB += -lbsp -lbsp_config
PLATFORM_BSP_BASE := $(LITEOSTOPDIR)/platform
......@@ -53,5 +53,5 @@ PLATFORM_INCLUDE := -I $(LITEOSTOPDIR)/../../$(LOSCFG_BOARD_CONFIG_PATH) \
-I $(PLATFORM_BSP_BASE)/hw/include \
-I $(PLATFORM_BSP_BASE)/include
LIB_SUBDIRS += $(PLATFORM_BSP_BASE)
LIB_SUBDIRS += $(PLATFORM_BSP_BASE) $(LITEOSTOPDIR)/../../$(LOSCFG_BOARD_CONFIG_PATH)
LITEOS_PLATFORM_INCLUDE += $(PLATFORM_INCLUDE)
......@@ -27,17 +27,12 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
LITEOSTESTTOPDIR := $(shell if [ "$$PWD" != "" ]; then echo $$PWD; else pwd; fi)
export OS=$(shell uname -s)
ifneq ($(OS), Linux)
LITEOSTESTTOPDIR := $(shell dirname $(subst \,/,$(LITEOSTESTTOPDIR))/./)
endif
LITEOSTOPDIR := $(LITEOSTESTTOPDIR)/..
LITEOSTESTTOPDIR := $(shell pwd)
LITEOSTOPDIR ?= $(LITEOSTESTTOPDIR)/..
export LITEOSTOPDIR
export LITEOSTESTTOPDIR
-include $(LITEOSTESTTOPDIR)/config.mk
include $(LITEOSTESTTOPDIR)/config.mk
RM = -rm -rf
MAKE = make
......@@ -80,7 +75,7 @@ $(TEST_KERNEL): $(LITEOS_TEST_TARGET)
$(LITEOS_TEST_TARGET): $(LITEOS_TEST_LIBC)
$(LD) $(LITEOS_LDFLAGS) $(LITEOS_TABLES_LDFLAGS) $(LITEOS_DYNLDFLAGS) -Map=$(OUT)/$@.map -o $(OUT)/$@ --start-group $(LITEOS_LIBDEP) --end-group
$(OBJCOPY) -O binary $(OUT)/$@ $(LITEOS_TARGET_DIR)/$@.bin
$(OBJCOPY) -O binary $(OUT)/$@ $(OUT)/$@.bin
$(OBJDUMP) -t $(OUT)/$@ |sort >$(OUT)/$@.sym.sorted
$(OBJDUMP) -d $(OUT)/$@ >$(OUT)/$@.asm
......
......@@ -28,12 +28,9 @@
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-include $(LITEOSTOPDIR)/tools/build/config.mk
-include $(LITEOSTESTTOPDIR)/build/los_test_config.mk
LITEOS_CFLAGS += -I $(LITEOSTOPDIR)/lib/libc/musl/include \
-I $(LITEOSTOPDIR)/lib/libc/musl/obj/include \
-I $(LITEOSTOPDIR)/lib/libc/musl/arch/arm \
-I $(LITEOSTOPDIR)/lib/libc/musl/arch/generic \
include $(LITEOSTOPDIR)/config.mk
include $(LITEOSTESTTOPDIR)/build/los_test_config.mk
LITEOS_CFLAGS += \
-I $(LITEOSTHIRDPARTY)/bounds_checking_function/include \
-I $(LITEOSTOPDIR)/security/cap/ \
-I $(LITEOSTOPDIR)/security/vid/ \
......
include $(LITEOSTOPDIR)/config.mk
MODULE_NAME := $(notdir $(shell pwd))test
LOCAL_INCLUDE := \
-I $(LITEOSTOPDIR)/test/kernel/include \
-I $(LITEOSTOPDIR)/fs/proc/include \
-I $(LITEOSTOPDIR)/fs/include \
-I $(LITEOSTOPDIR)/test/kernel/sample/fs/proc
SRC_MODULES := .
ifeq ($(LOSCFG_USER_TEST_LLT), y)
LLT_MODULES := llt
endif
ifeq ($(LOSCFG_USER_TEST_PRESSURE), y)
PRESSURE_MODULES := pressure
endif
ifeq ($(LOSCFG_USER_TEST_SMOKE), y)
SMOKE_MODULES := smoke
endif
ifeq ($(LOSCFG_USER_TEST_FULL), y)
FULL_MODULES := full
endif
LOCAL_MODULES := $(SRC_MODULES) $(LLT_MODULES) $(PRESSURE_MODULES) $(SMOKE_MODULES) $(FULL_MODULES)
LOCAL_SRCS := $(foreach dir,$(LOCAL_MODULES),$(wildcard $(dir)/*.c))
LOCAL_CHS := $(foreach dir,$(LOCAL_MODULES),$(wildcard $(dir)/*.h))
LOCAL_FLAGS := $(LOCAL_INCLUDE) -Wno-error
include $(MODULE)
# 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.
############### this is a makefile that you can config it ###############
-include $(LITEOSTOPDIR)/tools/build/mk/los_config.mk
TOP_LD_PATH = $(LITEOSTOPDIR)
SCRIPTS_PATH = $(LITEOS_SCRIPTPATH)
LITEOS_MK_PATH = $(MK_PATH)
LITEOS_SUBDIRS = $(LIB_SUBDIRS)
##### liteos tables -u ldflags #####
-include $(LITEOS_MK_PATH)/liteos_tables_ldflags.mk
LITEOS_COPTS := $(LITEOS_COPTS_DEBUG) $(LITEOS_COPTS_BASE) \
$(LITEOS_COPTS_EXTRA) $(LITEOS_CORE_COPTS)
LITEOS_CXXOPTS := $(LITEOS_CXXOPTS_BASE)
LITEOS_INCLUDE := $(LITEOS_KERNEL_INCLUDE) $(LITEOS_EXTKERNEL_INCLUDE) \
$(LITEOS_COMPAT_INCLUDE) $(LITEOS_FS_INCLUDE) \
$(LITEOS_NET_INCLUDE) $(LITEOS_LIB_INCLUDE) \
$(LITEOS_DRIVERS_INCLUDE) $(LOSCFG_TOOLS_DEBUG_INCLUDE) \
$(LITEOS_PLATFORM_INCLUDE) $(LITEOS_DFX_INCLUDE) \
$(LITEOS_SECURITY_INCLUDE)
LITEOS_LIBDEP := $(LITEOS_BASELIB)
LITEOS_ASFLAGS := $(LITEOS_ASOPTS) $(LITEOS_INCLUDE)
LITEOS_CFLAGS := $(LITEOS_COPTS) $(LITEOS_CMACRO) \
$(LITEOS_CMACRO_TEST) $(LITEOS_IMAGE_MACRO) \
$(LITEOS_INCLUDE)
LITEOS_CXXFLAGS := $(LITEOS_CXXOPTS) $(LITEOS_CXXMACRO) \
$(LITEOS_CMACRO) $(LITEOS_CXXINCLUDE)
LITEOS_LDFLAGS := $(LITEOS_LD_OPTS) $(LITEOS_LD_PATH) \
$(LITEOS_LD_SCRIPT)
[timestamp]
uts=2020-01-04,16:54:14
second=2020-01-04,16:54:14
third=2020-01-04,16:54:14
\ No newline at end of file
# 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.
DYNLOADTESTDIR := $(LITEOSTOPDIR)/test/kernel/sample/kernel_extend/dynload
export DYNLOADTESTDIR
##### command to test dynload #####
-include $(DYNLOADTESTDIR)/test_dynload.mk
#!/bin/bash
#
# 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.
set -e
declare CROSS_COMPILER="$1"
declare HMOS_TOP_DIR="$2"
declare gcc_path=${HMOS_TOP_DIR}/../../prebuilts/gcc/linux-x86/arm/arm-linux-ohoseabi-gcc
declare windows_gcc_path=${HMOS_TOP_DIR}/../../prebuilts/gcc/win-x86/arm/arm-linux-ohoseabi-gcc
function get_compiler_path()
{
local system=$(uname -s)
local user_gcc="${CROSS_COMPILER}"gcc
local gcc_install_path=$(which "${user_gcc}")
if [ "$system" != "Linux" ] ; then
if [ -e "${windows_gcc_path}" ] ; then
gcc_install_path=$windows_gcc_path
else
gcc_install_path=$(dirname $gcc_install_path)/../
fi
else
if [ -e "${gcc_path}" ] ; then
gcc_install_path=$gcc_path
else
gcc_install_path=$(dirname $gcc_install_path)/../
fi
fi
echo "$gcc_install_path"
}
get_compiler_path
#!/bin/bash
#
# 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.
set -e
declare TEMP="$1"
declare TEMP2="$2"
declare llvm_path_linux=${TEMP2}/../../prebuilts/clang/ohos/linux-x86_64/llvm
declare llvm_path_windows=${TEMP2}/../../prebuilts/clang/ohos/windows-x86_64/llvm
function get_compiler_path()
{
local system=$(uname -s)
local user_clang=clang
local clang_install_path=$(which "${user_clang}")
if [ "$system" == "Linux" ] ; then
if [ -e "${llvm_path_linux}" ] ; then
echo "${llvm_path_linux}"
elif [ -n "${clang_install_path}" ] ; then
clang_install_path=$(dirname ${clang_install_path})/../
echo "${clang_install_path}"
else
echo "WARNING:Set llvm/bin path in PATH."
fi
else
if [ -e "${llvm_path_windows}" ] ; then
echo "${llvm_path_windows}"
elif [ -n "${clang_install_path}" ] ; then
clang_install_path=$(dirname ${clang_install_path})/../
echo "${clang_install_path}"
else
echo "WARNING:Set llvm/bin path in PATH."
fi
fi
}
get_compiler_path
......@@ -27,17 +27,7 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
CONFIG_FILE ?= $(LITEOSTOPDIR)/.config
-include $(CONFIG_FILE)
LOSCFG_BOARD_CONFIG_PATH := $(LOSCFG_BOARD_CONFIG_PATH:"%"=%)
ifeq ($(wildcard $(LITEOSTOPDIR)/../../$(LOSCFG_BOARD_CONFIG_PATH) $(LOSCFG_BOARD_CONFIG_PATH)),)
LOSCFG_BOARD_CONFIG_PATH := $(LOSCFG_BOARD_CONFIG_PATH:%/config/board=%/board)
endif
ifeq ($(LOSCFG_COMPILER_HIMIX_32), y)
CROSS_COMPILE := arm-linux-ohoseabi-
else ifeq ($(LOSCFG_COMPILER_CLANG_LLVM), y)
CROSS_COMPILE := llvm-
endif
-include $(LITEOS_CONFIG_FILE)
HIDE := @
CC :=
......@@ -52,13 +42,10 @@ NM :=
MKDIR = mkdir
OBJ_MKDIR = if [ ! -d $(dir $@) ]; then mkdir -p $(dir $@); fi
RM = -rm -rf
ECHO = echo
ifeq ($(OS),)
OS := $(shell uname -s)
export OS
endif
COMPILE_NAME := $(patsubst %-,%,$(CROSS_COMPILE))
VERSION_NUM :=
ARFLAGS := cr
......@@ -87,7 +74,6 @@ LITEOS_PLATFORM_INCLUDE :=
LITEOS_CXXINCLUDE :=
LITEOS_LD_PATH :=
LITEOS_LD_SCRIPT :=
LITEOS_MK_PATH :=
## c as cxx ld flags ##
LITEOS_ASFLAGS :=
LITEOS_CFLAGS :=
......@@ -104,26 +90,33 @@ LIB_SUBDIRS :=
ifeq ($(LITEOSTHIRDPARTY),)
LITEOSTHIRDPARTY := $(LITEOSTOPDIR)/../../third_party
endif
LOSCFG_BOARD_CONFIG_PATH := $(LOSCFG_BOARD_CONFIG_PATH:"%"=%)
ifeq ($(wildcard $(LITEOSTOPDIR)/../../$(LOSCFG_BOARD_CONFIG_PATH) $(LOSCFG_BOARD_CONFIG_PATH)),)
LOSCFG_BOARD_CONFIG_PATH := $(LOSCFG_BOARD_CONFIG_PATH:%/config/board=%/board)
endif
ifeq ($(LOSCFG_COMPILER_HIMIX_32), y)
CROSS_COMPILE ?= arm-linux-ohoseabi-
LITEOS_COMPILER_PATH ?= $(LITEOSTOPDIR)/../../prebuilts/gcc/linux-x86/arm/arm-linux-ohoseabi-gcc/bin/
else ifeq ($(LOSCFG_COMPILER_CLANG_LLVM), y)
CROSS_COMPILE ?= llvm-
LITEOS_COMPILER_PATH ?= $(LITEOSTOPDIR)/../../prebuilts/clang/ohos/linux-x86_64/llvm/bin/
endif
ifeq ($(wildcard $(LITEOS_COMPILER_PATH)),)
LITEOS_COMPILER_PATH := $(patsubst %/$(CROSS_COMPILE)as,%/,$(shell which $(CROSS_COMPILE)as))
endif
LITEOS_PLATFORM := $(LOSCFG_PLATFORM:"%"=%)
ifeq ($(OUTDIR),)
OUT = $(LITEOSTOPDIR)/out/$(LITEOS_PLATFORM)
LITEOS_TARGET_DIR = $(OUT)
KERNEL_COMPILE_ONLY = y
OUT = $(LITEOSTOPDIR)/out/$(LOSCFG_PRODUCT_NAME:"%"=%)
else
OUT = $(OUTDIR)
LITEOS_TARGET_DIR = $(OUT)/../../../
KERNEL_COMPILE_ONLY = n
endif
BUILD = $(OUT)/obj
MK_PATH = $(LITEOSTOPDIR)/tools/build/mk
CXX_PATH = $(LITEOSTOPDIR)/lib/cxxstl
JFFS_PATH = $(LITEOSTOPDIR)/fs/jffs2
LITEOS_SCRIPTPATH ?= $(LITEOSTOPDIR)/tools/scripts
LITEOS_MENUCONFIG_H ?= $(LITEOSTOPDIR)/config.h
LOSCFG_ENTRY_SRC = $(LITEOSTOPDIR)/platform/los_config.c
### include variable
MODULE = $(MK_PATH)/module.mk
MODULE = $(LITEOSTOPDIR)/tools/build/mk/module.mk
LITEOS_CMACRO += -D__LITEOS__ -DSECUREC_IN_KERNEL=0
AS_OBJS_LIBC_FLAGS = -D__ASSEMBLY__
......@@ -154,14 +147,8 @@ endif
####################################### Kernel Option Begin ###########################################
LITEOS_BASELIB += -lbase
LIB_SUBDIRS += kernel/base
LITEOS_KERNEL_INCLUDE := -I $(LITEOSTOPDIR)/kernel/include
LITEOS_BASELIB += -lbsp_config
LIB_SUBDIRS += $(LITEOSTOPDIR)/../../$(LOSCFG_BOARD_CONFIG_PATH)
ifeq ($(LOSCFG_PLATFORM_QEMU_ARM_VIRT_CA7), y)
LITEOS_PLATFORM_INCLUDE += -I $(LITEOSTOPDIR)/../../$(LOSCFG_BOARD_CONFIG_PATH)/include/
endif
LITEOS_KERNEL_INCLUDE := -I $(LITEOSTOPDIR)/kernel/include \
-I $(LITEOSTOPDIR)/kernel/base/include
ifeq ($(LOSCFG_KERNEL_CPUP), y)
LITEOS_BASELIB += -lcpup
......@@ -510,38 +497,30 @@ endif
############################# Security Option End ##############################
ifeq ($(LOSCFG_COMPILER_CLANG_LLVM), y)
ifeq ($(LITEOS_COMPILER_PATH),)
LITEOS_COMPILER_PATH := $(shell $(LITEOSTOPDIR)/tools/build/mk/get_llvm_compiler_path.sh "$(CROSS_COMPILE)" "$(LITEOSTOPDIR)")
export LITEOS_COMPILER_PATH
endif
CC = $(LITEOS_COMPILER_PATH)/bin/clang
AS = $(LITEOS_COMPILER_PATH)/bin/$(CROSS_COMPILE)as
AR = $(LITEOS_COMPILER_PATH)/bin/$(CROSS_COMPILE)ar
LD = $(LITEOS_COMPILER_PATH)/bin/ld.lld
GPP = $(LITEOS_COMPILER_PATH)/bin/clang++
OBJCOPY = $(LITEOS_COMPILER_PATH)/bin/$(CROSS_COMPILE)objcopy -R .bss
OBJDUMP = $(LITEOS_COMPILER_PATH)/bin/$(CROSS_COMPILE)objdump
SIZE = $(LITEOS_COMPILER_PATH)/bin/$(CROSS_COMPILE)size
NM = $(LITEOS_COMPILER_PATH)/bin/$(CROSS_COMPILE)nm
STRIP = $(LITEOS_COMPILER_PATH)/bin/$(CROSS_COMPILE)strip
CC = $(LITEOS_COMPILER_PATH)clang
AS = $(LITEOS_COMPILER_PATH)$(CROSS_COMPILE)as
AR = $(LITEOS_COMPILER_PATH)$(CROSS_COMPILE)ar
LD = $(LITEOS_COMPILER_PATH)ld.lld
GPP = $(LITEOS_COMPILER_PATH)clang++
OBJCOPY = $(LITEOS_COMPILER_PATH)$(CROSS_COMPILE)objcopy -R .bss
OBJDUMP = $(LITEOS_COMPILER_PATH)$(CROSS_COMPILE)objdump
SIZE = $(LITEOS_COMPILER_PATH)$(CROSS_COMPILE)size
NM = $(LITEOS_COMPILER_PATH)$(CROSS_COMPILE)nm
STRIP = $(LITEOS_COMPILER_PATH)$(CROSS_COMPILE)strip
LLVM_TARGET := arm-liteos
LLVM_EXTRA_OPTS := -target $(LLVM_TARGET) -fms-extensions -Wno-address-of-packed-member
LLVM_EXTRA_LD_OPTS := -fuse-ld=lld --rtlib=compiler-rt
else
ifeq ($(LITEOS_COMPILER_PATH),)
LITEOS_COMPILER_PATH := $(shell $(LITEOSTOPDIR)/tools/build/mk/get_compiler_path.sh "$(CROSS_COMPILE)" "$(LITEOSTOPDIR)")
export LITEOS_COMPILER_PATH
endif
CC = $(LITEOS_COMPILER_PATH)/bin/$(CROSS_COMPILE)gcc
AS = $(LITEOS_COMPILER_PATH)/bin/$(CROSS_COMPILE)as
AR = $(LITEOS_COMPILER_PATH)/bin/$(CROSS_COMPILE)ar
LD = $(LITEOS_COMPILER_PATH)/bin/$(CROSS_COMPILE)ld
GPP = $(LITEOS_COMPILER_PATH)/bin/$(CROSS_COMPILE)g++
OBJCOPY = $(LITEOS_COMPILER_PATH)/bin/$(CROSS_COMPILE)objcopy
OBJDUMP = $(LITEOS_COMPILER_PATH)/bin/$(CROSS_COMPILE)objdump
SIZE = $(LITEOS_COMPILER_PATH)/bin/$(CROSS_COMPILE)size
NM = $(LITEOS_COMPILER_PATH)/bin/$(CROSS_COMPILE)nm
STRIP = $(LITEOS_COMPILER_PATH)/bin/$(CROSS_COMPILE)strip
CC = $(LITEOS_COMPILER_PATH)$(CROSS_COMPILE)gcc
AS = $(LITEOS_COMPILER_PATH)$(CROSS_COMPILE)as
AR = $(LITEOS_COMPILER_PATH)$(CROSS_COMPILE)ar
LD = $(LITEOS_COMPILER_PATH)$(CROSS_COMPILE)ld
GPP = $(LITEOS_COMPILER_PATH)$(CROSS_COMPILE)g++
OBJCOPY = $(LITEOS_COMPILER_PATH)$(CROSS_COMPILE)objcopy
OBJDUMP = $(LITEOS_COMPILER_PATH)$(CROSS_COMPILE)objdump
SIZE = $(LITEOS_COMPILER_PATH)$(CROSS_COMPILE)size
NM = $(LITEOS_COMPILER_PATH)$(CROSS_COMPILE)nm
STRIP = $(LITEOS_COMPILER_PATH)$(CROSS_COMPILE)strip
endif
FP = -fno-omit-frame-pointer
......@@ -552,7 +531,7 @@ LITEOS_CXXOPTS_BASE += -std=c++11 -nostdlib -nostdinc -nostdinc++ -fexceptions
LITEOS_EXTKERNEL_INCLUDE := $(LITEOS_CPPSUPPORT_INCLUDE) $(LITEOS_DYNLOAD_INCLUDE) \
$(LITEOS_TICKLESS_INCLUDE) $(LITEOS_TRACE_INCLUDE) \
$(LITEOS_VDSO_INCLUDE) $(LITEOS_LITEIPC_INCLUDE) \
$(LITEOS_PIPE_INCLUDE)
$(LITEOS_PIPE_INCLUDE) $(LITEOS_CPUP_INCLUDE)
LITEOS_COMPAT_INCLUDE := $(LITEOS_POSIX_INCLUDE) $(LITEOS_LINUX_INCLUDE) \
$(LITEOS_BSD_INCLUDE)
LITEOS_FS_INCLUDE := $(LITEOS_VFS_INCLUDE) $(LITEOS_FAT_CACHE_INCLUDE) \
......@@ -636,12 +615,6 @@ endif
LITEOS_BASELIB += $(shell $(_CC) "-print-libgcc-file-name")
LITEOS_LIB_INCLUDE += -isystem $(shell $(_CC) "-print-file-name=include")
# temporary
LITEOS_PLATFORM_INCLUDE += \
-I $(LITEOSTOPDIR)/kernel/base/include \
-I $(LITEOSTOPDIR)/kernel/extended/cpup \
-I $(LITEOSTOPDIR)/kernel/extended/trace
LITEOS_CXXINCLUDE = $(LITEOS_INCLUDE)
LITEOS_COPTS_NODEBUG := $(LITEOS_NODEBUG) $(LITEOS_COPTS_BASE) $(LITEOS_COPTS_EXTRA)
......
......@@ -27,14 +27,7 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
ifeq ($(OS), Linux)
OBJOUT := $(BUILD)$(dir $(subst $(LITEOSTOPDIR),,$(shell pwd)))$(MODULE_NAME)
LOCAL_PWD := $(shell pwd)
else
TEMPLITEOSTOPDIR:=$(shell cygpath -u $(LITEOSTOPDIR))
OBJOUT := $(BUILD)$(dir $(subst $(TEMPLITEOSTOPDIR),,$(shell pwd)))$(MODULE_NAME)
LOCAL_PWD := $(shell cygpath -m $(shell pwd))
endif
ifeq ($(LOCAL_SO), y)
LIBSO := $(OUT)/lib/lib$(MODULE_NAME).so
......@@ -59,7 +52,7 @@ LOCAL_ASMOBJS := $(patsubst %.S,$(OBJOUT)/%.o,$(LOCAL_ASMSRCS))
LOCAL_ASMOBJS2 := $(patsubst %.s,$(OBJOUT)/%.o,$(LOCAL_ASMSRCS2))
LOCAL_CCOBJS := $(patsubst %.cc,$(OBJOUT)/%.o,$(LOCAL_CCSRCS))
LOCAL_OBJS := $(LOCAL_COBJS) $(LOCAL_CPPOBJS) $(LOCAL_ASMOBJS) $(LOCAL_ASMOBJS2)$(LOCAL_CCOBJS)
LOCAL_OBJS := $(LOCAL_COBJS) $(LOCAL_CPPOBJS) $(LOCAL_ASMOBJS) $(LOCAL_ASMOBJS2) $(LOCAL_CCOBJS)
LOCAL_CGCH := $(patsubst %.h,%.h.gch,$(LOCAL_CHS))
LOCAL_CPPGCH := $(patsubst %.h,%.h.gch,$(LOCAL_CPPHS))
......
......@@ -28,20 +28,10 @@
# 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.
set -e
if [ $# -ne 3 ];then
exit 1
fi
VERSION=$1
ROOTFS_DIR=$2
OUT_DIR=$3
RELEASE_TIME=$(date "+%Y-%m-%d %H:%M:%S")
echo VERSION=\"${VERSION}\" > ${ROOTFS_DIR}/etc/os-release
echo RELEASE_TIME=\"${RELEASE_TIME}\" >> ${ROOTFS_DIR}/etc/os-release
if [ ! -d ${OUT_DIR}etc ]; then
mkdir -p ${OUT_DIR}etc
fi
cp ${ROOTFS_DIR}/etc/os-release ${OUT_DIR}etc
......@@ -32,28 +32,18 @@ set -e
OUT=$1
ROOTFS_DIR=$2
OUT_DIR=$3
BIN_DIR=${OUT}/bin
LIB_DIR=${OUT}/musl
ETC_DIR=${OUT}/etc
NEED_COPYTO_OUTDIR=(shell toybox mksh tftp)
mkdir -p ${ROOTFS_DIR}/bin ${ROOTFS_DIR}/lib ${ROOTFS_DIR}/usr/bin ${ROOTFS_DIR}/usr/lib ${ROOTFS_DIR}/etc \
${ROOTFS_DIR}/app ${ROOTFS_DIR}/data ${ROOTFS_DIR}/proc ${ROOTFS_DIR}/dev ${ROOTFS_DIR}/data/system ${ROOTFS_DIR}/data/system/param \
${ROOTFS_DIR}/system ${ROOTFS_DIR}/system/internal ${ROOTFS_DIR}/system/external ${OUT_DIR}/bin ${OUT_DIR}/libs ${OUT_DIR}/etc
${ROOTFS_DIR}/system ${ROOTFS_DIR}/system/internal ${ROOTFS_DIR}/system/external
if [ -d "${BIN_DIR}" ] && [ "$(ls -A "${BIN_DIR}")" != "" ]; then
cp -f ${BIN_DIR}/* ${ROOTFS_DIR}/bin
for el in ${NEED_COPYTO_OUTDIR[@]}
do
if [ -e ${BIN_DIR}/$el ] && [ "${BIN_DIR}/$el" != "${OUT_DIR}/bin/$el" ]; then
cp -u ${BIN_DIR}/$el ${OUT_DIR}/bin/$el
fi
done
fi
cp -f ${LIB_DIR}/* ${ROOTFS_DIR}/lib
cp -u ${LIB_DIR}/* ${OUT_DIR}/libs
if [ -e ${ETC_DIR}/.mkshrc ]; then
cp -f ${ETC_DIR}/.mkshrc ${ROOTFS_DIR}/etc
cp -u ${ETC_DIR}/.mkshrc ${OUT_DIR}/etc
fi
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册