Forráskód Böngészése

explicitly name each .obj file to prevent conflicts when one file appears on multiple targets

David Rose 23 éve
szülő
commit
9ac6270216

+ 2 - 2
dtool/Package.pp

@@ -13,8 +13,8 @@
 // files.
 
 // Check the version of ppremake in use.
-#if $[< $[PPREMAKE_VERSION],1.1]
-  #error You need at least ppremake version 1.1 to process this tree.
+#if $[< $[PPREMAKE_VERSION],1.11]
+  #error You need at least ppremake version 1.11 to process this tree.
 #endif
 
 // What is the name and version of this source tree?

+ 33 - 4
dtool/pptempl/Depends.pp

@@ -48,6 +48,11 @@
     #define active_component_libs $[active_component_libs]
     #define active_libs $[active_libs]
     #define get_sources $[get_sources]
+    #define get_igatescan $[get_igatescan]
+    #define get_igateoutput $[get_igateoutput]
+    #define get_igatedb $[get_igatedb]
+    #define get_igatemscan $[get_igatemscan]
+    #define get_igatemout $[get_igatemout]
 
     // Report a warning for nonexisting dependencies.
     #define nonexisting $[unmapped all_libs,$[LOCAL_LIBS]]
@@ -62,6 +67,12 @@
     #define cxx_sources $[filter-out %_src.cxx,$[filter %.cxx,$[get_sources]]]
     #define yxx_sources $[filter %.yxx,$[get_sources]]
     #define lxx_sources $[filter %.lxx,$[get_sources]]
+
+    // Define what the object files are.
+    #foreach file $[c_sources] $[cxx_sources] $[yxx_sources] $[lxx_sources]
+      #define $[file]_obj $[patsubst %.c %.cxx %.yxx %.lxx,$[st_dir]/$[TARGET]_%.obj,$[file]]
+    #end file
+
     #if $[USE_SINGLE_COMPOSITE_SOURCEFILE]
       #if $[> $[words $[cxx_sources]], 1]
         // If we have multiple C++ files, put them together into one
@@ -70,6 +81,7 @@
         #set composite_list $[composite_list] $[composite_file]
         #define $[composite_file]_sources $[cxx_sources]
         #push 1 $[composite_file]_sources
+        #define $[composite_file]_obj $[st_dir]/$[TARGET]_composite.obj
         #set cxx_sources $[composite_file]
       #endif
       #if $[> $[words $[c_sources]], 1]
@@ -79,19 +91,36 @@
         #set composite_list $[composite_list] $[composite_file]
         #define $[composite_file]_sources $[c_sources]
         #push 1 $[composite_file]_sources
+        #define $[composite_file]_obj $[st_dir]/$[TARGET]_composite_c.obj
         #set c_sources $[composite_file]
       #endif
     #endif
 
-    // 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.
+    // Add the bison- and flex-generated .cxx files, as well as the
+    // interrogate-generated files, to the compile list, too.  These
+    // never get added to composite files, though, mainly because they
+    // tend to be very large files themselves.
     #foreach source_file $[yxx_sources] $[lxx_sources]
       #define generated_file $[patsubst %.yxx %.lxx,%.cxx,$[source_file]]
+      #define $[generated_file]_obj $[patsubst %.yxx %.lxx,$[st_dir]/$[TARGET]_%.obj,$[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]
+    #if $[get_igateoutput]
+      #define generated_file $[get_igateoutput]
+      #define $[generated_file]_obj $[get_igateoutput:%.cxx=%.obj]
+      #define $[generated_file]_sources $[get_igatescan]
+      #set cxx_sources $[cxx_sources] $[generated_file]
+    #endif
+    #if $[get_igatemout]
+      #define generated_file $[get_igatemout]
+      #define $[generated_file]_obj $[get_igatemout:%.cxx=%.obj]
+      #define $[generated_file]_sources none
+      #set cxx_sources $[cxx_sources] $[generated_file]
+    #endif
+
+    #define compile_sources $[c_sources] $[cxx_sources]
+
   #end metalib_target lib_target noinst_lib_target static_lib_target ss_lib_target bin_target noinst_bin_target test_bin_target
 
   // Allow the user to define additional EXTRA_DEPENDS targets in each

+ 2 - 13
dtool/pptempl/Global.gmsvc.pp

@@ -38,11 +38,7 @@
 
 #defun decygwin frompat,topat,path
   #foreach file $[path]
-    #if $[isfullpath $[file]]
-      $[patsubstw $[frompat],$[topat],$[cygpath_w $[file]]]
-    #else
-      $[patsubstw $[frompat],$[topat],$[osfilename $[file]]]
-    #endif
+    $[patsubstw $[frompat],$[topat],$[osfilename $[file]]]
   #end file
 #end decygwin
 
@@ -157,18 +153,11 @@
 #defer extra_cflags /EHsc /Zm250 /DWIN32_VC /DWIN32 $[WARNING_LEVEL_FLAG] $[END_CFLAGS]
 
 #defer DECYGWINED_INC_PATHLIST_ARGS $[decygwin %,/I"%",$[EXTRA_INCPATH] $[ipath] $[WIN32_PLATFORMSDK_INCPATH]]
-#defer MAIN_C_COMPILE_ARGS /nologo /c $[DECYGWINED_INC_PATHLIST_ARGS] $[flags] $[extra_cflags] $[source]
+#defer MAIN_C_COMPILE_ARGS /nologo /c $[DECYGWINED_INC_PATHLIST_ARGS] $[flags] $[extra_cflags] "$[osfilename $[source]]"
 
 #defer COMPILE_C $[COMPILER] /Fo"$[osfilename $[target]]" $[MAIN_C_COMPILE_ARGS]
 #defer COMPILE_C++ $[COMPILE_C]
 
-#if $[DO_PCH]
-#defer MAIN_C_COMPILE_ARGS_PCH /Fp"$[osfilename $[target_pch]]" $[MAIN_C_COMPILE_ARGS]
-#defer COMPILE_C_WITH_PCH $[COMPILER] /Yu /Fo"$[osfilename $[target]]" $[MAIN_C_COMPILE_ARGS_PCH]
-#defer COMPILE_CSTYLE_PCH $[COMPILER] /TC /Yc /Fo"$[osfilename $[target_obj]]" $[MAIN_C_COMPILE_ARGS_PCH]
-#defer COMPILE_CXXSTYLE_PCH $[COMPILER] /TP /Yc /Fo"$[osfilename $[target_obj]]" $[MAIN_C_COMPILE_ARGS_PCH]
-#endif
-
 #defer STATIC_LIB_C $[LIBBER] /nologo $[sources] /OUT:"$[osfilename $[target]]" 
 #defer STATIC_LIB_C++ $[STATIC_LIB_C]
 

+ 20 - 7
dtool/pptempl/Global.pp

@@ -313,14 +313,14 @@
 // the target is not to be interrogated.
 #defer get_igateoutput \
   $[if $[and $[run_interrogate],$[IGATESCAN]], \
-    lib$[TARGET]_igate.cxx]
+    $[st_dir]/lib$[TARGET]_igate.cxx]
 
-// This variable returns the name of the interrogate module, if the
-// current metalib target should include one, or empty string if it
-// should not.
-#defer get_igatemscan \
-  $[if $[and $[run_interrogate],$[components $[IGATESCAN],$[active_component_libs]]], \
-    $[TARGET]]
+// This variable is the set of .in files generated by all of our
+// component libraries.  If it is nonempty, then we do need to
+// generate a module, and $[get_igatemout] is the name of the .cxx file
+// that interrogate will produce to make this module.
+#defer get_igatemscan $[components $[get_igatedb:%=$[RELDIR]/%],$[active_component_libs]]
+#defer get_igatemout $[if $[get_igatemscan],$[st_dir]/lib$[TARGET]_module.cxx]
 
 // This variable returns the set of external packages used by this
 // target, and by all the components shared by this target.
@@ -397,6 +397,19 @@
   #endif
 #end get_ld
 
+// This function determines the set of files a given source file
+// depends on.  It is based on the setting of the $[filename]_sources
+// variable to indicate the sources for composite files, etc.
+#defun get_depends source
+  #if $[$[source]_sources]
+    #if $[ne $[$[source]_sources],none]
+      $[dependencies $[$[source]_sources]]
+    #endif
+  #else
+    $[dependencies $[source]]
+  #endif
+#end get_depends
+  
 
 // This function determines the set of libraries our various targets
 // depend on.  This is a complicated definition.  It is the union of

+ 107 - 135
dtool/pptempl/Template.gmsvc.pp

@@ -23,19 +23,9 @@
 // $DTOOL/pptempl/Depends.pp, once for each Sources.pp file
 // Template.gmsvc.pp (this file), once for each Sources.pp file
 
-#defun decygwin frompat,topat,path
-  #foreach file $[path]
-    #if $[isfullpath $[file]]
-      $[patsubstw $[frompat],$[topat],$[cygpath_w $[file]]]
-    #else
-      $[patsubstw $[frompat],$[topat],$[osfilename $[file]]]
-    #endif
-  #end file
-#end decygwin
-
 #if $[ne $[DTOOL],]
 #define dtool_ver_dir_cyg $[DTOOL]/src/dtoolbase
-#define dtool_ver_dir $[decygwin %,%,$[dtool_ver_dir_cyg]]
+#define dtool_ver_dir $[osfilename $[dtool_ver_dir_cyg]]
 #endif
 
 //////////////////////////////////////////////////////////////////////
@@ -57,7 +47,7 @@
       // This library is on a metalib, so we can't build it, but we
       // should build all the obj's that go into it.
       #set deferred_objs $[deferred_objs] \
-        $[patsubst %.c %.cxx,$[so_dir]/%.obj,%,,$[c_sources] $[cxx_sources] $[get_igateoutput]]
+        $[patsubst %,$[%_obj],$[compile_sources]]
     #endif
   #end lib_target
   
@@ -67,7 +57,7 @@
   // $[bin_targets] the list of binaries.  $[test_bin_targets] is the
   // list of binaries that are to be built only when specifically asked
   // for.
-  #define lib_targets $[patsubst %,$[so_dir]/lib%$[dllext].$[dlllib],$[active_target(metalib_target noinst_lib_target)] $[real_lib_targets]]
+  #define lib_targets $[patsubst %,$[st_dir]/lib%$[dllext].$[dlllib],$[active_target(metalib_target noinst_lib_target)] $[real_lib_targets]]
   #define static_lib_targets $[active_target(static_lib_target ss_lib_target):%=$[st_dir]/lib%$[dllext].lib]
   #define bin_targets \
       $[active_target(bin_target noinst_bin_target):%=$[st_dir]/%.exe] \
@@ -126,7 +116,7 @@
 
 // $[complete_lpath] is rather like $[complete_ipath]: the list of
 // directories (from within this tree) we should add to our -L list.
-#defer complete_lpath $[static_libs $[RELDIR:%=%/$[st_dir]],$[actual_local_libs]] $[dynamic_libs $[RELDIR:%=%/$[so_dir]],$[actual_local_libs]]
+#defer complete_lpath $[static_libs $[RELDIR:%=%/$[st_dir]],$[actual_local_libs]] $[dynamic_libs $[RELDIR:%=%/$[st_dir]],$[actual_local_libs]]
 
 // $[lpath] is like $[target_ipath]: it's the list of directories we
 // should add to our -L list, from the context of a particular target.
@@ -137,7 +127,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_st_sources]] $[patsubst %.yxx,%.cxx,$[yxx_st_sources]] $[patsubst %.lxx,%.cxx,$[lxx_st_sources]]
+#define bison_prebuilt $[patsubst %.yxx,%.cxx %.h,$[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
@@ -187,21 +177,20 @@ all : $[all_targets]
 // The 'test' rule makes all the test_bin_targets.
 test : $[test_bin_targets]
 
-// We implement 'clean' simply by removing the odirs, since all of our
-// generated output ends up in one or the other of these.  Effective.
-// It does assume that the odirs are not '.', however.
 clean :
 #if $[st_sources]
