mirror of
https://github.com/LCPQ/quantum_package
synced 2025-01-09 20:48:47 +01:00
Beter separation in development mode and production one
This commit is contained in:
parent
d36d9e3177
commit
5e98b8c2ae
@ -666,20 +666,26 @@ def ninja_binaries_build(path_module, l_children, d_binaries):
|
|||||||
# s t r i n g #
|
# s t r i n g #
|
||||||
# ~#~#~#~#~#~ #
|
# ~#~#~#~#~#~ #
|
||||||
|
|
||||||
path_readme = os.path.join(path_module.abs, "README.rst")
|
|
||||||
path_png = os.path.join(path_module.abs, "tree_dependency.png")
|
|
||||||
|
|
||||||
l_string = ["build {0}: build_binaries {1} {2}".format(" ".join(l_abs_bin),
|
l_string = ["build {0}: build_binaries {1} {2}".format(" ".join(l_abs_bin),
|
||||||
EZFIO_LIB,
|
EZFIO_LIB,
|
||||||
ninja_module_path),
|
ninja_module_path),
|
||||||
" module_abs = {0}".format(path_module.abs),
|
" module_abs = {0}".format(path_module.abs),
|
||||||
" module_rel = {0}".format(path_module.rel), ""]
|
" module_rel = {0}".format(path_module.rel), ""]
|
||||||
|
|
||||||
l_string += ["build module_{0}: phony {1} {2} {3}".format(path_module.rel,
|
return l_string
|
||||||
|
|
||||||
|
|
||||||
|
def ninja_module_build(path_module, d_binaries):
|
||||||
|
|
||||||
|
l_abs_bin = [binary.abs for binary in d_binaries[path_module]]
|
||||||
|
|
||||||
|
path_readme = os.path.join(path_module.abs, "README.rst")
|
||||||
|
path_png = os.path.join(path_module.abs, "tree_dependency.png")
|
||||||
|
|
||||||
|
l_string = ["build module_{0}: phony {1} {2} {3}".format(path_module.rel,
|
||||||
" ".join(l_abs_bin),
|
" ".join(l_abs_bin),
|
||||||
path_readme,
|
path_readme,
|
||||||
path_png
|
path_png), ""]
|
||||||
), ""]
|
|
||||||
|
|
||||||
return l_string
|
return l_string
|
||||||
|
|
||||||
@ -732,17 +738,19 @@ def create_build_ninja_module(path_module):
|
|||||||
""]
|
""]
|
||||||
|
|
||||||
l_string += ["rule make_local_binaries",
|
l_string += ["rule make_local_binaries",
|
||||||
" command = ninja -f {0} module_{1}".format(
|
" command = ninja -f {0} module_{1}".format(ROOT_BUILD_NINJA, path_module.rel),
|
||||||
ROOT_BUILD_NINJA, path_module.rel), " pool = console",
|
" pool = console",
|
||||||
" description = Compile only {0}".format(path_module.rel),
|
" description = Compile only {0}".format(path_module.rel),
|
||||||
""]
|
""]
|
||||||
|
|
||||||
l_string += ["rule make_all_binaries",
|
l_string += ["rule make_all_binaries",
|
||||||
" command = ninja -f {0}".format(ROOT_BUILD_NINJA),
|
" command = ninja -f {0}".format(ROOT_BUILD_NINJA),
|
||||||
" pool = console", " description = Compiling all modules",
|
" pool = console",
|
||||||
|
" description = Compiling all modules",
|
||||||
""]
|
""]
|
||||||
|
|
||||||
l_string += ["rule make_clean", " command = module_handler.py clean {0}".format(path_module.rel),
|
l_string += ["rule make_clean",
|
||||||
|
" command = module_handler.py clean {0}".format(path_module.rel),
|
||||||
" description = Cleaning module {0}".format(path_module.rel),
|
" description = Cleaning module {0}".format(path_module.rel),
|
||||||
""]
|
""]
|
||||||
|
|
||||||
@ -766,7 +774,7 @@ def create_build_ninja_global():
|
|||||||
" command = {0} update".format(__file__),
|
" command = {0} update".format(__file__),
|
||||||
""]
|
""]
|
||||||
|
|
||||||
l_string += ["rule make_all_binaries",
|
l_string += ["rule make_all",
|
||||||
" command = ninja -f {0}".format(ROOT_BUILD_NINJA),
|
" command = ninja -f {0}".format(ROOT_BUILD_NINJA),
|
||||||
" pool = console", " description = Compiling all modules",
|
" pool = console", " description = Compiling all modules",
|
||||||
""]
|
""]
|
||||||
@ -777,7 +785,7 @@ def create_build_ninja_global():
|
|||||||
|
|
||||||
l_string += ["build dummy_target: update_build_ninja_root",
|
l_string += ["build dummy_target: update_build_ninja_root",
|
||||||
"",
|
"",
|
||||||
"build all: make_all_binaries dummy_target",
|
"build all: make_all dummy_target",
|
||||||
"default all",
|
"default all",
|
||||||
"",
|
"",
|
||||||
"build clean: make_clean dummy_target",
|
"build clean: make_clean dummy_target",
|
||||||
@ -938,9 +946,16 @@ if __name__ == "__main__":
|
|||||||
l_string += ninja_irpf90_make_build(module_to_compile, l_children,
|
l_string += ninja_irpf90_make_build(module_to_compile, l_children,
|
||||||
d_irp)
|
d_irp)
|
||||||
|
|
||||||
|
if arguments["--development"]:
|
||||||
l_string += ninja_binaries_build(module_to_compile, l_children,
|
l_string += ninja_binaries_build(module_to_compile, l_children,
|
||||||
d_binaries)
|
d_binaries)
|
||||||
|
|
||||||
|
elif arguments["--production"]:
|
||||||
|
l_string += ninja_binaries_build(module_to_compile, l_children,
|
||||||
|
d_binaries)
|
||||||
|
|
||||||
|
l_string += ninja_module_build(module_to_compile, d_binaries)
|
||||||
|
|
||||||
l_string += ninja_gitignore_build(module_to_compile, d_binaries,
|
l_string += ninja_gitignore_build(module_to_compile, d_binaries,
|
||||||
l_symlink)
|
l_symlink)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user