mathis-s/SoomRV

Suppress 'make clean' error

jserv opened this issue · 1 comments

jserv commented

The current 'clean' target utilizes rm -f to remove the obj_dir directory. However, this approach only works if the directory already exists. In other words, it fails if someone runs the following commands:

$ make clean
rm -r obj_dir
$ make clean
rm -r obj_dir
rm: cannot remove 'obj_dir': No such file or directory
make: *** [Makefile:85: clean] Error 1

The above error can be suppressed with the change below:

--- a/Makefile
+++ b/Makefile
@@ -82,4 +82,4 @@ setup:
        make -j $(nproc) -C riscv-isa-sim
        
 clean:
-       rm -r obj_dir
+       $(RM) -f obj_dir

Should be fixed now. I have adjusted your patch to $(RM) -r obj_dir, as $(RM) implicitly includes -f, but not -r.