From 5652878249475319567847b9882ecce1f7bd1ae0 Mon Sep 17 00:00:00 2001 From: fslongjin Date: Sun, 11 Sep 2022 21:28:19 +0800 Subject: [PATCH] =?UTF-8?q?bugfix:=20=E7=94=A8=E6=88=B7=E6=80=81=E7=A8=8B?= =?UTF-8?q?=E5=BA=8F=E7=BC=96=E8=AF=91=E9=94=99=E8=AF=AF=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 1 - kernel/Makefile | 2 +- user/Makefile | 14 ++++++-------- user/apps/Makefile | 15 ++++++++------- 4 files changed, 15 insertions(+), 17 deletions(-) diff --git a/Makefile b/Makefile index abfc9a07..06307071 100644 --- a/Makefile +++ b/Makefile @@ -19,7 +19,6 @@ endif .PHONY: all all: kernel user - .PHONY: kernel diff --git a/kernel/Makefile b/kernel/Makefile index 29d60f07..8bdb98d7 100644 --- a/kernel/Makefile +++ b/kernel/Makefile @@ -53,7 +53,7 @@ all: kernel @echo "Generating kernel ELF file..." # 生成内核文件 objcopy -I elf64-x86-64 -O elf64-x86-64 -R ".comment" -R ".eh_frame" kernel ../bin/kernel/kernel.elf - @echo "Done." + @echo "Kernel Build Done." ECHO: @echo "$@" diff --git a/user/Makefile b/user/Makefile index ebce6c1c..e4758252 100644 --- a/user/Makefile +++ b/user/Makefile @@ -15,19 +15,17 @@ current_CFLAGS := $(CFLAGS) ECHO: @echo "$@" -$(user_sub_dirs): 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" - -other_dirs: $(user_sub_dirs) - -all: sys_api_lib +app: $(user_sub_dirs) + +all: app $(shell if [ ! -e $(tmp_output_dir) ];then mkdir -p $(tmp_output_dir); fi) $(shell if [ ! -e $(output_dir) ];then mkdir -p $(output_dir); fi) - -# 在成功编译系统库之后,开始编译用户态其他文件 - $(MAKE) other_dirs + + @echo 用户态程序编译完成 # 系统库 sys_api_lib: diff --git a/user/apps/Makefile b/user/apps/Makefile index 92a29751..adf7df74 100644 --- a/user/apps/Makefile +++ b/user/apps/Makefile @@ -1,10 +1,11 @@ user_apps_sub_dirs=shell about -all: - @list='$(user_apps_sub_dirs)'; for subdir in $$list; do \ - echo "make all in $$subdir";\ - cd $$subdir;\ - $(MAKE) all CFLAGS="$(CFLAGS) -I $(shell pwd)";\ - cd ..;\ - done \ No newline at end of file +ECHO: + @echo "$@" + +$(user_apps_sub_dirs): ECHO + + $(MAKE) -C $@ all CFLAGS="$(CFLAGS)" tmp_output_dir="$(tmp_output_dir)" output_dir="$(output_dir)" sys_libs_dir="$(sys_libs_dir)" + +all: $(user_apps_sub_dirs) \ No newline at end of file