compiler: fix make clean for makefile generation
authorHugo Leblanc <dullin@hololink.org>
Thu, 3 Jan 2019 22:22:08 +0000 (17:22 -0500)
committerHugo Leblanc <dullin@hololink.org>
Sat, 12 Jan 2019 04:19:58 +0000 (23:19 -0500)
Add -f option to rm so that the clean doesn't error if the files are absent
Signed-off-by: Hugo Leblanc <dullin@hololink.org>

src/compiler/abstract_compiler.nit

index 75e9cc5..32dd807 100644 (file)
@@ -556,9 +556,9 @@ endif
                end
                makefile.write("{outpath}: {dep_rules.join(" ")}\n\t$(CC) $(LDFLAGS) -o {outpath.escape_to_sh} {ofiles.join(" ")} $(LDLIBS) {pkg}\n\n")
                # Clean
-               makefile.write("clean:\n\trm {ofiles.join(" ")} 2>/dev/null\n")
+               makefile.write("clean:\n\trm -f {ofiles.join(" ")} 2>/dev/null\n")
                if outpath != real_outpath then
-                       makefile.write("\trm -- {outpath.escape_to_sh} 2>/dev/null\n")
+                       makefile.write("\trm -f -- {outpath.escape_to_sh} 2>/dev/null\n")
                end
                makefile.close
                self.toolcontext.info("Generated makefile: {makepath}", 2)