bugfix: 编译错误时仍可启动虚拟机的问题

This commit is contained in:
fslongjin 2022-09-01 15:44:30 +08:00
parent 00181545f8
commit 08df258142
3 changed files with 20 additions and 2 deletions

View File

@ -29,6 +29,10 @@ kernel:
echo "make all in $$subdir";\
cd $$subdir;\
$(MAKE) all;\
if [ "$$?" != "0" ]; then\
echo "内核编译失败";\
exit 1;\
fi;\
cd ..;\
done
@ -39,7 +43,11 @@ user:
@list='./user'; for subdir in $$list; do \
echo "make all in $$subdir";\
cd $$subdir;\
$(MAKE) all;\
$(MAKE) all;\
if [ "$$?" != "0" ]; then\
echo "用户态程序编译失败";\
exit 1;\
fi;\
cd ..;\
done

View File

@ -42,6 +42,9 @@ all: kernel
cd $$x;\
$(MAKE) generate_kallsyms kernel_root_path="$(shell pwd)";\
cd ..;\
if [ "$$?" != "0" ]; then\
exit $$?;\
fi;\
done
# 重新链接
@ -59,7 +62,6 @@ $(kernel_subdirs): ECHO
$(MAKE) -C $@ all CFLAGS="$(CFLAGS)" ASFLAGS="$(ASFLAGS)" PIC="$(PIC)" kernel_root_path="$(shell pwd)"
kernel: head.o main.o $(kernel_subdirs)

8
run.sh
View File

@ -28,11 +28,19 @@ if [ ! "$1" == "--nobuild" ]; then
echo "运行在docker内"
IN_DOCKER=1
make all -j 16
if [ "$?" != "0" ]; then\
echo "DragonOS编译失败";\
exit 1;\
fi;\
make clean
GENERATE_ISO=1
else
make all -j 16
if [ "$?" != "0" ]; then\
echo "DragonOS编译失败";\
exit 1;\
fi;\
make clean
GENERATE_ISO=1
fi