10
0
mirror of https://github.com/LCPQ/quantum_package synced 2024-06-25 22:52:15 +02:00

Cleaning makefile

This commit is contained in:
Thomas Applencourt 2015-05-13 18:15:01 +02:00
parent 65574036cd
commit 6e182577e3
3 changed files with 20 additions and 10 deletions

View File

@ -21,9 +21,6 @@ do
# Update Makefile.depend
${QPACKAGE_ROOT}/scripts/module/check_module.sh
# Update Makefile.depend
${QPACKAGE_ROOT}/scripts/module/module_handler.py save_makefile_depend
# Update EZFIO interface (create the irp.f90 and the ocaml)
${QPACKAGE_ROOT}/scripts/ezfio_interface/ei_handler.py --irpf90 --ocaml

View File

@ -165,11 +165,21 @@ def get_list_depend(l_module):
def save_makefile_depend(l_src, l_obj):
header = "# This file was created by the module_handler.py script. Do not modify it by hand."
with open("Makefile.depend", "w") as f:
f.write(header + "\n"*2)
f.write("SRC+= {0}".format(" ".join(l_src)) + "\n")
f.write("OBJ+= {0}".format(" ".join(l_obj)) + "\n")
f.write("\n")
try:
with open("Makefile.depend", "r") as f:
old_output = f.read()
except IOError:
old_output = None
output = "\n".join([header,
"\n",
"SRC+= {0}".format(" ".join(l_src)),
"OBJ+= {0}".format(" ".join(l_obj)),
"\n"])
if output != old_output:
with open("Makefile.depend", "w+") as f:
f.write(output)
def create_png_from_path(path):

View File

@ -24,7 +24,6 @@ NEEDED_CHILDREN_MODULES=$(shell module_handler.py print_genealogy)
# Check and update dependencies
include Makefile.depend
# Define the Makefile common variables
EZFIO_DIR=$(QPACKAGE_ROOT)/EZFIO
EZFIO=$(EZFIO_DIR)/lib/libezfio_irp.a
@ -36,7 +35,11 @@ clean_links:
LIB+=$(EZFIO) $(MKL)
IRPF90+=$(patsubst %, -I %, $(INCLUDE_DIRS)) $(IRPF90_FLAGS)
irpf90.make: $(filter-out IRPF90_temp/%, $(wildcard */*.irp.f)) $(wildcard *.irp.f) $(wildcard *.inc.f) Makefile $(EZFIO) NEEDED_CHILDREN_MODULES $(wildcard *.py)
# Update Makefile.depend
Makefile.depend: $(wildcart */Makefile)
${QPACKAGE_ROOT}/scripts/module/module_handler.py save_makefile_depend
irpf90.make: $(filter-out IRPF90_temp/%, $(wildcard */*.irp.f)) $(wildcard *.irp.f) $(wildcard *.inc.f) Makefile.depend Makefile $(EZFIO) NEEDED_CHILDREN_MODULES $(wildcard *.py)
- $(IRPF90)
- update_README.py