🎨 change clean command in makefiles
This commit is contained in:
parent
0d1069a724
commit
d5996d6a1d
4
makefile
4
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
|
||||
|
|
|
@ -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
|
|
@ -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<reg_size;i+=1)
|
||||
reg[i]=0;
|
||||
println("[",os.time(),"] init memory, memory size: ",mem_size/1024/1024,"MB.");
|
||||
println("[",os.time(),"] init memory, memory size: ",mem_size/1024/1024," MB.");
|
||||
setsize(mem,mem_size);
|
||||
for(var i=0;i<mem_size;i+=1)
|
||||
mem[i]=0;
|
||||
|
@ -86,6 +86,7 @@ var ctx_info=func(){
|
|||
}
|
||||
}
|
||||
var exec=func(info=1){
|
||||
println("[",os.time(),"] executing ...");
|
||||
while(1){
|
||||
ir=[mem[pc],mem[pc+1],mem[pc+2],mem[pc+3]];
|
||||
if(info)ctx_info();
|
||||
|
@ -145,6 +146,7 @@ var exec=func(info=1){
|
|||
}
|
||||
pc+=4;
|
||||
}
|
||||
println("[",os.time(),"] execute complete.");
|
||||
};
|
||||
return {exec:exec};
|
||||
}(
|
||||
|
|
|
@ -62,12 +62,12 @@ var speed_test=func(){
|
|||
for(var i=0;i<5e5;i+=1){
|
||||
invoke(fd,40);
|
||||
}
|
||||
println("[time ] limited call: ",int(1e6/tm.elapsedMSec())," call/ms");
|
||||
println("[time ] limited call: ",int(5e5/tm.elapsedMSec())," call/ms");
|
||||
tm.stamp();
|
||||
for(var i=0;i<5e5;i+=1){
|
||||
vec_call(fd,40);
|
||||
}
|
||||
println("[time ] dynamic call: ",int(1e6/tm.elapsedMSec())," call/ms");
|
||||
println("[time ] dynamic call: ",int(5e5/tm.elapsedMSec())," call/ms");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue