diff --git a/Makefile b/Makefile index 25420eda..abfc9a07 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/kernel/Makefile b/kernel/Makefile index ddae0775..29d60f07 100644 --- a/kernel/Makefile +++ b/kernel/Makefile @@ -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) diff --git a/run.sh b/run.sh index c3e73972..7d20f8ea 100755 --- a/run.sh +++ b/run.sh @@ -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