SubDir TOP scripts python ;

PYTHON_DATAFILES = cshelper.py csutils.py ;
PYTHON_SAMPLES = [ Wildcard py*.py tutorial*.py  ] ;

if $(PYTHON_DATAFILES)
{
  InstallData $(PYTHON_DATAFILES) : bindings python ;
  FileListEntriesData $(PYTHON_DATAFILES) : : python-bindings ;
}

# This is quite ugly. Normally, we avoid altering the source directory at all
# costs (except upon explicit request) since it might be read-only or
# shared. Unfortunately, however, if a user has the PYTHONPATH environment
# variable pointed at the source tree and uses the cspython plugin or pythmod
# extension or simply runs any of these scripts, then Python will excrete evil
# .pyc (and possibly .pyo) files within this directory. We would like to clean
# up these files despite the fact that it breaks our rule against altering the
# source tree. We make an exception in this case because Clean actions are
# allowed to fail without breaking the build, so the user is not negatively
# impacted even if removal of the .pyc and .pyo files fails for some reason.
PYTHON_TRASH = [ Wildcard *.pyc *.pyo ] ;
if $(PYTHON_TRASH)
{
  SEARCH on $(PYTHON_TRASH) = $(SEARCH_SOURCE) ;
  Clean distclean : $(PYTHON_TRASH) ;
}
