Преглед на файлове

*** empty log message ***

David Rose преди 25 години
родител
ревизия
8bcae783e8
променени са 4 файла, в които са добавени 24 реда и са изтрити 10 реда
  1. 8 3
      dtool/Config.pp
  2. 4 0
      dtool/pptempl/Global.msvc.pp
  3. 6 4
      dtool/pptempl/Template.msvc.pp
  4. 6 3
      dtool/pptempl/Template.unix.pp

+ 8 - 3
dtool/Config.pp

@@ -259,9 +259,14 @@
 #defer BISON bison
 #defer BISON bison
 #defer FLEX flex 
 #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
 // What directory name (within each source directory) should the .o
 // (or .obj) files be written to, for both shared and static sources?
 // (or .obj) files be written to, for both shared and static sources?

+ 4 - 0
dtool/pptempl/Global.msvc.pp

@@ -52,6 +52,10 @@
 #define install_config_dir $[decygwin %,%,$[install_config_dir]]
 #define install_config_dir $[decygwin %,%,$[install_config_dir]]
 #define install_parser_inc_dir $[decygwin %,%,$[install_parser_inc_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.
 // Define this if we want to make .sbr files.
 #defer BROWSEINFO_FLAG /Fr"$[osfilename $[target:%.obj=%.sbr]]"
 #defer BROWSEINFO_FLAG /Fr"$[osfilename $[target:%.obj=%.sbr]]"
 #defer CFLAGS_SHARED
 #defer CFLAGS_SHARED

+ 6 - 4
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
 #forscopes sed_bin_target
 #define target $[st_dir]\$[TARGET]
 #define target $[st_dir]\$[TARGET]
 #define source $[SOURCE]
 #define source $[SOURCE]
+#define script $[COMMAND]
 $[target] : $[source]
 $[target] : $[source]
-	$[SED] $[COMMAND] $[source] >$[target]
-	chmod +x $[target]
+	$[SED]
 
 
 #define installed_files \
 #define installed_files \
     $[install_bin_dir]\$[TARGET]
     $[install_bin_dir]\$[TARGET]
@@ -579,8 +579,10 @@ $[target] : $[source]
 #define source $[file]
 #define source $[file]
 $[target] : $[source]
 $[target] : $[source]
 	$[FLEX] $[LFLAGS] $[if $[YACC_PREFIX],-P$[YACC_PREFIX]] -olex.yy.c $[source]
 	$[FLEX] $[LFLAGS] $[if $[YACC_PREFIX],-P$[YACC_PREFIX]] -olex.yy.c $[source]
-	$[SED] '/#include <unistd.h>/d' lex.yy.c > $[target]
-	del lex.yy.c
+#define source lex.yy.c
+#define script /#include <unistd.h>/d
+	$[SED]
+	del $[source]
 
 
 #end file
 #end file
 
 

+ 6 - 3
dtool/pptempl/Template.unix.pp

@@ -429,8 +429,9 @@ $[install_lib_dir]/lib$[TARGET].a : $[st_dir]/lib$[TARGET].a
 #forscopes sed_bin_target
 #forscopes sed_bin_target
 #define target $[st_dir]/$[TARGET]
 #define target $[st_dir]/$[TARGET]
 #define source $[SOURCE]
 #define source $[SOURCE]
+#define script $[COMMAND]
 $[target] : $[source]
 $[target] : $[source]
-	$[SED] $[COMMAND] $[source] >$[target]
+	$[SED]
 	chmod +x $[target]
 	chmod +x $[target]
 
 
 #define installed_files \
 #define installed_files \
@@ -540,8 +541,10 @@ $[target] : $[source]
 #define source $[file]
 #define source $[file]
 $[target] : $[source]
 $[target] : $[source]
 	$[FLEX] $[LFLAGS] $[if $[YACC_PREFIX],-P$[YACC_PREFIX]] -olex.yy.c $[source]
 	$[FLEX] $[LFLAGS] $[if $[YACC_PREFIX],-P$[YACC_PREFIX]] -olex.yy.c $[source]
-	$[SED] '/#include <unistd.h>/d' lex.yy.c > $[target]
-	rm lex.yy.c
+#define source lex.yy.c
+#define script /#include <unistd.h>/d
+	$[SED]
+	rm $[source]
 
 
 #end file
 #end file