Add --no-depend-generate to the front-end CLI. fix
authorJon Chatten
Fri, 29 Jan 2010 17:40:04 +0000
branchfix
changeset 219 c3543adfd26e
parent 218 08ca0919c66d
child 220 f7d68ecb923e
Add --no-depend-generate to the front-end CLI. Create an appropriate .DEFAULT target based on --no-depend-generate *not* being used. Tweak tests.
sbsv2/raptor/python/raptor.py
sbsv2/raptor/python/raptor_cli.py
sbsv2/raptor/python/raptor_make.py
sbsv2/raptor/test/smoke_suite/dependencies.py
--- a/sbsv2/raptor/python/raptor.py	Thu Jan 28 16:33:36 2010 +0000
+++ b/sbsv2/raptor/python/raptor.py	Fri Jan 29 17:40:04 2010 +0000
@@ -501,6 +501,7 @@
 		self.doExport = True
 		self.noBuild = False
 		self.noDependInclude = False
+		self.noDependGenerate = False
 		self.projects = set()
 
 		self.cache = raptor_cache.Cache(self)
@@ -619,6 +620,10 @@
 		self.noDependInclude = TrueOrFalse
 		return True
 
+	def SetNoDependGenerate(self, TrueOrFalse):
+		self.noDependGenerate = TrueOrFalse
+		return True
+
 	def SetKeepGoing(self, TrueOrFalse):
 		self.keepGoing = TrueOrFalse
 		return True
--- a/sbsv2/raptor/python/raptor_cli.py	Thu Jan 28 16:33:36 2010 +0000
+++ b/sbsv2/raptor/python/raptor_cli.py	Fri Jan 29 17:40:04 2010 +0000
@@ -47,7 +47,7 @@
 LIBRARY        Create import libraries from frozen .DEF files
 LISTING        Create assembler listing files for source files
 REALLYCLEAN    Same as CLEAN but also remove exported files
-RESOURCE       Create resource files and AIFs
+RESOURCE       Create resource files
 ROMFILE        Create an IBY file to be included in a ROM
 TARGET         Create main executables
 WHAT           List all releaseable targets
@@ -119,6 +119,9 @@
 
 parser.add_option("--no-depend-include",action="store_true",dest="noDependInclude",
 				help="Do not include generated dependency files. This is only useful for extremely large non-incremental builds.")
+
+parser.add_option("--no-depend-generate",action="store_true",dest="noDependGenerate",
+				help="Do not generate dependency files. This is only useful for extremely large non-incremental builds.  Implies --no-depend-include.")
 				
 parser.add_option("-o","--orderlayers",action="store_true",dest="sys_def_order_layers",
 				help="Build layers in the System Definition XML file in the order listed or, if given, in the order of -l options.")
@@ -274,6 +277,7 @@
 				 'make_engine': Raptor.SetMakeEngine,
 				 'make_option': Raptor.AddMakeOption,
 				 'noDependInclude': Raptor.SetNoDependInclude,
+				 'noDependGenerate': Raptor.SetNoDependInclude,
 				 'number_of_jobs': Raptor.SetJobs,
 				 'project_name' :  Raptor.AddProject,
 				 'filter_list' : Raptor.FilterList,
@@ -285,8 +289,8 @@
 				 'timing' : Raptor.SetTiming,
 				 'source_target' : Raptor.AddSourceTarget,
 				 'command_file' : CommandFile,
-				'parallel_parsing' : Raptor.SetParallelParsing,
-			 	'version' : Raptor.PrintVersion
+				 'parallel_parsing' : Raptor.SetParallelParsing,
+			 	 'version' : Raptor.PrintVersion
 				}
 
 	# Check if Quiet mode has been specified (otherwise we will make noise)
--- a/sbsv2/raptor/python/raptor_make.py	Thu Jan 28 16:33:36 2010 +0000
+++ b/sbsv2/raptor/python/raptor_make.py	Fri Jan 29 17:40:04 2010 +0000
@@ -176,6 +176,19 @@
 			 talon_settings,
 			 self.raptor.systemFLM.Append('globals.mk') )
 
+		# Unless dependency generated has been disabled via the CLI, use a .DEFAULT target to
+		# trap missing dependencies (ignoring user config files that we know are usually absent)
+		if not Raptor.noDependGenerate:
+			self.makefile_prologue += """
+$(FLMHOME)/user/final.mk:
+$(FLMHOME)/user/default.flm:
+$(FLMHOME)/user/globals.mk:
+
+.DEFAULT:
+	@echo "<warning>Missing dependency detected: $@</warning>"
+
+"""
+
 		# Only output timings if requested on CLI
 		if self.raptor.timing:
 			self.makefile_prologue += "\n# Print Start-time of Makefile parsing\n" \
--- a/sbsv2/raptor/test/smoke_suite/dependencies.py	Thu Jan 28 16:33:36 2010 +0000
+++ b/sbsv2/raptor/test/smoke_suite/dependencies.py	Fri Jan 29 17:40:04 2010 +0000
@@ -94,10 +94,12 @@
 		rm -rf $(EPOCROOT)/epoc32/include/dependency.rh
 		sbs -f- --noexport -b smoke_suite/test_resources/dependencies/bld.inf -c default -c tools2_rel"""
 	t.mustnotmatch = []
+	# Note that the resource build does not exhibit a missing dependency as its dependency files are generated in a separate stage where
+	# the target file isn't actually a target of that stage
 	t.mustmatch.extend([
-		"<warning>Missing dependency detected: $(EPOCROOT)/epoc32/include/dependency.h</warning>",
-		"<warning>Missing dependency detected: $(EPOCROOT)/epoc32/include/dependency.rh</warning>",		
+		"<warning>Missing dependency detected: .*/epoc32/include/dependency.h</warning>"
 		])
+	t.warnings = 1
 	t.run()
 	
 	t.id = "0098d"
@@ -117,6 +119,7 @@
 	t.targets = targets
 	t.mustmatch = []
 	t.countmatch = []
+	t.warnings = 0
 	t.errors = 1 # We expect an error from the first build due to the deliberate dependency file corruption
 	t.run()