From 1367dee9867b123d8a8d3f3fb56999a07fe276d4 Mon Sep 17 00:00:00 2001 From: Relintai Date: Fri, 5 Jan 2024 22:30:43 +0100 Subject: [PATCH] Split off the readme and licenses to different files in the merger script. --- tools/merger/join.py | 6 ++++++ tools/merger/sfw_3rd_full.x.inl | 26 ++------------------------ tools/merger/sfw_full.cpp.inl | 3 ++- tools/merger/sfw_full.h.inl | 27 ++------------------------- tools/merger/sfw_linceses.inl.h | 24 ++++++++++++++++++++++++ tools/merger/sfw_readme.inl.h | 2 ++ 6 files changed, 38 insertions(+), 50 deletions(-) create mode 100644 tools/merger/sfw_linceses.inl.h create mode 100644 tools/merger/sfw_readme.inl.h diff --git a/tools/merger/join.py b/tools/merger/join.py index 127ac1b..5d967c3 100644 --- a/tools/merger/join.py +++ b/tools/merger/join.py @@ -79,6 +79,12 @@ def process_command(name, value): res += process_file(file.read()) res += "#line 0" return res + elif name == "FILEINLINE": + file_path = os.path.join(input_path, value) + print("Appending inline file: " + value) + with open(file_path, "r") as file: + res = process_file(file.read()) + return res def process_template(template): regex = r"{{([A-Z]*):([\w./]*)}}" diff --git a/tools/merger/sfw_3rd_full.x.inl b/tools/merger/sfw_3rd_full.x.inl index fa943d5..eef180c 100644 --- a/tools/merger/sfw_3rd_full.x.inl +++ b/tools/merger/sfw_3rd_full.x.inl @@ -1,29 +1,7 @@ -// https://github.com/Relintai/sfw -/* -Copyright (c) 2023-present Péter Magyar. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. -*/ - -// TODO gather all licenses to here +{{FILEINLINE:tools/merger/sfw_readme.inl.h}} +{{FILEINLINE:tools/merger/sfw_linceses.inl.h}} #ifdef SFW_3RD_IMPL #define GLAD_GL_IMPLEMENTATION // glad diff --git a/tools/merger/sfw_full.cpp.inl b/tools/merger/sfw_full.cpp.inl index f0ff248..8f04f85 100644 --- a/tools/merger/sfw_full.cpp.inl +++ b/tools/merger/sfw_full.cpp.inl @@ -1,6 +1,7 @@ -//Add the implementation unroll macros here before including sfw.h +{{FILEINLINE:tools/merger/sfw_readme.inl.h}} +{{FILEINLINE:tools/merger/sfw_linceses.inl.h}} #include #include diff --git a/tools/merger/sfw_full.h.inl b/tools/merger/sfw_full.h.inl index 24e8d1e..4777785 100644 --- a/tools/merger/sfw_full.h.inl +++ b/tools/merger/sfw_full.h.inl @@ -1,31 +1,8 @@ #ifndef SFW_H #define SFW_H -// https://github.com/Relintai/sfw - -/* -Copyright (c) 2023-present Péter Magyar. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. -*/ - -// TODO gather all licenses to here +{{FILEINLINE:tools/merger/sfw_readme.inl.h}} +{{FILEINLINE:tools/merger/sfw_linceses.inl.h}} #define _REENTRANT diff --git a/tools/merger/sfw_linceses.inl.h b/tools/merger/sfw_linceses.inl.h new file mode 100644 index 0000000..f9657c0 --- /dev/null +++ b/tools/merger/sfw_linceses.inl.h @@ -0,0 +1,24 @@ + +/* +Copyright (c) 2023-present Péter Magyar. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +// TODO gather all licenses to here diff --git a/tools/merger/sfw_readme.inl.h b/tools/merger/sfw_readme.inl.h new file mode 100644 index 0000000..9f37881 --- /dev/null +++ b/tools/merger/sfw_readme.inl.h @@ -0,0 +1,2 @@ + +// https://github.com/Relintai/sfw