mirror of
https://github.com/DragonOS-Community/DragonOS.git
synced 2025-06-10 16:26:48 +00:00
* 添加了GCC_cross_compile——tool_chain * - 解决环境变量路径拼接时,多了`/`的问题 - apt安装时增加-y,不需用户确认 * 解决添加环境变量的命令有误的问题 * 修正编译错误时,还会执行下一步的问题 * new: 编译完成后清理临时文件 * 更新makefile * 调整:把grub安装在 $HOME/opt/dragonos-grub下 * new: 新增dockerfile * 将镜像源换成中科大的(原因是清华的总是ban掉用于构建镜像的服务器的ip) * 修改为基于debian bullseye构建 * 取消指定版本 * 修复MBR磁盘镜像未设置启动标志的bug * 取消在docker中安装grub * 安装grub的过程改到客户机上进行 * bootstrap.sh 添加--no-docker * 使用新版的docker编译镜像 * 修补, 添加了一些关于gcc的check Co-authored-by: longjin <longjin@RinGoTek.cn>
45 lines
1.3 KiB
Makefile
45 lines
1.3 KiB
Makefile
user_sub_dirs = apps
|
|
|
|
SUBDIR_ROOTS := .
|
|
DIRS := . $(shell find $(SUBDIR_ROOTS) -type d)
|
|
GARBAGE_PATTERNS := *.o *.s~ *.s *.S~ *.c~ *.h~ sys_api_lib
|
|
GARBAGE := $(foreach DIR,$(DIRS),$(addprefix $(DIR)/,$(GARBAGE_PATTERNS)))
|
|
|
|
|
|
tmp_output_dir=$(ROOT_PATH)/bin/tmp/user
|
|
output_dir=$(ROOT_PATH)/bin/user
|
|
|
|
CFLAGS := $(GLOBAL_CFLAGS) -I $(shell pwd)/libs
|
|
current_CFLAGS := $(CFLAGS)
|
|
|
|
ECHO:
|
|
@echo "$@"
|
|
|
|
$(user_sub_dirs): ECHO sys_api_lib
|
|
|
|
$(MAKE) -C $@ all CFLAGS="$(CFLAGS)" tmp_output_dir="$(tmp_output_dir)" output_dir="$(output_dir)" sys_libs_dir="$(shell pwd)/libs"
|
|
|
|
app: $(user_sub_dirs)
|
|
|
|
all: app
|
|
@if [ -z $$DragonOS_GCC ]; then echo "\033[31m [错误]尚未安装DragonOS交叉编译器, 请使用tools文件夹下的build_gcc_toolchain.sh脚本安装 \033[0m"; exit 1; fi
|
|
$(shell if [ ! -e $(tmp_output_dir) ];then mkdir -p $(tmp_output_dir); fi)
|
|
$(shell if [ ! -e $(output_dir) ];then mkdir -p $(output_dir); fi)
|
|
|
|
@echo 用户态程序编译完成
|
|
|
|
# 系统库
|
|
sys_api_lib:
|
|
$(MAKE) -C libs all CFLAGS="$(CFLAGS)" tmp_output_dir="$(tmp_output_dir)" output_dir="$(output_dir)" sys_libs_dir="$(shell pwd)/libs"
|
|
|
|
|
|
|
|
clean:
|
|
rm -rf $(GARBAGE)
|
|
$(MAKE) clean -C libs
|
|
@list='$(user_sub_dirs)'; for subdir in $$list; do \
|
|
echo "Clean in dir: $$subdir";\
|
|
cd $$subdir && $(MAKE) clean;\
|
|
cd .. ;\
|
|
done
|
|
|