mirror of
https://github.com/DragonOS-Community/DragonOS.git
synced 2025-06-09 02:46:47 +00:00
bugfix: 用户态程序编译错误的问题
This commit is contained in:
parent
774ebf0763
commit
5652878249
1
Makefile
1
Makefile
@ -21,7 +21,6 @@ endif
|
||||
all: kernel user
|
||||
|
||||
|
||||
|
||||
.PHONY: kernel
|
||||
kernel:
|
||||
mkdir -p bin/kernel/
|
||||
|
@ -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 "$@"
|
||||
|
@ -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:
|
||||
|
@ -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
|
||||
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)
|
Loading…
x
Reference in New Issue
Block a user