Browse Source

Parise implements suggestion to make $[TARGET] prefix for .obj's switchable

Jon Parise 23 years ago
parent
commit
d32efcd8c0
2 changed files with 10 additions and 1 deletions
  1. 1 1
      dtool/pptempl/Depends.pp
  2. 9 0
      dtool/pptempl/Global.pp

+ 1 - 1
dtool/pptempl/Depends.pp

@@ -80,7 +80,7 @@
 
 
     // Define what the object files are.
     // Define what the object files are.
     #foreach file $[c_sources] $[cxx_sources] $[yxx_sources] $[lxx_sources]
     #foreach file $[c_sources] $[cxx_sources] $[yxx_sources] $[lxx_sources]
-      #define $[file]_obj $[patsubst %.c %.cxx %.cpp %.yxx %.lxx,$[ODIR]/$[TARGET]_%$[OBJ],$[notdir $[file]]]
+      #define $[file]_obj $[patsubst %.c %.cxx %.cpp %.yxx %.lxx,$[ODIR]/$[obj_prefix]%$[OBJ],$[notdir $[file]]]
       #push 1 $[file]_obj
       #push 1 $[file]_obj
     #end file
     #end file
 
 

+ 9 - 0
dtool/pptempl/Global.pp

@@ -527,6 +527,15 @@ Warning: Variable $[upcase $[tree]]_INSTALL is not set!
 // platforms will leave this empty.
 // platforms will leave this empty.
 #define dllext
 #define dllext
 
 
+// $[obj_prefix] defines the prefix that is prepended to the name of
+// the object files.  It can be used to avoid potential collisions
+// when a source file is used by multiple targets but with different
+// compile options for each.
+//
+// $[obj_prefix] may be redefined by one of the Global.platform.pp
+// files.
+#defer obj_prefix $[TARGET]_
+
 // Caution!  interrogate_ipath might be redefined in the
 // Caution!  interrogate_ipath might be redefined in the
 // Global.platform.pp file.
 // Global.platform.pp file.
 #defer interrogate_ipath $[target_ipath:%=-I%]
 #defer interrogate_ipath $[target_ipath:%=-I%]