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