From 83fdab16fcfb9079ffc9bb30800308413a4f7099 Mon Sep 17 00:00:00 2001 From: David Rose Date: Thu, 3 Jun 2004 22:39:42 +0000 Subject: [PATCH] install_python_source --- dtool/pptempl/Template.gmsvc.pp | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/dtool/pptempl/Template.gmsvc.pp b/dtool/pptempl/Template.gmsvc.pp index dc50bad3c1..ac87dd0b43 100644 --- a/dtool/pptempl/Template.gmsvc.pp +++ b/dtool/pptempl/Template.gmsvc.pp @@ -87,6 +87,14 @@ #define lxx_st_sources $[sort $[lxx_sources(metalib_target lib_target noinst_lib_target static_lib_target ss_lib_target bin_target noinst_bin_target test_bin_target test_lib_target)]] #define dep_sources_1 $[sort $[get_sources(metalib_target lib_target noinst_lib_target static_lib_target ss_lib_target bin_target noinst_bin_target test_bin_target test_lib_target)]] + // If there is an __init__.py in the directory, then all Python + // files in the directory just get installed without having to be + // named. + #if $[and $[INSTALL_PYTHON_SOURCE],$[wildcard $[TOPDIR]/$[DIRPREFIX]__init__.py]] + #define py_sources $[wildcard $[TOPDIR]/$[DIRPREFIX]*.py] + #endif + #define install_py $[py_sources:$[TOPDIR]/$[DIRPREFIX]%=%] + // These are the source files that our dependency cache file will // depend on. If it's an empty list, we won't bother writing rules to // freshen the cache file. @@ -152,6 +160,7 @@ $[if $[install_data],$[install_data_dir]] \ $[if $[install_config],$[install_config_dir]] \ $[if $[install_igatedb],$[install_igatedb_dir]] \ + $[if $[install_py],$[install_py_dir] $[install_py_package_dir]] \ ] // Similarly, we need to ensure that $[ODIR] exists. Trying to make @@ -260,7 +269,8 @@ $[TAB] rm -f $[igatemout] $[$[igatemout]_obj] $[INSTALL_HEADERS:%=$[install_headers_dir]/%] \ $[INSTALL_PARSER_INC:%=$[install_parser_inc_dir]/%] \ $[INSTALL_DATA:%=$[install_data_dir]/%] \ - $[INSTALL_CONFIG:%=$[install_config_dir]/%] + $[INSTALL_CONFIG:%=$[install_config_dir]/%] \ + $[if $[install_py],$[install_py:%=$[install_py_dir]/%] $[install_py_package_dir]/__init__.py] #define installed_igate_files \ $[get_igatedb(metalib_target lib_target ss_lib_target):$[ODIR]/%=$[install_igatedb_dir]/%] @@ -867,6 +877,18 @@ $[install_config_dir]/$[file] : $[file] $[TAB] cp -f $[local] $[dest] #end file +#foreach file $[install_py] +$[install_py_dir]/$[file] : $[file] +#define local $[file] +#define dest $[install_py_dir] +$[TAB] $[INSTALL] +#end file + +#if $[install_py] +$[install_py_package_dir]/__init__.py : +$[TAB] touch $[install_py_package_dir]/__init__.py +#endif + // Finally, all the special targets. These are commands that just need // to be invoked; we don't pretend to know what they are. #forscopes special_target