Index: /CMT/HEAD/ChangeLog
===================================================================
--- /CMT/HEAD/ChangeLog	(revision 628)
+++ /CMT/HEAD/ChangeLog	(revision 629)
@@ -1,2 +1,28 @@
+2013-01-25    <rybkin@lal.in2p3.fr> 500
+
+	* source/cmt_constituent.cxx: In class constituents_action_iterator
+	function set, assign constituent member has_modules according to passed
+	option -modules or -no_modules, print diagnostic message about bad option
+	if Verbose level is activated only, in class Constituent function clear,
+	set has_modules to false, in function show, add printout for options
+	-modules and -no_modules
+	* source/cmt_constituent.h: In class Constituent, introduce member
+	has_modules for applications and libraries in languages with modules (like
+	Fortran 90 and later)
+	* source/cmt_project.cxx: In class Project functions set_strategy and
+	update_strategy, update strategy for project(s) without parent and children 
+	* source/cmt_parser.cxx: In class StandardMacroBuilder function
+	fill_for_constituent_macros, for applications, libraries add to macros
+	<constituent>compile_dependencies macros <dependency>compile for
+	dependencies that have modules so that dependencies modules, generated at
+	compile time, are available before constituent compilation
+	* mgr/fragments/dependencies: Do not (re)build
+	${CONSTITUENT}_dependencies.make at prototype build stage as some header
+	files may not be available yet
+	* mgr/fragments/constituent_app_lib: In target ${CONSTITUENT}install rule
+	command, check whether makefile exists to allow for use of -n (no-op) Make
+	option, in target ${CONSTITUENT}uninstall rule command, ignore errors,
+	similar to target ${CONSTITUENT}clean rule command
+
 2013-01-11    <rybkin@lal.in2p3.fr> 499
 
Index: /CMT/HEAD/mgr/fragments/constituent_app_lib
===================================================================
--- /CMT/HEAD/mgr/fragments/constituent_app_lib	(revision 628)
+++ /CMT/HEAD/mgr/fragments/constituent_app_lib	(revision 629)
@@ -101,9 +101,9 @@
 
 ${CONSTITUENT}clean :: $(${CONSTITUENT}clean_dependencies) ##$(cmt_local_${CONSTITUENT}_makefile)
-	$(echo) "(constituents.make) Starting ${CONSTITUENT}clean"
+	$(echo) "(constituents.make) Starting $@"
 	@-if test -f $(cmt_local_${CONSTITUENT}_makefile); then \
-	  $(MAKE) -f $(cmt_local_${CONSTITUENT}_makefile) ${CONSTITUENT}clean; \
+	  $(MAKE) -f $(cmt_local_${CONSTITUENT}_makefile) $@; \
 	fi
-	$(echo) "(constituents.make) ${CONSTITUENT}clean done"
+	$(echo) "(constituents.make) $@ done"
 #	@-$(MAKE) -f $(cmt_local_${CONSTITUENT}_makefile) ${CONSTITUENT}clean
 
@@ -113,7 +113,10 @@
 
 ${CONSTITUENT}install :: ${CONSTITUENT}compile $(${CONSTITUENT}_dependencies) $(cmt_local_${CONSTITUENT}_makefile)
-	$(echo) "(constituents.make) Starting install ${CONSTITUENT}"
-	@-$(MAKE) -f $(cmt_local_${CONSTITUENT}_makefile) $@
-	$(echo) "(constituents.make) install ${CONSTITUENT} done"
+	$(echo) "(constituents.make) Starting $@"
+	@if test -f $(cmt_local_${CONSTITUENT}_makefile); then \
+	  $(MAKE) -f $(cmt_local_${CONSTITUENT}_makefile) $@; \
+	  fi
+#	@$(MAKE) -f $(cmt_local_${CONSTITUENT}_makefile) $@
+	$(echo) "(constituents.make) $@ done"
 
 uninstall : ${CONSTITUENT}uninstall
@@ -122,10 +125,10 @@
 
 ${CONSTITUENT}uninstall : $(${CONSTITUENT}uninstall_dependencies) ##$(cmt_local_${CONSTITUENT}_makefile)
-	$(echo) "(constituents.make) Starting uninstall ${CONSTITUENT}"
-	@if test -f $(cmt_local_${CONSTITUENT}_makefile); then \
+	$(echo) "(constituents.make) Starting $@"
+	@-if test -f $(cmt_local_${CONSTITUENT}_makefile); then \
 	  $(MAKE) -f $(cmt_local_${CONSTITUENT}_makefile) uninstall; \
 	  fi
 #	@$(MAKE) -f $(cmt_local_${CONSTITUENT}_makefile) uninstall
-	$(echo) "(constituents.make) uninstall ${CONSTITUENT} done"
+	$(echo) "(constituents.make) $@ done"
 
 remove_library_links :: ${CONSTITUENT}uninstall ;
Index: /CMT/HEAD/mgr/fragments/dependencies
===================================================================
--- /CMT/HEAD/mgr/fragments/dependencies	(revision 628)
+++ /CMT/HEAD/mgr/fragments/dependencies	(revision 629)
@@ -2,4 +2,5 @@
 ifneq ($(MAKECMDGOALS),${CONSTITUENT}clean)
 ifneq ($(MAKECMDGOALS),uninstall)
+ifneq ($(MAKECMDGOALS),${CONSTITUENT}prototype)
 
 $(bin)${CONSTITUENT}_dependencies.make : $(use_requirements) $(cmt_final_setup_${CONSTITUENT})
@@ -11,4 +12,5 @@
 endif
 endif
+endif
 
 ${CONSTITUENT}clean ::
Index: /CMT/HEAD/source/cmt_constituent.cxx
===================================================================
--- /CMT/HEAD/source/cmt_constituent.cxx	(revision 628)
+++ /CMT/HEAD/source/cmt_constituent.cxx	(revision 629)
@@ -16,4 +16,5 @@
 #include "cmt_database.h"
 #include "cmt_log.h"
+#include "cmt_error.h"
 
 /*----------------------------------------------------------*/
@@ -174,4 +175,20 @@
         m_constituent.need_prototypes = false;
       }
+    else if (w == "-modules")
+      {
+        if (m_constituent.type == Application ||
+	    m_constituent.type == Library)
+          {
+	    m_constituent.has_modules = true;
+	  }
+      }
+    else if (w == "-no_modules")
+      {
+        if (m_constituent.type == Application ||
+	    m_constituent.type == Library)
+          {
+	    m_constituent.has_modules = false;
+	  }
+      }
     else if (w == "-check")
       {
@@ -253,12 +270,8 @@
     else if (w.substr (0, 1) == "-")
       {
-	//if (!Cmt::get_quiet ())
-	//{
-	CmtMessage::warning ("bad option " + w + " in constituent " +
-			     m_constituent.name);
-	//	cerr << "#CMT> Warning: bad option " 
-	//	     << w << " in constituent " << m_constituent.name << endl;
-	//CmtError::set (CmtError::execution_error, cmd);
-	//}
+	if (CmtMessage::active (Verbose))
+	  CmtMessage::warning
+	    (CmtError::get_error_name (CmtError::syntax_error)
+	     + ": bad option " + w + " in constituent " + m_constituent.name);
       }
     else if ((equal = w.find ("=")) != cmt_string::npos)
@@ -522,4 +535,5 @@
   no_share        = false;
   need_prototypes = false;
+  has_modules     = false;
   need_check      = false;
   build_triggers  = false;
@@ -672,4 +686,12 @@
     }
   
+  if (type == Application || type == Library)
+    {
+      if (has_modules)
+	out << " -modules";
+      else
+	out << " -no_modules";
+    }
+  
   if (has_target_tag)
     {
Index: /CMT/HEAD/source/cmt_constituent.h
===================================================================
--- /CMT/HEAD/source/cmt_constituent.h	(revision 628)
+++ /CMT/HEAD/source/cmt_constituent.h	(revision 629)
@@ -58,4 +58,5 @@
   bool no_share;
   bool need_prototypes;
+  bool has_modules;
   bool need_check;
   bool build_triggers;
Index: /CMT/HEAD/source/cmt_parser.cxx
===================================================================
--- /CMT/HEAD/source/cmt_parser.cxx	(revision 628)
+++ /CMT/HEAD/source/cmt_parser.cxx	(revision 629)
@@ -9657,4 +9657,6 @@
 			if (dep->need_prototypes)
 			  temp += " " + word + "prototype";
+			if (dep->has_modules)
+			  temp += " " + word + "compile";
 			break;
 		      case Document:
Index: /CMT/HEAD/source/cmt_project.cxx
===================================================================
--- /CMT/HEAD/source/cmt_project.cxx	(revision 628)
+++ /CMT/HEAD/source/cmt_project.cxx	(revision 629)
@@ -2958,4 +2958,16 @@
       project->update_strategy (definition, b_value);
     }
+
+  const ProjectPtrVector& OrderedProjects = Project::ordered_projects ();
+  for (int i = OrderedProjects.size () - 2; i >= 0; i--)
+    {
+      if (this != OrderedProjects[i + 1]) continue;
+      if (!OrderedProjects[i]->has_parents () &&
+	  OrderedProjects[i]->get_children_size () == 0)
+	{
+	  OrderedProjects[i]->update_strategy (definition, b_value);
+	}
+      break;
+    }
 }
 
@@ -3011,4 +3023,16 @@
 
 	  project->update_strategy (definition, b_value);
+	}
+
+      const ProjectPtrVector& OrderedProjects = Project::ordered_projects ();
+      for (int i = OrderedProjects.size () - 2; i >= 0; i--)
+	{
+	  if (this != OrderedProjects[i + 1]) continue;
+	  if (!OrderedProjects[i]->has_parents () &&
+	      OrderedProjects[i]->get_children_size () == 0)
+	    {
+	      OrderedProjects[i]->update_strategy (definition, b_value);
+	    }
+	  break;
 	}
     }
