Rewrite the lunabuild toolchain with enhanced feature (#60)
[lunaix-os.git] / lunaix-os / LBuild
index f4bb7c847da726eca3e1c1bd757b45ae9f9a0d8f..04a0f54c88797b3ca0f20f08528261d4975514a3 100644 (file)
@@ -1,9 +1,23 @@
-use("kernel")
-use("libs")
-use("arch")
-use("hal")
-
-headers([
-    "includes",
-    "includes/usr"
-])
\ No newline at end of file
+from . import kernel, libs, arch, hal
+
+src.h += "includes", "includes/usr"
+
+flag.cc += "-ffreestanding", "-fno-pie"
+
+flag.cc += (
+    "-Wall -Wextra -Werror",
+    "-Wno-unknown-pragmas",
+    "-Wno-unused-function",
+    "-Wno-unused-variable",
+    "-Wno-unused-but-set-variable",
+    "-Wno-unused-parameter",
+    "-Wno-discarded-qualifiers",
+    "-Werror=incompatible-pointer-types"
+)
+
+flag.cc += (
+    "-fno-omit-frame-pointer",
+    "-finline-small-functions",
+)
+
+flag.ld += "-nostdlib", "-nolibc", "-z noexecstack", "-no-pie", "-Wl,--build-id=none"
\ No newline at end of file