From c2ebe8fd7195c24293cb48c7ec57b194e70c6a63 Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Thu, 24 Jul 2025 09:22:06 +0100 Subject: fix: Fix examples's contents and placed 'examples' in the root directory. Signed-off-by: Amlal El Mahrouss --- dev/examples/example_01_hello_world/hello_world.cc | 7 ------- dev/examples/example_01_hello_world/posix.json | 10 ---------- dev/examples/example_01_hello_world/win64.json | 10 ---------- dev/examples/example_02_libbtb/README.md | 7 ------- dev/examples/example_02_libbtb/libbtb.cc | 15 --------------- dev/examples/example_02_libbtb/posix.json | 20 -------------------- dev/examples/example_02_libbtb/win64.json | 19 ------------------- examples/example_01_hello_world/hello_world.cc | 7 +++++++ examples/example_01_hello_world/posix.json | 10 ++++++++++ examples/example_01_hello_world/win64.json | 10 ++++++++++ examples/example_02_libnebuild/README.md | 7 +++++++ examples/example_02_libnebuild/libnebuild.cc | 15 +++++++++++++++ examples/example_02_libnebuild/posix.json | 20 ++++++++++++++++++++ examples/example_02_libnebuild/win64.json | 19 +++++++++++++++++++ 14 files changed, 88 insertions(+), 88 deletions(-) delete mode 100644 dev/examples/example_01_hello_world/hello_world.cc delete mode 100644 dev/examples/example_01_hello_world/posix.json delete mode 100644 dev/examples/example_01_hello_world/win64.json delete mode 100644 dev/examples/example_02_libbtb/README.md delete mode 100644 dev/examples/example_02_libbtb/libbtb.cc delete mode 100644 dev/examples/example_02_libbtb/posix.json delete mode 100644 dev/examples/example_02_libbtb/win64.json create mode 100644 examples/example_01_hello_world/hello_world.cc create mode 100644 examples/example_01_hello_world/posix.json create mode 100644 examples/example_01_hello_world/win64.json create mode 100644 examples/example_02_libnebuild/README.md create mode 100644 examples/example_02_libnebuild/libnebuild.cc create mode 100644 examples/example_02_libnebuild/posix.json create mode 100644 examples/example_02_libnebuild/win64.json diff --git a/dev/examples/example_01_hello_world/hello_world.cc b/dev/examples/example_01_hello_world/hello_world.cc deleted file mode 100644 index ae47ce8..0000000 --- a/dev/examples/example_01_hello_world/hello_world.cc +++ /dev/null @@ -1,7 +0,0 @@ -#include -#include - -int main(int argc, char** argv) { - std::cout << "hello, world!\n"; - return 0; -} diff --git a/dev/examples/example_01_hello_world/posix.json b/dev/examples/example_01_hello_world/posix.json deleted file mode 100644 index c3c8151..0000000 --- a/dev/examples/example_01_hello_world/posix.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "compiler_path": "g++", - "compiler_std": "c++20", - "headers_path": ["lib"], - "sources_path": ["hello_world.cc"], - "output_name": "hello_world.elf", - "compiler_flags": ["-fPIC"], - "cpp_macros": ["FOO_MACRO"], - "run_after_build": true -} diff --git a/dev/examples/example_01_hello_world/win64.json b/dev/examples/example_01_hello_world/win64.json deleted file mode 100644 index 4af5bdd..0000000 --- a/dev/examples/example_01_hello_world/win64.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "compiler_path": "x86_64-w64-mingw32-g++", - "compiler_std": "c++20", - "headers_path": ["lib"], - "sources_path": ["hello_world.cc"], - "output_name": "hello_world.elf", - "compiler_flags": ["-fPIC"], - "cpp_macros": ["FOO_MACRO"], - "run_after_build": true -} diff --git a/dev/examples/example_02_libbtb/README.md b/dev/examples/example_02_libbtb/README.md deleted file mode 100644 index 21e64be..0000000 --- a/dev/examples/example_02_libbtb/README.md +++ /dev/null @@ -1,7 +0,0 @@ -# Notice for Deployment. - -In order to use libNeBuild, it shall live on the same directory, -
-or within a directory recognized in the `$LD_LIBRARY_PATH` or `$DYLD_LIBRARY_PATH` variable. - -## Thanks in advance. \ No newline at end of file diff --git a/dev/examples/example_02_libbtb/libbtb.cc b/dev/examples/example_02_libbtb/libbtb.cc deleted file mode 100644 index e6e489d..0000000 --- a/dev/examples/example_02_libbtb/libbtb.cc +++ /dev/null @@ -1,15 +0,0 @@ -#include -#include - -#ifndef _WIN32 -static auto kPath = "./posix.json"; -#else -static auto kPath = ".\win64.json"; -#endif - -int main(int argc, char** argv) { - auto builder = new NeBuild::JSONManifestBuilder(); - if (!builder) return EXIT_FAILURE; - - return builder->buildTarget(strlen(kPath), kPath); -} diff --git a/dev/examples/example_02_libbtb/posix.json b/dev/examples/example_02_libbtb/posix.json deleted file mode 100644 index 47f08ba..0000000 --- a/dev/examples/example_02_libbtb/posix.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "compiler_path": "g++", - "compiler_std": "c++20", - "headers_path": [ - "../../", - "../../vendor" - ], - "sources_path": [ - "libbtb.cc" - ], - "output_name": "libbtb.elf", - "compiler_flags": [ - "-L/usr/local/lib", - "-lNeBuild" - ], - "cpp_macros": [ - "FOO_MACRO" - ], - "run_after_build": true -} \ No newline at end of file diff --git a/dev/examples/example_02_libbtb/win64.json b/dev/examples/example_02_libbtb/win64.json deleted file mode 100644 index a873f5d..0000000 --- a/dev/examples/example_02_libbtb/win64.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "compiler_path": "x86_64-w64-mingw32-g++", - "compiler_std": "c++20", - "headers_path": [ - "../../", - "../../vendor" - ], - "sources_path": [ - "libbtb.cc" - ], - "output_name": "libbtb.exe", - "compiler_flags": [ - "-lNeBuild" - ], - "cpp_macros": [ - "FOO_MACRO" - ], - "run_after_build": true -} \ No newline at end of file diff --git a/examples/example_01_hello_world/hello_world.cc b/examples/example_01_hello_world/hello_world.cc new file mode 100644 index 0000000..ae47ce8 --- /dev/null +++ b/examples/example_01_hello_world/hello_world.cc @@ -0,0 +1,7 @@ +#include +#include + +int main(int argc, char** argv) { + std::cout << "hello, world!\n"; + return 0; +} diff --git a/examples/example_01_hello_world/posix.json b/examples/example_01_hello_world/posix.json new file mode 100644 index 0000000..c3c8151 --- /dev/null +++ b/examples/example_01_hello_world/posix.json @@ -0,0 +1,10 @@ +{ + "compiler_path": "g++", + "compiler_std": "c++20", + "headers_path": ["lib"], + "sources_path": ["hello_world.cc"], + "output_name": "hello_world.elf", + "compiler_flags": ["-fPIC"], + "cpp_macros": ["FOO_MACRO"], + "run_after_build": true +} diff --git a/examples/example_01_hello_world/win64.json b/examples/example_01_hello_world/win64.json new file mode 100644 index 0000000..4af5bdd --- /dev/null +++ b/examples/example_01_hello_world/win64.json @@ -0,0 +1,10 @@ +{ + "compiler_path": "x86_64-w64-mingw32-g++", + "compiler_std": "c++20", + "headers_path": ["lib"], + "sources_path": ["hello_world.cc"], + "output_name": "hello_world.elf", + "compiler_flags": ["-fPIC"], + "cpp_macros": ["FOO_MACRO"], + "run_after_build": true +} diff --git a/examples/example_02_libnebuild/README.md b/examples/example_02_libnebuild/README.md new file mode 100644 index 0000000..21e64be --- /dev/null +++ b/examples/example_02_libnebuild/README.md @@ -0,0 +1,7 @@ +# Notice for Deployment. + +In order to use libNeBuild, it shall live on the same directory, +
+or within a directory recognized in the `$LD_LIBRARY_PATH` or `$DYLD_LIBRARY_PATH` variable. + +## Thanks in advance. \ No newline at end of file diff --git a/examples/example_02_libnebuild/libnebuild.cc b/examples/example_02_libnebuild/libnebuild.cc new file mode 100644 index 0000000..e6e489d --- /dev/null +++ b/examples/example_02_libnebuild/libnebuild.cc @@ -0,0 +1,15 @@ +#include +#include + +#ifndef _WIN32 +static auto kPath = "./posix.json"; +#else +static auto kPath = ".\win64.json"; +#endif + +int main(int argc, char** argv) { + auto builder = new NeBuild::JSONManifestBuilder(); + if (!builder) return EXIT_FAILURE; + + return builder->buildTarget(strlen(kPath), kPath); +} diff --git a/examples/example_02_libnebuild/posix.json b/examples/example_02_libnebuild/posix.json new file mode 100644 index 0000000..989e712 --- /dev/null +++ b/examples/example_02_libnebuild/posix.json @@ -0,0 +1,20 @@ +{ + "compiler_path": "g++", + "compiler_std": "c++20", + "headers_path": [ + "../../dev", + "../../vendor" + ], + "sources_path": [ + "libnebuild.cc" + ], + "output_name": "libnebuild.elf", + "compiler_flags": [ + "-L/usr/local/lib", + "-lNeBuild" + ], + "cpp_macros": [ + "FOO_MACRO" + ], + "run_after_build": true +} \ No newline at end of file diff --git a/examples/example_02_libnebuild/win64.json b/examples/example_02_libnebuild/win64.json new file mode 100644 index 0000000..a873f5d --- /dev/null +++ b/examples/example_02_libnebuild/win64.json @@ -0,0 +1,19 @@ +{ + "compiler_path": "x86_64-w64-mingw32-g++", + "compiler_std": "c++20", + "headers_path": [ + "../../", + "../../vendor" + ], + "sources_path": [ + "libbtb.cc" + ], + "output_name": "libbtb.exe", + "compiler_flags": [ + "-lNeBuild" + ], + "cpp_macros": [ + "FOO_MACRO" + ], + "run_after_build": true +} \ No newline at end of file -- cgit v1.2.3