make_links.pyΒΆ
This page describes the script make_links.py
The script make_links.py
recreates the links for the header files and source files needed to compile plugin_stub.
It is called by the Makefile prior to any compilation in this directory.
#!/usr/bin/python
from sys import argv, exit
import os
linkfiles = {"core" : ["PopBase.h"],
"actions" : ["Action.h",
"Action.cpp"],
"populations": ["PopulationFactory.h",
"DynPopFactory.h",
"DynPopFactory.cpp"]
}
qhg_base = os.environ.get("QHG4_DIR")
for subdir in linkfiles:
for f in linkfiles[subdir]:
fCur = "./"+f
# remove file if it already exists
if os.path.exists(fCur):
os.remove(fCur)
#-- end if
# create the actual link
print("linking %s %s"%("%s/%s/%s"%(qhg_base,subdir,f), fCur))
os.symlink("%s/%s/%s"%(qhg_base, subdir, f), fCur)
#-- end for
#-- end for