From 8bcae783e8606f84558eee007f2443eb49aa4622 Mon Sep 17 00:00:00 2001 From: David Rose Date: Wed, 25 Oct 2000 02:05:49 +0000 Subject: [PATCH] *** empty log message *** --- dtool/Config.pp | 11 ++++++++--- dtool/pptempl/Global.msvc.pp | 4 ++++ dtool/pptempl/Template.msvc.pp | 10 ++++++---- dtool/pptempl/Template.unix.pp | 9 ++++++--- 4 files changed, 24 insertions(+), 10 deletions(-) diff --git a/dtool/Config.pp b/dtool/Config.pp index 64a420a8ef..8743433c3d 100644 --- a/dtool/Config.pp +++ b/dtool/Config.pp @@ -259,9 +259,14 @@ #defer BISON bison #defer FLEX flex -// How to invoke sed. Only a few make rules use this. You can -// probably do without it without too much trouble. -#defer SED sed +// How to invoke sed. A handful of make rules use this. Since some +// platforms (specifically, non-Unix platforms like Windows) don't +// have any kind of sed, ppremake performs some limited sed-like +// functions. The default is to use ppremake in this capacity. In +// this variable, $[source] is the name of the file to read, $[target] +// is the name of the file to generate, and $[script] is the one-line +// sed script to run. +#defer SED ppremake -s '$[script]' <$[source] >$[target] // What directory name (within each source directory) should the .o // (or .obj) files be written to, for both shared and static sources? diff --git a/dtool/pptempl/Global.msvc.pp b/dtool/pptempl/Global.msvc.pp index 1a96a2165f..c10dd71703 100644 --- a/dtool/pptempl/Global.msvc.pp +++ b/dtool/pptempl/Global.msvc.pp @@ -52,6 +52,10 @@ #define install_config_dir $[decygwin %,%,$[install_config_dir]] #define install_parser_inc_dir $[decygwin %,%,$[install_parser_inc_dir]] +// In the Windows command shell, we need to use double quotes instead +// of single quotes. +#defer SED ppremake -s "$[script]" <$[source] >$[target] + // Define this if we want to make .sbr files. #defer BROWSEINFO_FLAG /Fr"$[osfilename $[target:%.obj=%.sbr]]" #defer CFLAGS_SHARED diff --git a/dtool/pptempl/Template.msvc.pp b/dtool/pptempl/Template.msvc.pp index f47a788db5..357bf8f3f8 100644 --- a/dtool/pptempl/Template.msvc.pp +++ b/dtool/pptempl/Template.msvc.pp @@ -468,9 +468,9 @@ $[install_lib_dir]\lib$[TARGET]$[dllext].lib : $[st_dir]\lib$[TARGET]$[dllext].l #forscopes sed_bin_target #define target $[st_dir]\$[TARGET] #define source $[SOURCE] +#define script $[COMMAND] $[target] : $[source] - $[SED] $[COMMAND] $[source] >$[target] - chmod +x $[target] + $[SED] #define installed_files \ $[install_bin_dir]\$[TARGET] @@ -579,8 +579,10 @@ $[target] : $[source] #define source $[file] $[target] : $[source] $[FLEX] $[LFLAGS] $[if $[YACC_PREFIX],-P$[YACC_PREFIX]] -olex.yy.c $[source] - $[SED] '/#include /d' lex.yy.c > $[target] - del lex.yy.c +#define source lex.yy.c +#define script /#include /d + $[SED] + del $[source] #end file diff --git a/dtool/pptempl/Template.unix.pp b/dtool/pptempl/Template.unix.pp index 131f324cef..5096428154 100644 --- a/dtool/pptempl/Template.unix.pp +++ b/dtool/pptempl/Template.unix.pp @@ -429,8 +429,9 @@ $[install_lib_dir]/lib$[TARGET].a : $[st_dir]/lib$[TARGET].a #forscopes sed_bin_target #define target $[st_dir]/$[TARGET] #define source $[SOURCE] +#define script $[COMMAND] $[target] : $[source] - $[SED] $[COMMAND] $[source] >$[target] + $[SED] chmod +x $[target] #define installed_files \ @@ -540,8 +541,10 @@ $[target] : $[source] #define source $[file] $[target] : $[source] $[FLEX] $[LFLAGS] $[if $[YACC_PREFIX],-P$[YACC_PREFIX]] -olex.yy.c $[source] - $[SED] '/#include /d' lex.yy.c > $[target] - rm lex.yy.c +#define source lex.yy.c +#define script /#include /d + $[SED] + rm $[source] #end file