-$[TAB] rm -rf $[st_dir]
+$[TAB] rm -f $[st_dir]/*
 #endif
 $[TAB] rm -f *.pyc *.pyo // Also scrub out old generated Python code.
                          
-// 'cleanall' is not much more thorough than 'clean': At the moment,
-// it also cleans up the bison and flex output, as well as the
-// dependency cache file.
+// 'cleanall' is intended to undo all the effects of running ppremake
+// and building.  It removes everything except the Makefile.
 cleanall : clean
+#if $[st_sources]
+$[TAB] rm -rf $[st_dir]
+#endif
 #if $[yxx_st_sources] $[lxx_st_sources]
-$[TAB] rm -f $[patsubst %.yxx %.lxx,%.cxx,$[yxx_st_sources] $[lxx_st_sources]]
+$[TAB] rm -f $[patsubst %.yxx,%.cxx %.h,$[yxx_st_sources]] $[patsubst %.lxx,%.cxx,$[lxx_st_sources]]
 #endif
 #if $[ne $[DEPENDENCY_CACHE_FILENAME],]
 $[TAB] rm -f $[DEPENDENCY_CACHE_FILENAME]
@@ -214,16 +203,16 @@ clean-igate :
 #forscopes metalib_target lib_target ss_lib_target
   #define igatedb $[get_igatedb]
   #define igateoutput $[get_igateoutput]
-  #define igatemscan $[components $[get_igatedb:%=$[RELDIR]/$[so_dir]/%],$[active_component_libs]]
-  #define igatemout $[if $[igatemscan],lib$[TARGET]_module.cxx]
+  #define igatemscan $[get_igatemscan]
+  #define igatemout $[get_igatemout]
   #if $[igatedb]
-$[TAB] rm -f $[so_dir]/$[igatedb]
+$[TAB] rm -f $[igatedb]
   #endif
   #if $[igateoutput]
-$[TAB] rm -f $[so_dir]/$[igateoutput] $[igateoutput:%.cxx=$[so_dir]/%.obj]
+$[TAB] rm -f $[igateoutput] $[$[igateoutput]_obj]
   #endif
   #if $[igatemout]
-$[TAB] rm -f $[so_dir]/$[igatemout] $[igatemout:%.cxx=$[so_dir]/%.obj]
+$[TAB] rm -f $[igatemout] $[$[igatemout]_obj]
   #endif
 #end metalib_target lib_target ss_lib_target
 
@@ -293,25 +282,15 @@ $[TAB] @test -d $[directory] || echo mkdir -p $[directory]
 $[TAB] @test -d $[directory] || mkdir -p $[directory]
 #end directory
 
-// We need to make the .obj files depend on the $[so_dir] and
-// $[st_dir] directories, to guarantee that the directories are built
-// before the .obj files are generated, but we cannot depend on the
-// directories directly or we get screwed up by the modification
-// times.  So we put this phony timestamp file in each directory.
-#foreach directory $[sort \
-    $[if $[st_sources],$[st_dir]] \
-    ]
-$[directory]/stamp :
-$[TAB] @test -d $[directory] || echo mkdir -p $[directory]
-$[TAB] @test -d $[directory] || mkdir -p $[directory]
-$[TAB] @touch $[directory]/stamp
-#end directory
-
+// We need to ensure that $[st_dir] exists.  Trying to make the
+// makefiles do this automatically just causes problems with
+// multiprocess builds.
+#mkdir $[st_dir]
 
 // Now it's time to start generating the rules to make our actual
 // targets.
 
-igate : $[get_igatedb(metalib_target lib_target ss_lib_target):%=$[so_dir]/%]
+igate : $[get_igatedb(metalib_target lib_target ss_lib_target):%=$[st_dir]/%]
 
 
 /////////////////////////////////////////////////////////////////////
@@ -353,29 +332,29 @@ igate : $[get_igatedb(metalib_target lib_target ss_lib_target):%=$[so_dir]/%]
 // component libraries.  If it is nonempty, then we do need to
 // generate a module, and $[igatemout] is the name of the .cxx file
 // that interrogate will produce to make this module.
-#define igatemscan $[components $[get_igatedb:%=$[RELDIR]/$[so_dir]/%],$[active_component_libs]]
-#define igatemout $[if $[igatemscan],lib$[TARGET]_module.cxx]
+#define igatemscan $[get_igatemscan]
+#define igatemout $[get_igatemout]
 
 #if $[build_it]
   // Now output the rule to actually link the library from all of its
   // various .obj files.
 
   #define sources \
-   $[unique $[patsubst %_src.cxx,,%.cxx %.c %.yxx %.lxx,$[so_dir]/%.obj,%,,$[compile_sources] $[igateoutput] $[igatemout]]] \
-   $[components $[unique $[patsubst %_src.cxx,,%.cxx %.c %.yxx %.lxx,$[RELDIR]/$[so_dir]/%.obj,%,,$[compile_sources] $[get_igateoutput]]],$[active_component_libs]]
-   
+   $[patsubst %,$[%_obj],$[compile_sources]] \
+   $[components $[patsubst %,$[RELDIR]/$[%_obj],$[compile_sources]],$[active_component_libs]]
+
   #define varname $[subst -,_,lib$[TARGET]_so]
 $[varname] = $[sources]
-  #define target $[so_dir]/lib$[TARGET]$[dllext].$[dlllib]
+  #define target $[st_dir]/lib$[TARGET]$[dllext].$[dlllib]
   #define sources $($[varname])
   #define flags   $[get_cflags] $[C++FLAGS] $[CFLAGS_OPT$[OPTIMIZE]] $[CFLAGS_SHARED] $[building_var:%=/D%]
   #define mybasename $[basename $[notdir $[target]]]  
-  #define tmpdirname_cyg $[directory]/$[mybasename]
-  #define tmpdirname_win $[directory]\$[mybasename]
+  #define tmpdirname_cyg $[install_lib_dir]/$[mybasename]
+  #define tmpdirname_win $[osfilename $[directory]]
   
 // not parallel (requires gmake 3.79) because of link.exe conflicts in TMP dir (see audiotraits dir)
 #if $[GENERATE_BUILDDATE]
-.NOTPARALLEL $[target] : $[sources] $[so_dir]/stamp $[dtool_ver_dir_cyg]/version.rc $[dtool_ver_dir_cyg]/$[DLLBASEADDRFILENAME]
+.NOTPARALLEL $[target] : $[sources] $[dtool_ver_dir_cyg]/version.rc $[dtool_ver_dir_cyg]/$[DLLBASEADDRFILENAME]
 // first generate builddate for rc compiler using compiler preprocessor
 $[TAB]  mkdir -p $[tmpdirname_cyg]  // this dir-creation-stuff is leftover from trying to resolve parallel link difficulties
  #define VER_RESOURCE "$[tmpdirname_win]\$[mybasename].res"
@@ -387,7 +366,7 @@ $[TAB] $[SHARED_LIB_C++] $[VER_RESOURCE]
 $[TAB] $[SHARED_LIB_C] $[VER_RESOURCE]
   #endif
 #else
-.NOTPARALLEL $[target] : $[sources] $[so_dir]/stamp $[dtool_ver_dir_cyg]/$[DLLBASEADDRFILENAME]
+.NOTPARALLEL $[target] : $[sources] $[dtool_ver_dir_cyg]/$[DLLBASEADDRFILENAME]
   #if $[filter %.cxx %.yxx %.lxx,$[get_sources]]
 $[TAB] $[SHARED_LIB_C++]
   #else  
@@ -396,10 +375,10 @@ $[TAB] $[SHARED_LIB_C]
 #endif
 
 #if $[build_dlls]
-$[so_dir]/lib$[TARGET]$[dllext].lib : $[so_dir]/lib$[TARGET]$[dllext].dll
+$[st_dir]/lib$[TARGET]$[dllext].lib : $[st_dir]/lib$[TARGET]$[dllext].dll
 #endif
 #if $[build_pdbs]
-$[so_dir]/lib$[TARGET]$[dllext].pdb : $[so_dir]/lib$[TARGET]$[dllext].dll
+$[st_dir]/lib$[TARGET]$[dllext].pdb : $[st_dir]/lib$[TARGET]$[dllext].dll
 #endif
 
 #endif
@@ -426,22 +405,22 @@ $[TAB] rm -f $[sort $[installed_files]]
 #endif
 
 #if $[build_dlls]
-$[install_lib_dir]/lib$[TARGET]$[dllext].dll : $[so_dir]/lib$[TARGET]$[dllext].dll $[so_dir]/stamp
+$[install_lib_dir]/lib$[TARGET]$[dllext].dll : $[st_dir]/lib$[TARGET]$[dllext].dll
 #define local lib$[TARGET]$[dllext].dll
 #define dest $[install_lib_dir]
-$[TAB] cp -f $[so_dir]/$[local] $[dest]
+$[TAB] cp -f $[st_dir]/$[local] $[dest]
 #endif
 
-$[install_lib_dir]/lib$[TARGET]$[dllext].lib : $[so_dir]/lib$[TARGET]$[dllext].lib $[so_dir]/stamp
+$[install_lib_dir]/lib$[TARGET]$[dllext].lib : $[st_dir]/lib$[TARGET]$[dllext].lib
 #define local lib$[TARGET]$[dllext].lib
 #define dest $[install_lib_dir]
-$[TAB] cp -f $[so_dir]/$[local] $[dest]
+$[TAB] cp -f $[st_dir]/$[local] $[dest]
 
 #if $[and $[build_dlls],$[build_pdbs]]
-$[install_lib_dir]/lib$[TARGET]$[dllext].pdb : $[so_dir]/lib$[TARGET]$[dllext].pdb $[so_dir]/stamp
+$[install_lib_dir]/lib$[TARGET]$[dllext].pdb : $[st_dir]/lib$[TARGET]$[dllext].pdb
 #define local lib$[TARGET]$[dllext].pdb
 #define dest $[install_lib_dir]
-$[TAB] cp -f $[so_dir]/$[local] $[dest]
+$[TAB] cp -f $[st_dir]/$[local] $[dest]
 #endif
 
 #if $[igatescan]
@@ -457,26 +436,21 @@ $[TAB] cp -f $[so_dir]/$[local] $[dest]
   #define igatemod $[TARGET]
 #endif
 
-$[install_igatedb_dir]/$[igatedb] : $[so_dir]/$[igatedb] $[so_dir]/stamp
+$[install_igatedb_dir]/$[igatedb] : $[st_dir]/$[igatedb]
 #define local $[igatedb]
 #define dest $[install_igatedb_dir]
-$[TAB] cp -f $[so_dir]/$[local] $[dest]
+$[TAB] cp -f $[st_dir]/$[local] $[dest]
 
 // We have to split this out as a separate rule to properly support
 // parallel make.
-$[so_dir]/$[igatedb] : $[so_dir]/$[igateoutput]
+$[igatedb] : $[igateoutput]
 
 lib$[TARGET]_igatescan = $[igatescan]
-$[so_dir]/$[igateoutput] : $[sort $[patsubst %.h,%.h,%.I,%.I,%.T,%.T,%,,$[dependencies $[igatescan]] $[igatescan:%=./%]]] $[so_dir]/stamp
-$[TAB] $[INTERROGATE] -od $[so_dir]/$[igatedb] -oc $[so_dir]/$[igateoutput] $[interrogate_options] -module "$[igatemod]" -library "$[igatelib]" $(lib$[TARGET]_igatescan)
-
-#define target $[igateoutput:%.cxx=$[so_dir]/%.obj]
-#define source $[so_dir]/$[igateoutput]
-#define ipath . $[target_ipath]
-#define flags $[get_cflags] $[C++FLAGS] $[CFLAGS_OPT$[OPTIMIZE]] $[CFLAGS_SHARED] $[building_var:%=/D%]
-$[target] : $[source] $[so_dir]/stamp
-$[TAB] $[COMPILE_C++]
-#endif  // $[igatescan]
+$[igateoutput] : $[sort $[patsubst %.h,%.h,%.I,%.I,%.T,%.T,%,,$[dependencies $[igatescan]] $[igatescan:%=./%]]]
+$[TAB] $[INTERROGATE] -od $[igatedb] -oc $[igateoutput] $[interrogate_options] -module "$[igatemod]" -library "$[igatelib]" $(lib$[TARGET]_igatescan)
+
+#endif  // igatescan
+
 
 #if $[igatemout]
 // And finally, some additional rules to build the interrogate module
@@ -487,19 +461,13 @@ $[TAB] $[COMPILE_C++]
 #define igatemod $[TARGET]
 
 lib$[TARGET]_igatemscan = $[igatemscan]
-#define target $[so_dir]/$[igatemout]
+#define target $[igatemout]
 #define sources $(lib$[TARGET]_igatemscan)
 
-$[target] : $[sources] $[so_dir]/stamp
+$[target] : $[sources]
 $[TAB] $[INTERROGATE_MODULE] -oc $[target] -module "$[igatemod]" -library "$[igatelib]" $[interrogate_module_options] $[sources]
 
-#define target $[igatemout:%.cxx=$[so_dir]/%.obj]
-#define source $[so_dir]/$[igatemout]
-#define ipath . $[target_ipath]
-#define flags $[get_cflags] $[C++FLAGS] $[CFLAGS_OPT$[OPTIMIZE]] $[CFLAGS_SHARED] $[building_var:%=/D%]
-$[target] : $[source] $[so_dir]/stamp
-$[TAB] $[COMPILE_C++]
-#endif  // $[igatescan]
+#endif  // igatemout
 
 #end metalib_target lib_target
 
@@ -516,10 +484,10 @@ $[TAB] $[COMPILE_C++]
 
 #forscopes noinst_lib_target
 #define varname $[subst -,_,lib$[TARGET]_so]
-$[varname] = $[unique $[patsubst %_src.cxx,,%.cxx %.c %.yxx %.lxx,$[so_dir]/%.obj,%,,$[compile_sources]]]
-#define target $[so_dir]/lib$[TARGET]$[dllext].$[dlllib]
+$[varname] = $[patsubst %,$[%_obj],$[compile_sources]]
+#define target $[st_dir]/lib$[TARGET]$[dllext].$[dlllib]
 #define sources $($[varname])
-$[target] : $[sources] $[so_dir]/stamp
+$[target] : $[sources]
 #if $[filter %.cxx %.yxx %.lxx,$[get_sources]]
 $[TAB] $[SHARED_LIB_C++]
 #else
@@ -527,10 +495,10 @@ $[TAB] $[SHARED_LIB_C]
 #endif
 
 #if $[build_dlls]
-$[so_dir]/lib$[TARGET]$[dllext].lib : $[so_dir]/lib$[TARGET]$[dllext].dll
+$[st_dir]/lib$[TARGET]$[dllext].lib : $[st_dir]/lib$[TARGET]$[dllext].dll
 #endif
 #if $[build_pdbs]
-$[so_dir]/lib$[TARGET]$[dllext].pdb : $[so_dir]/lib$[TARGET]$[dllext].dll
+$[st_dir]/lib$[TARGET]$[dllext].pdb : $[st_dir]/lib$[TARGET]$[dllext].dll
 #endif
 
 #end noinst_lib_target
@@ -545,10 +513,10 @@ $[so_dir]/lib$[TARGET]$[dllext].pdb : $[so_dir]/lib$[TARGET]$[dllext].dll
 
 #forscopes static_lib_target ss_lib_target
 #define varname $[subst -,_,lib$[TARGET]_a]
-$[varname] = $[unique $[patsubst %_src.cxx,,%.cxx %.c %.yxx %.lxx,$[st_dir]/%.obj,%,,$[compile_sources]]]
+$[varname] = $[patsubst %,$[%_obj],$[compile_sources]]
 #define target $[st_dir]/lib$[TARGET]$[dllext].lib
 #define sources $($[varname])
-$[target] : $[sources] $[st_dir]/stamp
+$[target] : $[sources]
 #if $[filter %.cxx %.yxx %.lxx,$[get_sources]]
 $[TAB] $[STATIC_LIB_C++]
 #else
@@ -569,7 +537,7 @@ uninstall-lib$[TARGET] :
 $[TAB] rm -f $[sort $[installed_files]]
 #endif
 
-$[install_lib_dir]/lib$[TARGET]$[dllext].lib : $[st_dir]/lib$[TARGET]$[dllext].lib $[st_dir]/stamp
+$[install_lib_dir]/lib$[TARGET]$[dllext].lib : $[st_dir]/lib$[TARGET]$[dllext].lib
 #define local lib$[TARGET]$[dllext].lib
 #define dest $[install_lib_dir]
 $[TAB] cp -f $[st_dir]/$[local] $[dest]
@@ -585,12 +553,12 @@ $[TAB] cp -f $[st_dir]/$[local] $[dest]
 /////////////////////////////////////////////////////////////////////
 
 #forscopes sed_bin_target
-$[TARGET] : $[st_dir]/$[TARGET] $[st_dir]/stamp
+$[TARGET] : $[st_dir]/$[TARGET]
 
 #define target $[st_dir]/$[TARGET]
 #define source $[SOURCE]
 #define script $[COMMAND]
-$[target] : $[source] $[st_dir]/stamp
+$[target] : $[source]
 $[TAB] $[SED]
 $[TAB] chmod +x $[target]
 
@@ -606,7 +574,7 @@ $[TAB] rm -f $[sort $[installed_files]]
 
 #define local $[TARGET]
 #define dest $[install_bin_dir]
-$[install_bin_dir]/$[TARGET] : $[st_dir]/$[TARGET] $[st_dir]/stamp
+$[install_bin_dir]/$[TARGET] : $[st_dir]/$[TARGET]
 $[TAB] cp -f $[st_dir]/$[local] $[dest]
 
 #end sed_bin_target
@@ -618,14 +586,14 @@ $[TAB] cp -f $[st_dir]/$[local] $[dest]
 /////////////////////////////////////////////////////////////////////
 
 #forscopes bin_target
-$[TARGET] : $[st_dir]/$[TARGET].exe $[st_dir]/stamp
+$[TARGET] : $[st_dir]/$[TARGET].exe
 
 #define varname $[subst -,_,bin_$[TARGET]]
-$[varname] = $[unique $[patsubst %_src.cxx,,%.cxx %.c %.yxx %.lxx,$[st_dir]/%.obj,%,,$[compile_sources]]]
+$[varname] = $[patsubst %,$[%_obj],$[compile_sources]]
 #define target $[st_dir]/$[TARGET].exe
 #define sources $($[varname])
 #define ld $[get_ld]
-$[target] : $[sources] $[st_dir]/stamp
+$[target] : $[sources]
 #if $[ld]
   // If there's a custom linker defined for the target, we have to use it.
 $[TAB] $[ld] -o $[target] $[sources] $[lpath:%=-L%] $[libs:%=-l%]
@@ -639,7 +607,7 @@ $[TAB] $[LINK_BIN_C]
 #endif
 
 #if $[build_pdbs]
-$[st_dir]/$[TARGET].pdb : $[st_dir]/$[TARGET].exe $[st_dir]/stamp
+$[st_dir]/$[TARGET].pdb : $[st_dir]/$[TARGET].exe
 #endif
 
 #define installed_files \
@@ -657,13 +625,13 @@ uninstall-$[TARGET] :
 $[TAB] rm -f $[sort $[installed_files]]
 #endif
 
-$[install_bin_dir]/$[TARGET].exe : $[st_dir]/$[TARGET].exe $[st_dir]/stamp
+$[install_bin_dir]/$[TARGET].exe : $[st_dir]/$[TARGET].exe
 #define local $[TARGET].exe
 #define dest $[install_bin_dir]
 $[TAB] cp -f $[st_dir]/$[local] $[dest]
 
 #if $[build_pdbs]
-$[install_bin_dir]/$[TARGET].pdb : $[st_dir]/$[TARGET].pdb $[st_dir]/stamp
+$[install_bin_dir]/$[TARGET].pdb : $[st_dir]/$[TARGET].pdb
 #define local $[TARGET].pdb
 #define dest $[install_bin_dir]
 $[TAB] cp -f $[st_dir]/$[local] $[dest]
@@ -679,13 +647,13 @@ $[TAB] cp -f $[st_dir]/$[local] $[dest]
 /////////////////////////////////////////////////////////////////////
 
 #forscopes noinst_bin_target test_bin_target
-$[TARGET] : $[st_dir]/$[TARGET].exe $[st_dir]/stamp
+$[TARGET] : $[st_dir]/$[TARGET].exe
 
 #define varname $[subst -,_,bin_$[TARGET]]
-$[varname] = $[unique $[patsubst %_src.cxx,,%.cxx %.c %.yxx %.lxx,$[st_dir]/%.obj,%,,$[compile_sources]]]
+$[varname] = $[patsubst %,$[%_obj],$[compile_sources]]
 #define target $[st_dir]/$[TARGET].exe
 #define sources $($[varname])
-$[target] : $[sources] $[st_dir]/stamp
+$[target] : $[sources]
 #if $[filter %.cxx %.yxx %.lxx,$[get_sources]]
 $[TAB] $[LINK_BIN_C++]
 #else
@@ -704,24 +672,23 @@ $[TAB] $[LINK_BIN_C]
 #foreach file $[sort $[yxx_st_sources]]
 #define target $[patsubst %.yxx,%.cxx,$[file]]
 #define target_header $[patsubst %.yxx,%.h,$[file]]
+#define target_prebuilt $[target].prebuilt
+#define target_header_prebuilt $[target_header].prebuilt
 #if $[HAVE_BISON]
-#define source $[file]
-$[target] : $[source]
-$[TAB] $[BISON] $[YFLAGS] -y $[if $[YACC_PREFIX],-d --name-prefix=$[YACC_PREFIX]] $[source]
+$[target] : $[file]
+$[TAB] $[BISON] $[YFLAGS] -y $[if $[YACC_PREFIX],-d --name-prefix=$[YACC_PREFIX]] $[file]
 $[TAB] mv y.tab.c $[target]
-$[TAB] mv y.tab.h $[patsubst %.yxx,%.h,$[source]]
+$[TAB] mv y.tab.h $[target_header]
 $[target_header] : $[target]
-$[target].prebuilt : $[target]
-$[TAB] cp $[target] $[target].prebuilt
-$[target_header].prebuilt : $[target_header]
-$[TAB] cp $[target_header] $[target_header].prebuilt
+$[target_prebuilt] : $[target]
+$[TAB] cp $[target] $[target_prebuilt]
+$[target_header_prebuilt] : $[target_header]
+$[TAB] cp $[target_header] $[target_header_prebuilt]
 #else // HAVE_BISON
-#define source $[target].prebuilt
-$[target] : $[source]
-$[TAB] cp $[source] $[target]
-#define source $[target_header].prebuilt
-$[target_header] : $[source]
-$[TAB] cp $[source] $[target_header]
+$[target] : $[target_prebuilt]
+$[TAB] cp $[target_prebuilt] $[target]
+$[target_header] : $[target_header_prebuilt]
+$[TAB] cp $[target_header_prebuilt] $[target_header]
 #endif // HAVE_BISON
 
 #end file
@@ -729,20 +696,20 @@ $[TAB] cp $[source] $[target_header]
 // Rules to generate a C++ file from a Flex input file.
 #foreach file $[sort $[lxx_st_sources]]
 #define target $[patsubst %.lxx,%.cxx,$[file]]
+#define target_prebuilt $[target].prebuilt
 #if $[HAVE_BISON]
 #define source $[file]
-$[target] : $[source]
-$[TAB] $[FLEX] $[LFLAGS] $[if $[YACC_PREFIX],-P$[YACC_PREFIX]] -olex.yy.c $[source]
+$[target] : $[file]
+$[TAB] $[FLEX] $[LFLAGS] $[if $[YACC_PREFIX],-P$[YACC_PREFIX]] -olex.yy.c $[file]
 #define source lex.yy.c
 #define script /#include <unistd.h>/d
 $[TAB] $[SED]
-$[TAB] rm $[source]
-$[target].prebuilt : $[target]
-$[TAB] cp $[target] $[target].prebuilt
+$[TAB] rm lex.yy.c
+$[target_prebuilt] : $[target]
+$[TAB] cp $[target] $[target_prebuilt]
 #else // HAVE_BISON
-#define source $[target].prebuilt
-$[target] : $[source]
-$[TAB] cp $[source] $[target]
+$[target] : $[target_prebuilt]
+$[TAB] cp $[target_prebuilt] $[target]
 #endif // HAVE_BISON
 
 #end file
@@ -757,11 +724,17 @@ $[TAB] cp $[source] $[target]
 
 // Rules to compile ordinary C files.
 #foreach file $[sort $[c_sources]]
-#define target $[patsubst %.c,$[st_dir]/%.obj,$[file]]
+#define target $[$[file]_obj]
 #define source $[file]
 #define ipath $[target_ipath]
 #define flags $[cflags] $[building_var:%=/D%]
-$[target] : $[source] $[dependencies $[source]] $[st_dir]/stamp
+#if $[ne $[file], $[notdir $file]]
+  // If the source file is not in the current directory, tack on "."
+  // to the ipath.
+  #set ipath $[ipath] .
+#endif
+
+$[target] : $[source] $[get_depends $[source]]
 $[TAB] $[COMPILE_C]
 
 #end file
@@ -769,20 +742,19 @@ $[TAB] $[COMPILE_C]
 // Rules to compile C++ files.
 
 #foreach file $[sort $[cxx_sources]]
-#define target $[patsubst %.cxx,$[st_dir]/%.obj,$[file]]
+#define target $[$[file]_obj]
 #define source $[file]
 #define ipath $[target_ipath]
-#if $[$[source]_sources]
-#define depends $[dependencies $[$[source]_sources]]
-#else
-#define depends $[dependencies $[source]]
-#endif
-
 #define flags $[c++flags] $[building_var:%=/D%]
+#if $[ne $[file], $[notdir $file]]
+  // If the source file is not in the current directory, tack on "."
+  // to the ipath.
+  #set ipath $[ipath] .
+#endif
 
 // Yacc must run before some files can be compiled, so all files
 // depend on yacc having run.
-$[target] : $[source] $[depends] $[yxx_sources:%.yxx=%.h] $[st_dir]/stamp
+$[target] : $[source] $[get_depends $[source]] $[yxx_sources:%.yxx=%.h]
 $[TAB] $[COMPILE_C++]
 
 #end file

+ 0 - 699
dtool/pptempl/Template.stopgap.pp

@@ -1,699 +0,0 @@
-//
-// Template.stopgap.pp
-//
-// This file defines the set of output files that will be generated to
-// support our old-style Makefile system.  It is intended to aid as a
-// transition to the new system.
-//
-
-//////////////////////////////////////////////////////////////////////
-#if $[eq $[DIR_TYPE], src]
-//////////////////////////////////////////////////////////////////////
-
-// For a source directory, build a Makefile, Makefile.install, and a 
-// Makefile.target for each target.
-
-#define submakes $[TARGET(static_lib_target):%=%.a] $[TARGET(lib_target noinst_lib_target):%=%.so] $[TARGET(sed_bin_target bin_target noinst_bin_target test_bin_target)]
-#define install $[TARGET(static_lib_target):%=%.a] $[TARGET(lib_target noinst_lib_target):%=%.so] $[TARGET(sed_bin_target bin_target noinst_bin_target)]
-
-// Now iterate through the libraries we're building and see which ones
-// actually *are* being included in a metalib.  For each one that is,
-// we install the appropriate deferred file.
-#define deferred
-#forscopes lib_target
-  #define metalib $[module $[TARGET],$[TARGET]]
-  #if $[ne $[metalib],]
-    #set deferred $[deferred] Deferred.$[metalib].lib$[TARGET].so
-  #endif
-#end lib_target
-
-// Get the full set of libraries we depend on.
-#call get_depend_libs
-
-// Also get the targets we'll be installing.
-#define install_libs $[sort $[TARGET(lib_target):%=lib%.so] $[TARGET(static_lib_target):%=lib%.a] $[INSTALL_LIBS]]
-#define install_bin $[sort $[TARGET(bin_target)] $[INSTALL_BIN]]
-#define install_scripts $[sort $[INSTALL_SCRIPTS(static_lib_target lib_target bin_target)] $[TARGET(sed_bin_target)] $[INSTALL_SCRIPTS]]
-#define install_headers $[sort $[INSTALL_HEADERS(static_lib_target lib_target bin_target)] $[INSTALL_HEADERS]]
-#define install_data $[sort $[INSTALL_DATA(static_lib_target lib_target sed_bin_target bin_target)] $[INSTALL_DATA]] $[sort $[INSTALL_CONFIG(static_lib_target lib_target sed_bin_target bin_target)] $[INSTALL_CONFIG]]
-
-// Collect the set of interrogate database files we'll install,
-// possibly one for each library we build.
-#define install_igatedb
-#if $[run_interrogate]
-  #forscopes lib_target
-    #if $[ne $[IGATESCAN],]
-      #set install_igatedb $[install_igatedb] lib$[TARGET].in
-    #endif
-  #end lib_target
-#endif
-
-
-#output Makefile
-#format makefile
-#### Meta Makefile.
-#### Generated automatically by $[PPREMAKE] $[PPREMAKE_VERSION] from $[SOURCEFILE].
-################################# DO NOT EDIT ###########################
-
-
-#### Sub make targets (extension of sub Makefile, eg 'foo' for Makefile.foo):
-SUBMAKES = $[submakes]
-
-#### List the minimal set of sub makes on the list above required to install.
-INSTALL = $[install]
-
-#### Location of sub Makefiles.
-MAKEDIR = .
-
-#### The action is here.
-include $(DTOOL)/include/Makefile.meta.rules
-
-#### Sub-make build order dependencies:
-# foo: bar
-#end Makefile
-
-
-
-#output Makefile.install
-#format makefile
-#### Installation makefile
-#### Generated automatically by $[PPREMAKE] $[PPREMAKE_VERSION] from $[SOURCEFILE].
-################################# DO NOT EDIT ###########################
-
-# Note: This file is included by the project-wide Makefile so the current
-# directory is the project root.  Also, commented-out fields are optional.
-
-#### Package name and location (if not src/all/$(PACKAGE)):
-PACKAGE = $[DIRNAME]
-PKGROOT = $[PATH]
-
-ifneq (,$(PACKAGE))
-
-#### Package dependencies (USESOTHER needs relative paths from project root):
-USESLIBS = $[depend_libs]
-# USESINCLUDE = 
-# USESOTHER = 
-
-#### Installed files:
-LIBS = $[install_libs]
-DEFERRED = $[deferred]
-INCLUDE = $[install_headers]
-BINS = $[install_bin]
-SCRIPTS = $[install_scripts]
-# SS = 
-# STK = 
-# MODELS = 
-ETC = $[install_data]
-IGATEDB =$[install_igatedb]
-# DOC =
-# MAN =
-# FONTS = 
-# ICONS = 
-# APPDEFAULTS = 
-# TCL = 
-# TELEUSE = 
-# SHADERS = 
-
-#### Other files to be installed (use relative pathname from project root):
-#if $[ne $[INSTALL_PARSER_INC],]
-PARSER_INC = $[INSTALL_PARSER_INC]
-SRC_PARSER_INC = $(addprefix $(PKGROOT)/,$(PARSER_INC))
-INST_PARSER_INC = $(addprefix include/parser-inc/,$(PARSER_INC))
-OTHER = $(INST_PARSER_INC)
-#else
-# OTHER =
-#endif
-
-#### Where the action happens.
-include $(DTOOL)/include/Makefile.install.rules
-
-#### Install actions for OTHER files (source must be in $(PKGROOT)):
-# [ installed file ] : $(PKGROOT)/[ source file ]  # Files must have same name
-#       $(INSTALL)                      # Copies from source to dest
-#
-# [ installed file ] : $(PKGROOT)/[ source file ]
-#       $(MKINSTALL)                    # Also makes directory if needed
-
-#if $[ne $[INSTALL_PARSER_INC],]
-$(INST_PARSER_INC) : include/parser-inc/% : $(PKGROOT)/%
-        $(MKINSTALL)
-#endif
-
-#### Other install/uninstall actions:
-# install-$(PKGROOT): #Add dependencies here
-#       Add actions here
-#
-# uninstall-$(PKGROOT): #Add dependencies here
-#       Add actions here
-
-#### Sub-package Makefile.install inclusions:
-# include foo/Makefile.install
-
-endif
-#end Makefile.install
-
-
-
-// Now generate a suitable Makefile for each library target.
-#forscopes lib_target noinst_lib_target
-
-// Again, is this library included in a metalib?  If so, output the
-// appropriate deferred rules.
-#define metalib $[module $[TARGET],$[TARGET]]
-
-// We might need to define a BUILDING_ symbol for win32.  We use the
-// BUILDING_DLL variable name, defined typically in the metalib, for
-// this; but in some cases, where the library isn't part of a metalib,
-// we define BUILDING_DLL directly for the target.
-#define building_var $[BUILDING_DLL]
-#if $[ne $[metalib],]
-  #set building_var $[module $[BUILDING_DLL],$[TARGET]]
-#endif
-
-// Get the full set of sources for this target.
-#call get_sources
-#call get_libs
-
-// Which files will we interrogate, if any?
-#define igatescan $[get_igatescan]
-
-#output Makefile.$[TARGET].so
-#format makefile
-#### Makefile for DSO's.  Any fields commented out are optional.
-#### Generated automatically by $[PPREMAKE] $[PPREMAKE_VERSION] from $[SOURCEFILE].
-################################# DO NOT EDIT ###########################
-
-#### Target's name:
-TARGET = lib$[TARGET].so
-DEFERRED_TARGET = $[metalib]
-
-# Standard .o file conversion information.
-
-#### Lex files 
-LFILES = $[filter %.lxx,$[sources]]
-LEX = flex
-LFLAGS = $[LFLAGS] $[YACC_PREFIX:%=-P%] -olex.yy.c
-LEXTENSION = cxx
-
-#### Yacc files 
-YFILES = $[filter %.yxx,$[sources]]
-YACC = bison
-YFLAGS = -y -d $[patsubst %,--name-prefix=%,$[YACC_PREFIX]]
-YEXTENSION = cxx
-
-#### C files 
-CFILES = $[filter %.c,$[sources]]
-CFLAGS = $[building_var:%=-D%] $[alt_cflags] $[CFLAGS]
-
-#### C++ files 
-C++FILES = $[filter %.cxx,$[sources]]
-C++FLAGS = $[building_var:%=-D%] $[alt_cflags] $[C++FLAGS]
-# USETEMPLATES = TRUE
-# PTREPOSITORY = # Specify only if you want a specific name
-
-#### Interrogate info
-IGATESCAN  = $[igatescan]
-IGATEFLAGS = $[alt_ipath:%=-I%]
-# IGATEFILE  = # Specify only if you want a specific name
-
-#### Additional search directories for C/C++ header files:
-IPATH = $[alt_ipath:%=-I%]
-
-#### Location to put .o files:
-# ODIR = 
-
-#### Source file dependencies (unnecessary with clearmake)
-# foo.c: foo.h
-
-#### Other files and lib.  Include $(ODIR) in any .o names.
-# OFILES = 
-WHEN_NO_DEFER_LIBS = $[when_no_defer:%=-l%]
-WHEN_DEFER_LIBS = $[when_defer:%=-l%]
-LIBS = $[when_either:%=-l%]
-SYSLIBS = $[patsubst %.lib,%.lib,%,-l%,$[unique $[alt_libs]]]
-
-#### Additional search directories for lib:
-LPATH = $[alt_lpath:%=-L%]
-
-#### Other linker flags. 
-#if $[ne $[alt_ld],]
-LD = $[alt_ld]
-#endif
-# LDFLAGS = 
-
-#### Pull in standard .o make variables
-include $(DTOOL)/include/Makefile.o.vars
-
-#### The .o action is here.
-include $(DTOOL)/include/Makefile.o.rules
-
-#### Pull in standard binary make variables.
-include $(DTOOL)/include/Makefile.bin.vars
-
-#### The .so action is here.
-include $(DTOOL)/include/Makefile.so.rules
-#end Makefile.$[TARGET].so
-
-#end lib_target noinst_lib_target
-
-
-
-// Also generate a suitable Makefile for each static library target.
-#forscopes static_lib_target
-
-// Get the full set of sources for this target.
-#call get_sources
-#call get_libs
-
-#output Makefile.$[TARGET].a
-#format makefile
-#### Makefile for archive libraries.  Any fields commented out are optional.
-#### Generated automatically by $[PPREMAKE] $[PPREMAKE_VERSION] from $[SOURCEFILE].
-################################# DO NOT EDIT ###########################
-
-#### Target's name:
-TARGET = lib$[TARGET].a
-
-# Standard .o file conversion information.
-
-#### Lex files 
-LFILES = $[filter %.lxx,$[sources]]
-LEX = flex
-LFLAGS = $[LFLAGS] $[YACC_PREFIX:%=-P%] -olex.yy.c
-LEXTENSION = yy.cxx
-# LSUBST =
-
-#### Yacc files 
-YFILES = $[filter %.yxx,$[sources]]
-YACC = bison
-YFLAGS = -y -d $[patsubst %,--name-prefix=%,$[YACC_PREFIX]]
-YEXTENSION = tab.cxx
-# YSUBST =
-
-#### C files 
-CFILES = $[filter %.c,$[sources]]
-CFLAGS = $[building_var:%=-D%] $[alt_cflags] $[CFLAGS]
-
-#### C++ files 
-C++FILES = $[filter %.cxx,$[sources]]
-C++FLAGS = $[building_var:%=-D%] $[alt_cflags] $[C++FLAGS]
-# USETEMPLATES = TRUE
-# PTREPOSITORY = # Specify only if you want a specific name
-
-#### Additional search directories for C/C++ header files:
-IPATH = $[alt_ipath:%=-I%]
-
-#### Location to put .o files:
-# ODIR = 
-
-#### Source file dependencies (unnecessary with clearmake)
-# foo.c: foo.h
-
-#### Other .o files.
-# OFILES = 
-
-#### Libs and flags for template instantiation.
-WHEN_NO_DEFER_LIBS = $[when_no_defer:%=-l%]
-WHEN_DEFER_LIBS = $[when_defer:%=-l%]
-LIBS = $[when_either:%=-l%]
-SYSLIBS = $[patsubst %.lib,%.lib,%,-l%,$[unique $[alt_libs]]]
-
-#### Additional search directories for lib:
-LPATH = $[alt_lpath:%=-L%]
-
-#### Archiver flags
-# ARFLAGS = 
-
-#### Pull in standard .o make variables
-include $(DTOOL)/include/Makefile.o.vars
-
-#### The .o action is here.
-include $(DTOOL)/include/Makefile.o.rules
-
-#### Pull in standard binary make variables.
-include $(DTOOL)/include/Makefile.bin.vars
-
-#### The .a action is here.
-include $(DTOOL)/include/Makefile.a.rules
-#end Makefile.$[TARGET].a
-
-#end static_lib_target
-
-
-
-// And also generate a suitable Makefile for each binary target.
-#forscopes bin_target noinst_bin_target test_bin_target
-
-// Get the full set of sources for this target.
-#call get_sources
-#call get_libs
-
-#output Makefile.$[TARGET]
-#format makefile
-#### Makefile for binaries.  Any fields commented out are optional.
-#### Generated automatically by $[PPREMAKE] $[PPREMAKE_VERSION] from $[SOURCEFILE].
-################################# DO NOT EDIT ###########################
-
-#### Target's name:
-TARGET = $[TARGET]
-
-# Standard .o file conversion information.
-
-#### Lex files 
-LFILES = $[filter %.lxx,$[sources]]
-LEX = flex
-LFLAGS = $[LFLAGS] $[YACC_PREFIX:%=-P%] -olex.yy.c
-LEXTENSION = yy.cxx
-# LSUBST =
-
-#### Yacc files 
-YFILES = $[filter %.yxx,$[sources]]
-YACC = bison
-YFLAGS = -y -d $[patsubst %,--name-prefix=%,$[YACC_PREFIX]]
-YEXTENSION = tab.cxx
-# YSUBST =
-
-#### C files 
-CFILES = $[filter %.c,$[sources]]
-CFLAGS = $[building_var:%=-D%] $[alt_cflags] $[CFLAGS]
-
-#### C++ files 
-C++FILES = $[filter %.cxx,$[sources]]
-C++FLAGS = $[building_var:%=-D%] $[alt_cflags] $[C++FLAGS]
-
-#### Additional search directories for C/C++ header files:
-IPATH = $[alt_ipath:%=-I%]
-
-#### Location to put .o files:
-# ODIR = 
-
-#### Source file dependencies (unnecessary with clearmake)
-# foo.c: foo.h
-
-#### Other files and lib.  Include $(ODIR) in any .o names.
-# OFILES = 
-WHEN_NO_DEFER_LIBS = $[when_no_defer:%=-l%]
-WHEN_DEFER_LIBS = $[when_defer:%=-l%]
-LIBS = $[when_either:%=-l%]
-SYSLIBS = $[patsubst %.lib,%.lib,%,-l%,$[unique $[alt_libs]]]
-
-#### Additional search directories for lib:
-LPATH = $[alt_lpath:%=-L%]
-
-#### Other linker flags. 
-#if $[ne $[alt_ld],]
-LD = $[alt_ld]
-#endif
-# LDFLAGS =
-
-#### Pull in standard .o make variables
-include $(DTOOL)/include/Makefile.o.vars
-
-#### The .o action is here.
-include $(DTOOL)/include/Makefile.o.rules
-
-#### Pull in standard binary make variables.
-include $(DTOOL)/include/Makefile.bin.vars
-
-#### The bin action is here.
-include $(DTOOL)/include/Makefile.bin.rules
-#end Makefile.$[TARGET]
-
-#end bin_target noinst_bin_target test_bin_target
-
-
-// Finally, generate the special scripts from the sed_bin_targets.  Hopefully
-// there won't be too many of these in the tree, since these are fairly
-// Unix-specific.
-#forscopes sed_bin_target
-#output Makefile.$[TARGET]
-#format makefile
-#### This is a special makefile just to generate the $[TARGET] script.
-
-$[TARGET] : $[SOURCE]
-        sed $[COMMAND] $^ >$@
-        chmod +x $@
-
-clean :
-
-cleanall :
-        rm -f $[TARGET]
-#end Makefile.$[TARGET]
-#end sed_bin_target
-
-
-//////////////////////////////////////////////////////////////////////
-#elif $[eq $[DIR_TYPE], metalib]
-//////////////////////////////////////////////////////////////////////
-
-// A metalib directory is similar to a regular source directory, 
-// but a little simpler.
-
-#define submakes $[TARGET(metalib_target):%=%.so]
-
-
-// Get the full set of libraries we depend on.
-#call get_depend_libs
-
-// Also get the targets we'll be installing.
-#define install_libs $[TARGET(metalib_target):%=lib%.so]
-#define install_headers $[INSTALL_HEADERS(metalib_target)]
-#define install_data $[INSTALL_DATA(metalib_target)] $[INSTALL_CONFIG(metalib_target)]
-
-
-#output Makefile
-#format makefile
-#### Meta Makefile.
-#### Generated automatically by $[PPREMAKE] $[PPREMAKE_VERSION] from $[SOURCEFILE].
-################################# DO NOT EDIT ###########################
-
-
-#### Sub make targets (extension of sub Makefile, eg 'foo' for Makefile.foo):
-SUBMAKES = $[submakes]
-
-#### List the minimal set of sub makes on the list above required to install.
-INSTALL = $[submakes]
-
-#### Location of sub Makefiles.
-MAKEDIR = .
-
-#### The action is here.
-include $(DTOOL)/include/Makefile.meta.rules
-
-#### Sub-make build order dependencies:
-# foo: bar
-#end Makefile
-
-
-
-#output Makefile.install
-#format makefile
-#### Installation makefile
-#### Generated automatically by $[PPREMAKE] $[PPREMAKE_VERSION] from $[SOURCEFILE].
-################################# DO NOT EDIT ###########################
-
-# Note: This file is included by the project-wide Makefile so the current
-# directory is the project root.  Also, commented-out fields are optional.
-
-#### Package name and location (if not src/all/$(PACKAGE)):
-PACKAGE = $[DIRNAME]
-PKGROOT = $[PATH]
-
-ifneq (,$(PACKAGE))
-
-#### Package dependencies (USESOTHER needs relative paths from project root):
-USESLIBS = $[depend_libs]
-# USESINCLUDE = 
-# USESOTHER = 
-
-#### Installed files:
-LIBS = $[install_libs]
-INCLUDE = $[install_headers]
-# BINS =
-# SS = 
-# STK = 
-# MODELS = 
-# ETC =
-# DOC =
-# MAN =
-# FONTS = 
-# ICONS = 
-# APPDEFAULTS = 
-# TCL = 
-# TELEUSE = 
-# SHADERS = 
-
-#### Other files to be installed (use relative pathname from project root):
-# OTHER = 
-
-#### Where the action happens.
-include $(DTOOL)/include/Makefile.install.rules
-
-#### Install actions for OTHER files (source must be in $(PKGROOT)):
-# [ installed file ] : $(PKGROOT)/[ source file ]  # Files must have same name
-#       $(INSTALL)                      # Copies from source to dest
-#
-# [ installed file ] : $(PKGROOT)/[ source file ]
-#       $(MKINSTALL)                    # Also makes directory if needed
-
-#### Other install/uninstall actions:
-# install-$(PKGROOT): #Add dependencies here
-#       Add actions here
-#
-# uninstall-$(PKGROOT): #Add dependencies here
-#       Add actions here
-
-#### Sub-package Makefile.install inclusions:
-# include foo/Makefile.install
-
-endif
-#end Makefile.install
-
-// Now generate a suitable Makefile for each metalib target.
-#forscopes metalib_target
-
-#define building_var $[BUILDING_DLL]
-
-// Get the full set of sources for this target.
-#call get_sources
-#call get_libs
-
-#define igatemscan $[get_igatemscan]
-
-#output Makefile.$[TARGET].so
-#format makefile
-#### Makefile for DSO's.  Any fields commented out are optional.
-#### Generated automatically by $[PPREMAKE] $[PPREMAKE_VERSION] from $[SOURCEFILE].
-################################# DO NOT EDIT ###########################
-
-#### Target's name:
-TARGET = lib$[TARGET].so
-
-# Standard .o file conversion information.
-
-#### Lex files 
-LFILES = $[filter %.lxx,$[sources]]
-LEX = flex
-LFLAGS = $[LFLAGS] $[YACC_PREFIX:%=-P%] -olex.yy.c
-LEXTENSION = yy.cxx
-# LSUBST =
-
-#### Yacc files 
-YFILES = $[filter %.yxx,$[sources]]
-YACC = bison
-YFLAGS = -y -d $[patsubst %,--name-prefix=%,$[YACC_PREFIX]]
-YEXTENSION = tab.cxx
-# YSUBST =
-
-#### C files 
-CFILES = $[filter %.c,$[sources]]
-CFLAGS = $[building_var:%=-D%] $[alt_cflags] $[CFLAGS]
-
-#### C++ files 
-C++FILES = $[filter %.cxx,$[sources]]
-C++FLAGS = $[building_var:%=-D%] $[alt_cflags] $[C++FLAGS]
-# USETEMPLATES = TRUE
-# PTREPOSITORY = # Specify only if you want a specific name
-
-#### Interrogate info
-# IGATESCAN  = 
-# IGATEFLAGS = 
-# IGATEFILE  = # Specify only if you want a specific name
-IGATEMSCAN = $[igatemscan]
-
-#### Pull in deferred-target files built in other packages
-DEFERRED_FILES = $[TARGET]
-
-#### Additional search directories for C/C++ header files:
-IPATH = $[alt_ipath:%=-I%]
-
-#### Location to put .o files:
-# ODIR = 
-
-#### Source file dependencies (unnecessary with clearmake)
-# foo.c: foo.h
-
-#### Other files and lib.  Include $(ODIR) in any .o names.
-# OFILES = 
-WHEN_NO_DEFER_LIBS = $[when_no_defer:%=-l%]
-WHEN_DEFER_LIBS = $[when_defer:%=-l%]
-LIBS = $[when_either:%=-l%]
-SYSLIBS = $[patsubst %.lib,%.lib,%,-l%,$[unique $[alt_libs]]]
-
-#### Additional search directories for lib:
-LPATH = $[alt_lpath:%=-L%]
-
-#### Other linker flags. 
-#if $[ne $[alt_ld],]
-LD = $[alt_ld]
-#endif
-# LDFLAGS = 
-
-#### Pull in standard .o make variables
-include $(DTOOL)/include/Makefile.o.vars
-
-#### The .o action is here.
-include $(DTOOL)/include/Makefile.o.rules
-
-#### Pull in standard binary make variables.
-include $(DTOOL)/include/Makefile.bin.vars
-
-#### The .so action is here.
-include $(DTOOL)/include/Makefile.so.rules
-#end Makefile.$[TARGET].so
-
-#end metalib_target
-
-
-//////////////////////////////////////////////////////////////////////
-#elif $[eq $[DIR_TYPE], group]
-//////////////////////////////////////////////////////////////////////
-
-// This is a group directory: a directory above a collection of source
-// directories, e.g. $DTOOL/src.  We don't need to output anything in
-// this directory.
-
-
-
-//////////////////////////////////////////////////////////////////////
-#elif $[eq $[DIR_TYPE], toplevel]
-//////////////////////////////////////////////////////////////////////
-
-// This is the toplevel directory, e.g. $DTOOL.  Here we build the
-// root makefile and also synthesize the dtool_config.h (or whichever
-// file) we need.
-
-#output Makefile
-#format makefile
-#### Generated automatically by $[PPREMAKE] $[PPREMAKE_VERSION] from $[SOURCEFILE].
-################################# DO NOT EDIT ###########################
-
-# Specify project name and project root directory.
-CTPROJECT = $[PACKAGE]
-CTPROJROOT = $($[upcase $[PACKAGE]])
-
-include $(DTOOL)/include/Makefile.project.vars
-
-// Iterate through all of our known source files.  Each src and
-// metalib type file gets its corresponding Makefile.install listed
-// here.  However, we test for $[DIR_TYPE] of toplevel, because the
-// source directories typically don't define their own DIR_TYPE
-// variable, and they end up inheriting this one dynamically.
-#forscopes */
-#if $[or $[eq $[DIR_TYPE], src],$[eq $[DIR_TYPE], metalib],$[and $[eq $[DIR_TYPE], toplevel],$[ne $[DIRNAME],top]]]
-#if $[build_directory]
-include $[PATH]/Makefile.install
-#endif
-#endif
-#end */
-
-#end Makefile
-
-// If there is a file called LocalSetup.pp in the package's top
-// directory, then invoke that.  It might contain some further setup
-// instructions.
-#sinclude $[TOPDIRPREFIX]LocalSetup.stopgap.pp
-#sinclude $[TOPDIRPREFIX]LocalSetup.pp
-
-//////////////////////////////////////////////////////////////////////
-#endif // DIR_TYPE

+ 5 - 5
dtool/pptempl/compilerSettings.pp

@@ -10,7 +10,7 @@
   #define OPT1FLAGS /GZ 
 
   // Note: Zi cannot be used on multiproc builds with precomp hdrs, Z7 must be used instead
-  #defer DEBUGPDBFLAGS /Zi /Fd"$[osfilename $[target:%.obj=%.pdb]]"  
+  #defer DEBUGPDBFLAGS /Zi /Fd"$[osfilename $[patsubst %.obj,%.pdb,$[notdir $[target]]]]"  
   #defer DEBUGFLAGS /MDd $[BROWSEINFO_FLAG] $[DEBUGINFOFLAGS] $[DEBUGPDBFLAGS]
   #define RELEASEFLAGS /MD
   #define WARNING_LEVEL_FLAG /W3  
@@ -82,7 +82,7 @@
   #define WARNING_LEVEL_FLAG /W3   // WL
 
   // Note: Zi cannot be used on multiproc builds with precomp hdrs, Z7 must be used instead
-  #defer DEBUGPDBFLAGS /Zi /Fd"$[osfilename $[target:%.obj=%.pdb]]"  
+  #defer DEBUGPDBFLAGS /Zi /Fd"$[osfilename $[patsubst %.obj,%.pdb,$[notdir $[target]]]]"  
   #defer DEBUGFLAGS /MDd $[BROWSEINFO_FLAG] $[DEBUGINFOFLAGS] $[DEBUGPDBFLAGS]
   #define RELEASEFLAGS /MD
   
