summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@nekernel.org>2025-07-17 07:32:30 +0100
committerAmlal El Mahrouss <amlal@nekernel.org>2025-07-17 07:36:57 +0100
commit20252df698106283d15ddf7d53f4e0dd9462666d (patch)
treebf77733ab5fddd3f09962cde9a22e9f1d485b6c9
parentcaecbd4e6eb2877b7e9bdd4fb2e4f3e370b336c9 (diff)
refactor! Lots of breaking changes to the codebase.
feat: Rename ‘btb‘ to ‘nebuild‘ to match nekernel.org's naming scheme. Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
-rw-r--r--.github/workflows/c-cpp.yml2
-rw-r--r--.gitignore2
-rw-r--r--GNUmakefile14
-rw-r--r--ReadMe.md4
-rw-r--r--compile_flags.txt2
-rw-r--r--dev/BuildKit/IManifestBuilder.h (renamed from BTBKit/IManifestBuilder.h)6
-rw-r--r--dev/BuildKit/Includes.h (renamed from BTBKit/Includes.h)2
-rw-r--r--dev/BuildKit/JSONManifestBuilder.h (renamed from BTBKit/JSONManifestBuilder.h)4
-rw-r--r--dev/BuildKit/Macros.h (renamed from BTBKit/Macros.h)4
-rw-r--r--dev/cli/CommandLine.cc (renamed from cli/CommandLine.cc)10
-rw-r--r--dev/examples/example_01_hello_world/hello_world.cc (renamed from examples/example_01_hello_world/hello_world.cc)0
-rw-r--r--dev/examples/example_01_hello_world/posix.json (renamed from examples/example_01_hello_world/posix.json)0
-rw-r--r--dev/examples/example_01_hello_world/win64.json (renamed from examples/example_01_hello_world/win64.json)0
-rw-r--r--dev/examples/example_02_libbtb/README.md (renamed from examples/example_02_libbtb/README.md)0
-rw-r--r--dev/examples/example_02_libbtb/libbtb.cc (renamed from examples/example_02_libbtb/libbtb.cc)2
-rw-r--r--dev/examples/example_02_libbtb/posix.json (renamed from examples/example_02_libbtb/posix.json)0
-rw-r--r--dev/examples/example_02_libbtb/win64.json (renamed from examples/example_02_libbtb/win64.json)0
-rw-r--r--dev/src/IManifestBuilder.cc (renamed from src/IManifestBuilder.cc)4
-rw-r--r--dev/src/JSONManifestBuilder.cc (renamed from src/JSONManifestBuilder.cc)26
-rw-r--r--osx-dylib.json6
-rw-r--r--osx.json6
-rw-r--r--posix.json6
-rw-r--r--win64.json6
23 files changed, 51 insertions, 55 deletions
diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml
index 6f7b609..f3f03e1 100644
--- a/.github/workflows/c-cpp.yml
+++ b/.github/workflows/c-cpp.yml
@@ -16,4 +16,4 @@ jobs:
- name: Install Packages
run: sudo apt update && sudo apt install build-essential
- name: Build BTB
- run: make build-btb \ No newline at end of file
+ run: make build-nebuild \ No newline at end of file
diff --git a/.gitignore b/.gitignore
index 1511910..16285f7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,7 +3,7 @@ syntax: glob
html/
latex/
-btb
+nebuild
.cmake/
.qtc_clangd/
diff --git a/GNUmakefile b/GNUmakefile
index f3c888f..a008b1e 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -4,20 +4,20 @@ GCC_MINGW=x86_64-w64-mingw32-g++
CXXFLAGS=-I./ -I./vendor
CXXSTD= -std=c++20
SRC=$(wildcard cli/*.cc) $(wildcard src/*.cc)
-OUT=btb
+OUT=nebuild
CP=cp
-.PHONY: build-btb
-build-btb:
+.PHONY: build-nebuild
+build-nebuild:
$(SUDO) $(GCC) $(CXXFLAGS) $(SRC) $(CXXSTD) -o $(OUT)
$(SUDO) $(CP) $(OUT) /usr/local/bin
-.PHONY: build-btb-windows
-build-btb-windows:
+.PHONY: build-nebuild-windows
+build-nebuild-windows:
$(GCC_MINGW) $(CXXFLAGS) $(SRC) -o $(OUT).exe
.PHONY: help
help:
@echo "=> help: Show this help message."
- @echo "=> build-btb-windows: Build BTB for Windows."
- @echo "=> build-btb: Build BTB for POSIX."
+ @echo "=> build-nebuild-windows: Build BTB for Windows."
+ @echo "=> build-nebuild: Build BTB for POSIX."
diff --git a/ReadMe.md b/ReadMe.md
index 46363f3..d3430be 100644
--- a/ReadMe.md
+++ b/ReadMe.md
@@ -10,10 +10,10 @@
## Guide (GNU Make):
-- Run make `build-btb-core` and `build-btb`.
+- Run make `build-nebuild-core` and `build-nebuild`.
## Guide (NeBuild):
-- Run `btb` and pass the path to the manifest file.
+- Run `nebuild` and pass the path to the manifest file.
###### Copyright (C) 2024-2025, Amlal El Mahrouss and NeKernel.org Authors, all rights reserved.
diff --git a/compile_flags.txt b/compile_flags.txt
index 3edd1b0..bb1d0d2 100644
--- a/compile_flags.txt
+++ b/compile_flags.txt
@@ -1,3 +1,3 @@
-std=c++20
--I./
+-Idev/
-Ivendor \ No newline at end of file
diff --git a/BTBKit/IManifestBuilder.h b/dev/BuildKit/IManifestBuilder.h
index e11d431..1c160c4 100644
--- a/BTBKit/IManifestBuilder.h
+++ b/dev/BuildKit/IManifestBuilder.h
@@ -1,12 +1,12 @@
// ============================================================= //
-// btb
+// nebuild
// Copyright (C) 2024-2025, Amlal El Mahrouss, all rights reserved.
// ============================================================= //
#pragma once
-#include <BTBKit/Includes.h>
-#include <BTBKit/Macros.h>
+#include <BuildKit/Includes.h>
+#include <BuildKit/Macros.h>
#define BTB_MANIFEST_BUILDER : public BTB::IManifestBuilder
diff --git a/BTBKit/Includes.h b/dev/BuildKit/Includes.h
index 3695d53..e321483 100644
--- a/BTBKit/Includes.h
+++ b/dev/BuildKit/Includes.h
@@ -1,5 +1,5 @@
// ============================================================= //
-// btb
+// nebuild
// Copyright (C) 2024-2025, Amlal El Mahrouss, all rights reserved.
// ============================================================= //
diff --git a/BTBKit/JSONManifestBuilder.h b/dev/BuildKit/JSONManifestBuilder.h
index f5d874c..a4fe66b 100644
--- a/BTBKit/JSONManifestBuilder.h
+++ b/dev/BuildKit/JSONManifestBuilder.h
@@ -1,11 +1,11 @@
// ============================================================= //
-// btb
+// nebuild
// Copyright (C) 2024-2025, Amlal El Mahrouss, all rights reserved.
// ============================================================= //
#pragma once
-#include <BTBKit/IManifestBuilder.h>
+#include <BuildKit/IManifestBuilder.h>
#include <json.h>
namespace BTB {
diff --git a/BTBKit/Macros.h b/dev/BuildKit/Macros.h
index c2d6194..1b1613d 100644
--- a/BTBKit/Macros.h
+++ b/dev/BuildKit/Macros.h
@@ -1,5 +1,5 @@
// ============================================================= //
-// btb
+// nebuild
// Copyright (C) 2024-2025, Amlal El Mahrouss, all rights reserved.
// ============================================================= //
@@ -28,7 +28,7 @@ namespace BTB::Logger {
/// @brief replacement for std::cout for BTB logging.
inline std::ostream& info() noexcept {
auto& out = std::cout;
- out << rang::fg::red << "btb: " << rang::style::reset;
+ out << rang::fg::red << "nebuild: " << rang::style::reset;
return out;
}
} // namespace BTB::Logger
diff --git a/cli/CommandLine.cc b/dev/cli/CommandLine.cc
index 300db6f..e199e61 100644
--- a/cli/CommandLine.cc
+++ b/dev/cli/CommandLine.cc
@@ -1,11 +1,11 @@
// ============================================================= //
-// btb
+// nebuild
// Copyright (C) 2024-2025, Amlal El Mahrouss, all rights reserved.
// ============================================================= //
-#include <BTBKit/Includes.h>
-#include <BTBKit/JSONManifestBuilder.h>
+#include <BuildKit/Includes.h>
+#include <BuildKit/JSONManifestBuilder.h>
static bool kFailed = false;
static bool kDryRun = false;
@@ -21,14 +21,14 @@ int main(int argc, char** argv) {
BTB::Logger::info() << "© 2024-2025 Amlal El Mahrouss, all rights reserved.\n";
BTB::Logger::info()
- << "Bugs, issues? Check out: https://github.com/nekernel-org/btb/issues\n";
+ << "Bugs, issues? Check out: https://github.com/nekernel-org/nebuild/issues\n";
return EXIT_SUCCESS;
} else if (index_path == "--dry-run") {
kDryRun = true;
continue;
} else if (index_path == "-h" || index_path == "--help") {
- BTB::Logger::info() << "Usage: btb <file>\n";
+ BTB::Logger::info() << "Usage: nebuild <file>\n";
return EXIT_SUCCESS;
}
diff --git a/examples/example_01_hello_world/hello_world.cc b/dev/examples/example_01_hello_world/hello_world.cc
index ae47ce8..ae47ce8 100644
--- a/examples/example_01_hello_world/hello_world.cc
+++ b/dev/examples/example_01_hello_world/hello_world.cc
diff --git a/examples/example_01_hello_world/posix.json b/dev/examples/example_01_hello_world/posix.json
index c3c8151..c3c8151 100644
--- a/examples/example_01_hello_world/posix.json
+++ b/dev/examples/example_01_hello_world/posix.json
diff --git a/examples/example_01_hello_world/win64.json b/dev/examples/example_01_hello_world/win64.json
index 4af5bdd..4af5bdd 100644
--- a/examples/example_01_hello_world/win64.json
+++ b/dev/examples/example_01_hello_world/win64.json
diff --git a/examples/example_02_libbtb/README.md b/dev/examples/example_02_libbtb/README.md
index 26ccb72..26ccb72 100644
--- a/examples/example_02_libbtb/README.md
+++ b/dev/examples/example_02_libbtb/README.md
diff --git a/examples/example_02_libbtb/libbtb.cc b/dev/examples/example_02_libbtb/libbtb.cc
index 21e3e17..0b4d7c4 100644
--- a/examples/example_02_libbtb/libbtb.cc
+++ b/dev/examples/example_02_libbtb/libbtb.cc
@@ -1,4 +1,4 @@
-#include <BTBKit/JSONManifestBuilder.h>
+#include <BuildKit/JSONManifestBuilder.h>
#include <cstdlib>
#ifndef _WIN32
diff --git a/examples/example_02_libbtb/posix.json b/dev/examples/example_02_libbtb/posix.json
index 871712e..871712e 100644
--- a/examples/example_02_libbtb/posix.json
+++ b/dev/examples/example_02_libbtb/posix.json
diff --git a/examples/example_02_libbtb/win64.json b/dev/examples/example_02_libbtb/win64.json
index 658ee0f..658ee0f 100644
--- a/examples/example_02_libbtb/win64.json
+++ b/dev/examples/example_02_libbtb/win64.json
diff --git a/src/IManifestBuilder.cc b/dev/src/IManifestBuilder.cc
index b3f4de8..1397dd4 100644
--- a/src/IManifestBuilder.cc
+++ b/dev/src/IManifestBuilder.cc
@@ -1,6 +1,6 @@
// ============================================================= //
-// btb
+// nebuild
// Copyright (C) 2024-2025, Amlal El Mahrouss, all rights reserved.
// ============================================================= //
-#include <BTBKit/IManifestBuilder.h>
+#include <BuildKit/IManifestBuilder.h>
diff --git a/src/JSONManifestBuilder.cc b/dev/src/JSONManifestBuilder.cc
index 50850f5..e93bcb7 100644
--- a/src/JSONManifestBuilder.cc
+++ b/dev/src/JSONManifestBuilder.cc
@@ -1,12 +1,13 @@
// ============================================================= //
-// btb
+// nebuild
// Copyright (C) 2024-2025, Amlal El Mahrouss, all rights reserved.
// ============================================================= //
-#include <BTBKit/JSONManifestBuilder.h>
+#include <BuildKit/JSONManifestBuilder.h>
using String = std::string;
using JSON = nlohmann::json;
+
namespace FS = std::filesystem;
using namespace BTB;
@@ -19,19 +20,14 @@ using namespace BTB;
bool JSONManifestBuilder::buildTarget(int arg_sz, const char* arg_val, const bool dry_run) {
String path;
- if (!arg_val) {
- BTB::Logger::info() << "btb: error: file path is empty" << std::endl;
- return false;
- }
-
- if (arg_sz < 0) {
- BTB::Logger::info() << "btb: error: file path is empty" << std::endl;
+ if (!arg_val || arg_sz < 0) {
+ BTB::Logger::info() << "nebuild: error: file path is empty" << std::endl;
return false;
} else {
- path = arg_val;
+ path += arg_val;
if (!FS::exists(path)) {
- BTB::Logger::info() << "btb: error: file '" << path << "' does not exist" << std::endl;
+ BTB::Logger::info() << "nebuild: error: file '" << path << "' does not exist" << std::endl;
return false;
}
}
@@ -40,7 +36,7 @@ bool JSONManifestBuilder::buildTarget(int arg_sz, const char* arg_val, const boo
std::ifstream json(path);
if (!json.good()) {
- BTB::Logger::info() << "btb: error: file '" << path << "' is not a valid JSON" << std::endl;
+ BTB::Logger::info() << "nebuild: error: file '" << path << "' is not a valid JSON" << std::endl;
return false;
}
@@ -112,12 +108,12 @@ bool JSONManifestBuilder::buildTarget(int arg_sz, const char* arg_val, const boo
ss << file.rdbuf();
- if (ss.str()[0] == 'J' && ss.str()[1] == 'o' && ss.str()[2] == 'y' && ss.str()[3] == '!')
+ if (ss.str()[0] == 'O' && ss.str()[1] == 'p' && ss.str()[2] == 'e' && ss.str()[3] == 'n')
BTB::Logger::info()
<< "error: can't open PEF dynamic library, it mayn't contain an entrypoint"
<< std::endl;
- else if (ss.str()[0] == '!' && ss.str()[1] == 'y' && ss.str()[2] == 'o' &&
- ss.str()[3] == 'J')
+ else if (ss.str()[0] == 'n' && ss.str()[1] == 'e' && ss.str()[2] == 'p' &&
+ ss.str()[3] == 'O')
BTB::Logger::info()
<< "error: can't open FEP dynamic library, it mayn't contain an entrypoint"
<< std::endl;
diff --git a/osx-dylib.json b/osx-dylib.json
index 80917d2..3c49abb 100644
--- a/osx-dylib.json
+++ b/osx-dylib.json
@@ -1,10 +1,10 @@
{
"compiler_path": "g++",
"compiler_std": "c++20",
- "headers_path": ["./", "vendor"],
- "sources_path": ["src/*.cc"],
+ "headers_path": ["dev", "vendor"],
+ "sources_path": ["dev/src/*.cc"],
"output_name": "libBTB.dylib",
"compiler_flags": ["-fPIC", "-shared"],
- "cpp_macros": ["BTB_POSIX", "BTB_OSX"],
+ "cpp_macros": ["BTB_DYLIB", "BTB_OSX"],
"run_after_build": false
}
diff --git a/osx.json b/osx.json
index 20d513d..b4a860c 100644
--- a/osx.json
+++ b/osx.json
@@ -1,9 +1,9 @@
{
"compiler_path": "g++",
"compiler_std": "c++20",
- "headers_path": ["./", "vendor"],
- "sources_path": ["src/*.cc", "cli/*.cc"],
- "output_name": "btb",
+ "headers_path": ["dev", "vendor"],
+ "sources_path": ["dev/src/*.cc", "dev/cli/*.cc"],
+ "output_name": "nebuild",
"compiler_flags": ["-fPIC"],
"cpp_macros": ["BTB_POSIX", "BTB_OSX"],
"run_after_build": false
diff --git a/posix.json b/posix.json
index e53cc14..540c877 100644
--- a/posix.json
+++ b/posix.json
@@ -1,9 +1,9 @@
{
"compiler_path": "g++",
"compiler_std": "c++20",
- "headers_path": ["./", "vendor"],
- "sources_path": ["src/*.cc", "cli/*.cc"],
- "output_name": "btb",
+ "headers_path": ["dev/", "vendor"],
+ "sources_path": ["dev/src/*.cc", "dev/cli/*.cc"],
+ "output_name": "nebuild",
"compiler_flags": ["-fPIC"],
"cpp_macros": ["BTB_POSIX"],
"run_after_build": false
diff --git a/win64.json b/win64.json
index a4a2ecc..65a42be 100644
--- a/win64.json
+++ b/win64.json
@@ -1,9 +1,9 @@
{
"compiler_path": "x86_64-w64-mingw32-g++.exe",
"compiler_std": "c++20",
- "headers_path": ["./", "vendor"],
- "sources_path": ["src/*.cc", "cli/*.cc"],
- "output_name": "btb.exe",
+ "headers_path": ["dev", "vendor"],
+ "sources_path": ["dev/src/*.cc", "dev/cli/*.cc"],
+ "output_name": "nebuild.exe",
"compiler_flags": ["-fPIC"],
"cpp_macros": ["BTB_WINDOWS"],
"run_after_build": false