From eef2a4af10d8e4604ccb0f8f211b4120c1ebcb7f Mon Sep 17 00:00:00 2001 From: Amlal Date: Sat, 21 Dec 2024 09:29:39 +0100 Subject: IMPL: Fix Makefile, don't mention missing libbtb. Signed-off-by: Amlal --- cli/ManifestCLI.cc | 79 ---------------------------------------------- cli/ToolCLI.cc | 79 ++++++++++++++++++++++++++++++++++++++++++++++ makefile | 2 +- src/JSONManifestBuilder.cc | 2 +- 4 files changed, 81 insertions(+), 81 deletions(-) delete mode 100644 cli/ManifestCLI.cc create mode 100644 cli/ToolCLI.cc diff --git a/cli/ManifestCLI.cc b/cli/ManifestCLI.cc deleted file mode 100644 index 01ac73e..0000000 --- a/cli/ManifestCLI.cc +++ /dev/null @@ -1,79 +0,0 @@ -// ============================================================= // -// btb -// Copyright (C) 2024, Theater Quality Inc, all rights reserved. -// ============================================================= // - -#include -#include - -static bool kFailed = false; -static bool kDryRun = false; - -int main(int argc, char** argv) -{ - if (argc <= 1) - return 1; - - for (size_t index = 1; index < argc; ++index) - { - std::string index_path = argv[index]; - - if (index_path == "-v" || - index_path == "--version") - { - std::cout << "Usage: btb \n"; - std::cout << "Check for issues at: el-mahrouss-logic.com/developer/issues\n"; - - std::cout << "Brought to you by Theater Quality Inc.\n"; - std::cout << "© Theater Quality Inc, all rights reserved.\n"; - - return 0; - } - else if (index_path == "--dry-run") - { - kDryRun = true; - continue; - } - else if (index_path == "-h" || - index_path == "--help") - { - std::cout << "btb: Build a JSON file: btb .json\n"; - - return 0; - } - - std::thread job_build_thread([](std::string index_path) -> void { - IManifestBuilder* builder = nullptr; - - const auto kJsonExtension = ".json"; - - if (index_path.ends_with(kJsonExtension)) - { - builder = new JSONManifestBuilder(); - } - else - { - kFailed = true; - return; - } - - std::cout << "btb: building: " << index_path << std::endl; - - if (builder && !builder->buildTarget(index_path.size(), index_path.c_str(), kDryRun)) - { - kFailed = true; - } - else if (!builder) - { - kFailed = true; - } - - delete builder; - builder = nullptr; - }, index_path); - - job_build_thread.join(); - } - - return kFailed ? EXIT_FAILURE : EXIT_SUCCESS; -} diff --git a/cli/ToolCLI.cc b/cli/ToolCLI.cc new file mode 100644 index 0000000..01ac73e --- /dev/null +++ b/cli/ToolCLI.cc @@ -0,0 +1,79 @@ +// ============================================================= // +// btb +// Copyright (C) 2024, Theater Quality Inc, all rights reserved. +// ============================================================= // + +#include +#include + +static bool kFailed = false; +static bool kDryRun = false; + +int main(int argc, char** argv) +{ + if (argc <= 1) + return 1; + + for (size_t index = 1; index < argc; ++index) + { + std::string index_path = argv[index]; + + if (index_path == "-v" || + index_path == "--version") + { + std::cout << "Usage: btb \n"; + std::cout << "Check for issues at: el-mahrouss-logic.com/developer/issues\n"; + + std::cout << "Brought to you by Theater Quality Inc.\n"; + std::cout << "© Theater Quality Inc, all rights reserved.\n"; + + return 0; + } + else if (index_path == "--dry-run") + { + kDryRun = true; + continue; + } + else if (index_path == "-h" || + index_path == "--help") + { + std::cout << "btb: Build a JSON file: btb .json\n"; + + return 0; + } + + std::thread job_build_thread([](std::string index_path) -> void { + IManifestBuilder* builder = nullptr; + + const auto kJsonExtension = ".json"; + + if (index_path.ends_with(kJsonExtension)) + { + builder = new JSONManifestBuilder(); + } + else + { + kFailed = true; + return; + } + + std::cout << "btb: building: " << index_path << std::endl; + + if (builder && !builder->buildTarget(index_path.size(), index_path.c_str(), kDryRun)) + { + kFailed = true; + } + else if (!builder) + { + kFailed = true; + } + + delete builder; + builder = nullptr; + }, index_path); + + job_build_thread.join(); + } + + return kFailed ? EXIT_FAILURE : EXIT_SUCCESS; +} diff --git a/makefile b/makefile index adf380b..80f4277 100644 --- a/makefile +++ b/makefile @@ -1,7 +1,7 @@ .PHONY: build-btb build-btb: - sudo g++ -I./BTBKit -I./vendor $(wildcard cli/*.cc) $(wildcard src/*.cc) -std=c++20 -L/usr/local -lbtb -o btb + sudo g++ -I./BTBKit -I./vendor $(wildcard cli/*.cc) $(wildcard src/*.cc) -std=c++20 -o btb sudo cp btb /usr/local/bin .PHONY: build-btb-windows diff --git a/src/JSONManifestBuilder.cc b/src/JSONManifestBuilder.cc index 358f990..b16ae82 100644 --- a/src/JSONManifestBuilder.cc +++ b/src/JSONManifestBuilder.cc @@ -105,7 +105,7 @@ bool JSONManifestBuilder::buildTarget(int arg_sz, const char* arg_val, const boo if (ret_exec > 0) { - std::cout << "btb: error: exec exit with code: " << ret_exec << "." << std::endl; + std::cout << "btb: error: exec exit with code: " << ret_exec << "" << std::endl; return false; } -- cgit v1.2.3