@@ -112,7 +112,7 @@
   #define COMMONFLAGS /DHAVE_DINKUM /Gi- /Qwd985 /Qvc7 /G6 
   
   // Note: Zi cannot be used on multiproc builds with precomp hdrs, Z7 must be used instead
-  #defer DEBUGPDBFLAGS /Zi /Qinline_debug_info /Fd"$[osfilename $[target:%.obj=%.pdb]]" 
+  #defer DEBUGPDBFLAGS /Zi /Qinline_debug_info /Fd"$[osfilename $[patsubst %.obj,%.pdb,$[notdir $[target]]]]"  
   // Oy- needed for MS debugger
   #defer DEBUGFLAGS /Oy- /MDd $[BROWSEINFO_FLAG] $[DEBUGINFOFLAGS] $[DEBUGPDBFLAGS] 
   #define RELEASEFLAGS /MD
@@ -154,7 +154,7 @@
   #define COMMONFLAGS
   #define OPTFLAGS /O2 /Ogity /G6
   #define OPT1FLAGS /GZ   
-  #defer DEBUGFLAGS /MDd /Zi $[BROWSEINFO_FLAG] /Fd"$[osfilename $[target:%.obj=%.pdb]]"
+  #defer DEBUGPDBFLAGS /MDd /Zi $[BROWSEINFO_FLAG] /Fd"$[osfilename $[patsubst %.obj,%.pdb,$[notdir $[target]]]]"  
   #define RELEASEFLAGS /MD
   #define EXTRA_LIBPATH
   #define EXTRA_INCPATH
@@ -176,7 +176,7 @@
   #define COMMONFLAGS
   #define OPTFLAGS /O2 /Ogity /G6
   #define OPT1FLAGS /GZ   
-  #defer DEBUGFLAGS /MDd /Zi $[BROWSEINFO_FLAG] /Fd"$[osfilename $[target:%.obj=%.pdb]]"
+  #defer DEBUGPDBFLAGS /MDd /Zi $[BROWSEINFO_FLAG] /Fd"$[osfilename $[patsubst %.obj,%.pdb,$[notdir $[target]]]]"  
   #define RELEASEFLAGS /MD
   #define EXTRA_LIBPATH
   #define EXTRA_INCPATH