From d5996d6a1dd23db3317c4e644eb807933bf6e1b1 Mon Sep 17 00:00:00 2001 From: ValKmjolnir Date: Sun, 25 Dec 2022 17:58:05 +0800 Subject: [PATCH] :art: change clean command in makefiles --- makefile | 4 ++-- module/makefile | 14 +++++++++----- test/mcpu.nas | 6 ++++-- test/module_test.nas | 4 ++-- 4 files changed, 17 insertions(+), 11 deletions(-) diff --git a/makefile b/makefile index 48f44f1..ed16d64 100644 --- a/makefile +++ b/makefile @@ -28,8 +28,8 @@ stable-release-mingw:$(SRC) $(CXX) -std=$(STD) -O2 main.cpp -o nasal.exe -fno-exceptions -Wshadow -Wall -static clean: - -@ rm ./nasal - -@ rm ./nasal.exe + @ if [ -e nasal ]; then rm nasal; fi + @ if [ -e nasal.exe ]; then rm nasal.exe; fi test:nasal @ ./nasal -e test/ascii-art.nas diff --git a/module/makefile b/module/makefile index 1f985b9..d506850 100644 --- a/module/makefile +++ b/module/makefile @@ -1,4 +1,4 @@ -.PHONY=clean all mingw-all +.PHONY=clean all winall dynamic_libs_so=libfib.so libkey.so libnasock.so libmat.so dynamic_libs_dll=libfib.dll libkey.dll libnasock.dll libmat.dll @@ -57,7 +57,11 @@ libmat.dll: matrix.cpp $(used_header) @ del matrix.o clean: - @ echo "[clean] so" - -@ rm $(dynamic_libs_so) - @ echo "[clean] dll" - -@ rm $(dynamic_libs_dll) + @ echo "[clean] libfib.so" && if [ -e libfib.so ]; then rm libfib.so; fi + @ echo "[clean] libkey.so" && if [ -e libkey.so ]; then rm libkey.so; fi + @ echo "[clean] libnasock.so" && if [ -e libnasock.so ]; then rm libnasock.so; fi + @ echo "[clean] libmat.so" && if [ -e libmat.so ]; then rm libmat.so; fi + @ echo "[clean] libfib.dll" &&if [ -e libfib.dll ]; then rm libfib.dll; fi + @ echo "[clean] libkey.dll" &&if [ -e libkey.dll ]; then rm libkey.dll; fi + @ echo "[clean] libnasock.dll" &&if [ -e libnasock.dll ]; then rm libnasock.dll; fi + @ echo "[clean] libmat.dll" &&if [ -e libmat.dll ]; then rm libmat.dll; fi \ No newline at end of file diff --git a/test/mcpu.nas b/test/mcpu.nas index e3a3db4..767d4dd 100644 --- a/test/mcpu.nas +++ b/test/mcpu.nas @@ -50,13 +50,13 @@ var reg_size=32; var pc=0; var ir=[0,0,0,0]; # 32 bit instruction word var mem=[]; -var mem_size=1024*1024*1; # memory size, byte +var mem_size=1024*1024*4; # memory size, byte var init=func(){ println("[",os.time(),"] init ",reg_size," registers."); setsize(reg,reg_size); # 8 bit address wire for(var i=0;i