加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
Makefile.uk 4.54 KB
一键复制 编辑 原始数据 按行查看 历史
$(eval $(call addlib,appmortise))
################################################################################
# Include Libraries
################################################################################
ASINCLUDES += -I$(CONFIG_MT_BASE)/include
CINCLUDES += -I$(CONFIG_MT_BASE)/include
CXXINCLUDES += -I$(CONFIG_MT_BASE)/include
ifneq ($(strip $(VM_CONFIG_FILE)),)
APPMORTISE_SRCS-y += $(VM_CONFIG_FILE)
else
$(error VM_CONFIG_FILE is not set)
endif
ifeq ($(CONFIG_UK_ARCH),arm64)
ASINCLUDES += -I$(CONFIG_MT_BASE)/arch/arm64/include
CINCLUDES += -I$(CONFIG_MT_BASE)/arch/arm64/include
CXXINCLUDES += -I$(CONFIG_MT_BASE)/arch/arm64/include
APPMORTISE_SRCS-y += $(CONFIG_MT_BASE)/arch/arm64/aborts.c
APPMORTISE_SRCS-y += $(CONFIG_MT_BASE)/arch/arm64/boot.S
APPMORTISE_SRCS-y += $(CONFIG_MT_BASE)/arch/arm64/cache.c
APPMORTISE_SRCS-y += $(CONFIG_MT_BASE)/arch/arm64/exceptions.S
APPMORTISE_SRCS-y += $(CONFIG_MT_BASE)/arch/arm64/iommu.c
APPMORTISE_SRCS-y += $(CONFIG_MT_BASE)/arch/arm64/page_table.c
APPMORTISE_SRCS-y += $(CONFIG_MT_BASE)/arch/arm64/pagetables.S
APPMORTISE_SRCS-y += $(CONFIG_MT_BASE)/arch/arm64/psci.c
APPMORTISE_SRCS-y += $(CONFIG_MT_BASE)/arch/arm64/smc.c
APPMORTISE_SRCS-y += $(CONFIG_MT_BASE)/arch/arm64/smmuv2.c
endif
################################################################################
# Include platforms
################################################################################
PLATFORM_BASE = $(CONFIG_MT_BASE)/platform
PLATFORM ?= qemu-aarch64-virt
ASINCLUDES += -I$(PLATFORM_BASE)/$(PLATFORM)/include
CINCLUDES += -I$(PLATFORM_BASE)/$(PLATFORM)/include
CXXINCLUDES += -I$(PLATFORM_BASE)/$(PLATFORM)/include
APPMORTISE_SRCS-y += $(PLATFORM_BASE)/$(PLATFORM)/desc.c
################################################################################
# Build flags
################################################################################
APPMORTISE_SUPPRESS_FLAGS += -Wno-unused-parameter -Wno-sign-compare -Wno-missing-field-initializers
CFLAGS-y += $(APPMORTISE_SUPPRESS_FLAGS)
CXXFLAGS-y += $(APPMORTISE_SUPPRESS_FLAGS)
################################################################################
# Generate depedency header files
################################################################################
cur_dir:=$(CONFIG_MT_BASE)
src_dir:=$(CONFIG_MT_BASE)
build_dir:=$(CONFIG_MT_BASE)/workdir/build
generated_header_dir:=$(build_dir)/include
cpu_arch_dir=$(src_dir)/arch/arm64
asm_defs_src:=$(cpu_arch_dir)/asm_defs.c
TOOLS_HEADERS += $(CINCLUDES)
TOOLS_HEADERS += -I$(CONFIG_MT_BASE)/lib/config/include
TOOLS_HEADERS += -I$(CONFIG_MT_BASE)/lib/mem/include
TOOLS_HEADERS += -I$(CONFIG_MT_BASE)/lib/memprot/mmu/include
TOOLS_HEADERS += -I$(CONFIG_MT_BASE)/lib/cache/include
TOOLS_HEADERS += -I$(CONFIG_MT_BASE)/lib/bitmap/include
TOOLS_HEADERS += -I$(CONFIG_MT_BASE)/lib/vm/include
TOOLS_HEADERS += -I$(CONFIG_MT_BASE)/lib/interrupts/include
TOOLS_HEADERS += -I$(CONFIG_MT_BASE)/lib/interrupts/arch/arm64/include
TOOLS_HEADERS += -I$(CONFIG_MT_BASE)/lib/ipimsg/include
TOOLS_HEADERS += -I$(CONFIG_MT_BASE)/lib/cpu/include
asm_defs_hdr:= $(generated_header_dir)/mt/asm_defs.h
ifneq ($(wildcard $(asm_defs_src)),)
$(asm_defs_hdr): $(asm_defs_src)
@mkdir -p $(generated_header_dir)/mt
@echo "Generating header 11 $(patsubst $(cur_dir)/%, %, $@)"
@$(CC) -S $(CFLAGS) $(TOOLS_HEADERS) -DGENERATING_DEFS $< -o - \
| awk '($$1 == "->") { gsub("#", "", $$3); print "#define " $$2 " " $$3 }' > $@
endif
tools_dir:=$(CONFIG_MT_BASE)/tools
tools_build_dir:=$(build_dir)
config_def_generator_src:=$(tools_dir)/config_defs_gen.c
config_def_generator:=$(tools_build_dir)/config_defs_gen
config_defs:=$(generated_header_dir)/mt/config_defs_gen.h
uk_config_header_dir:=$(src_dir)/include/uk/bits
uk_config_header:=$(uk_config_header_dir)/config.h
$(uk_config_header):
@mkdir -p $(uk_config_header_dir)
@touch $@
config_src:=$(VM_CONFIG_FILE)
build_macros:=
$(config_def_generator): $(config_def_generator_src) $(config_src) $(uk_config_header)
@echo "Compiling generator $(TOOLS_HEADERS) $(patsubst $(cur_dir)/%, %, $@)"
@$(HOSTCC) $^ $(build_macros) $(CFLAGS) -DGENERATING_DEFS \
$(TOOLS_HEADERS) -o $@
$(config_defs): $(config_def_generator) $(uk_config_header)
@echo "Generating header $(patsubst $(cur_dir)/%, %, $@)"
@$(config_def_generator) > $(config_defs)
@rm -f $(uk_config_header)
ASINCLUDES += -I$(generated_header_dir)
CINCLUDES += -I$(generated_header_dir)
CXXINCLUDES += -I$(generated_header_dir)
UK_PREPROCESS += $(asm_defs_hdr)
UK_PREPROCESS += $(config_defs)
UK_CLEAN += $(asm_defs_hdr)
UK_CLEAN += $(config_defs)
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化