X-Git-Url: http://nitlanguage.org diff --git a/src/c_tools.nit b/src/c_tools.nit index df2ddd8..61c1f9c 100644 --- a/src/c_tools.nit +++ b/src/c_tools.nit @@ -47,7 +47,7 @@ class CCompilationUnit # files to compile TODO check is appropriate var files = new Array[String] - # Add `c_function` as a `static` function local to this unit + # Add a `static` `c_function` to be strictly local to this unit fun add_local_function(c_function: CFunction) do body_decl.add "static {c_function.signature};\n" @@ -55,10 +55,10 @@ class CCompilationUnit body_impl.add c_function.to_writer end - # Add `c_function` as a public function to this unit + # Add a public `c_function` accessible from outside this compilation unit fun add_exported_function(c_function: CFunction) do - header_decl.add "{c_function.signature};\n" + body_decl.add "{c_function.signature};\n" body_impl.add "\n" body_impl.add c_function.to_writer end @@ -105,7 +105,8 @@ end # An extern file to compile class ExternFile - # The filename of the file + + # Filename relative to the nit-compile folder var filename: String # The name of the target in the Makefile @@ -118,6 +119,7 @@ class ExternFile fun compiles_to_o_file: Bool do return false + # Is `self` a Java file to include in the JAR archive? fun add_to_jar: Bool do return false # Additional libraries needed for the compilation @@ -142,13 +144,13 @@ class ExternCFile end redef fun makefile_rule_content do - var ff = filename.basename("") + var ff = filename.basename var o = makefile_rule_name var pkg = "" if not pkgconfigs.is_empty then pkg = "`pkg-config --cflags {pkgconfigs.join(" ")}`" end - return "$(CC) $(CFLAGS) {self.cflags} {pkg} -c -o {o} {ff}" + return "$(CC) $(CFLAGS) -Wall -Wno-unused-function {self.cflags} {pkg} -c -o {o} {ff}" end redef fun compiles_to_o_file do return true