From c9114127b1a18744abb0fff19ec41f1675897dfb Mon Sep 17 00:00:00 2001 From: David Rose Date: Mon, 3 Jun 2002 21:55:13 +0000 Subject: [PATCH] fix bison rules --- dtool/pptempl/Depends.pp | 6 +++++- dtool/pptempl/Template.gmsvc.pp | 10 +++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/dtool/pptempl/Depends.pp b/dtool/pptempl/Depends.pp index 101c493815..2176afe3a4 100644 --- a/dtool/pptempl/Depends.pp +++ b/dtool/pptempl/Depends.pp @@ -86,7 +86,11 @@ // Add the bison- and flex-generated .cxx files to the compile // list, too. These never get added to composite files, though, // mainly because they tend to be very large files themselves. - #set cxx_sources $[cxx_sources] $[patsubst %.yxx,%.cxx,$[yxx_sources]] $[patsubst %.lxx,%.cxx,$[lxx_sources]] + #foreach source_file $[yxx_sources] $[lxx_sources] + #define generated_file $[patsubst %.yxx %.lxx,%.cxx,$[source_file]] + #define $[generated_file]_sources $[source_file] + #set cxx_sources $[cxx_sources] $[generated_file] + #end source_file #define compile_sources $[c_sources] $[cxx_sources] $[yxx_sources] $[lxx_sources] #end metalib_target lib_target noinst_lib_target static_lib_target ss_lib_target bin_target noinst_bin_target test_bin_target diff --git a/dtool/pptempl/Template.gmsvc.pp b/dtool/pptempl/Template.gmsvc.pp index 5cd9343853..907898657b 100644 --- a/dtool/pptempl/Template.gmsvc.pp +++ b/dtool/pptempl/Template.gmsvc.pp @@ -89,6 +89,8 @@ // static or dynamic targets, let's eliminate so_sources and just // use st_sources for simplicity. #define st_sources $[compile_sources(metalib_target lib_target noinst_lib_target static_lib_target ss_lib_target bin_target noinst_bin_target test_bin_target)] + #define yxx_st_sources $[yxx_sources(metalib_target lib_target noinst_lib_target static_lib_target ss_lib_target bin_target noinst_bin_target test_bin_target)] + #define lxx_st_sources $[lxx_sources(metalib_target lib_target noinst_lib_target static_lib_target ss_lib_target bin_target noinst_bin_target test_bin_target)] #define dep_sources_1 $[get_sources(metalib_target lib_target noinst_lib_target static_lib_target ss_lib_target bin_target noinst_bin_target test_bin_target)] // These are the source files that our dependency cache file will @@ -135,7 +137,7 @@ // This is the set of files we might copy into *.prebuilt, if we have // bison and flex (or copy from *.prebuilt if we don't have them). -#define bison_prebuilt $[patsubst %.yxx,%.h,$[yxx_sources]] $[patsubst %.yxx,%.cxx,$[yxx_sources]] $[patsubst %.lxx,%.cxx,$[lxx_sources]] +#define bison_prebuilt $[patsubst %.yxx,%.h,$[yxx_st_sources]] $[patsubst %.yxx,%.cxx,$[yxx_st_sources]] $[patsubst %.lxx,%.cxx,$[lxx_st_sources]] // Pre-compiled headers are one way to speed the compilation of many // C++ source files that include similar headers, but it turns out a @@ -198,8 +200,8 @@ $[TAB] rm -f *.pyc *.pyo // Also scrub out old generated Python code. // it also cleans up the bison and flex output, as well as the // dependency cache file. cleanall : clean -#if $[yxx_sources] $[lxx_sources] -$[TAB] rm -f $[patsubst %.yxx %.lxx,%.cxx,$[yxx_sources] $[lxx_sources]] +#if $[yxx_st_sources] $[lxx_st_sources] +$[TAB] rm -f $[patsubst %.yxx %.lxx,%.cxx,$[yxx_st_sources] $[lxx_st_sources]] #endif #if $[ne $[DEPENDENCY_CACHE_FILENAME],] $[TAB] rm -f $[DEPENDENCY_CACHE_FILENAME] @@ -269,8 +271,10 @@ $[TAB] rm -f $[sort $[installed_igate_files]] #if $[HAVE_BISON] prebuild-bison : $[patsubst %,%.prebuilt,$[bison_prebuilt]] clean-prebuild-bison : +#if $[bison_prebuilt] $[TAB] rm -f $[sort $[patsubst %,%.prebuilt,$[bison_prebuilt]]] #endif +#endif // We need a rule for each directory we might need to make. This // loops through the full set of directories and creates a rule to