[Box Backup-dev] COMMIT r660 - box/chris/general/infrastructure

boxbackup-dev at fluffy.co.uk boxbackup-dev at fluffy.co.uk
Thu Jul 20 21:15:29 BST 2006


Author: chris
Date: 2006-07-20 20:15:21 +0000 (Thu, 20 Jul 2006)
New Revision: 660

Modified:
   box/chris/general/infrastructure/makebuildenv.pl
Log:
* makebuildenv.pl
- Changed the dependency hack to be a bit less hackish (still, the problem
  is that lib/common depends on lib/win32, and I don't think we can list
  implicit deps like lib/common in modules.txt)
- Avoid rebuilding executables and libraries unnecessarily when not
  using BSD make
- Code cleanups


Modified: box/chris/general/infrastructure/makebuildenv.pl
===================================================================
--- box/chris/general/infrastructure/makebuildenv.pl	2006-07-19 19:29:15 UTC (rev 659)
+++ box/chris/general/infrastructure/makebuildenv.pl	2006-07-20 20:15:21 UTC (rev 660)
@@ -40,8 +40,7 @@
 my $windows_include_path = "";
 if ($target_windows)
 {
-	$windows_include_path = "-I../../lib/win32 -I ../../lib/common " .
-		"-I../../lib/server ";
+	$module_dependency{"lib/common"} = ["lib/win32"];
 	push @implicit_deps, "lib/win32";
 }
 else
@@ -382,7 +381,7 @@
 my %module_resources_win32;
 
 # Then write a makefile for each module
-for my $mod (@modules, @implicit_deps)
+for my $mod (@implicit_deps, @modules)
 {
 	print $mod,"\n";
 	
@@ -448,14 +447,14 @@
 		add_mod_deps(\@deps_raw, $mod);
 		# and then dedup and reorder them
 		my %d_done;
-		for(my $a = $#deps_raw; $a >= 0; $a--)
+		foreach my $dep (reverse @deps_raw)
 		{
-			if(!exists $d_done{$deps_raw[$a]})
+			if(!exists $d_done{$dep})
 			{
 				# insert
-				push @all_deps_for_module, $deps_raw[$a];
+				push @all_deps_for_module, $dep;
 				# mark as done
-				$d_done{$deps_raw[$a]} = 1;
+				$d_done{$dep} = 1;
 			}
 		}
 	}	
@@ -685,8 +684,13 @@
 
 	my $o_file_list = join(' ',map {'$(OUTDIR)/'.$_.'.o'} @objs);
 
+	if ($has_deps and not $bsd_make)
+	{
+		print MAKE ".PHONY: all\n" .
+			"all: dep_modules $end_target\n\n";
+	}
+
 	print MAKE $end_target,': ',$o_file_list;
-	print MAKE ' dep_modules' if $has_deps and not $bsd_make;
 	print MAKE " ",$lib_files unless $target_is_library;
 	print MAKE "\n";
 	




More information about the Boxbackup-dev mailing list