Index: CMT/HEAD/ChangeLog
===================================================================
--- CMT/HEAD/ChangeLog	(revision 612)
+++ CMT/HEAD/ChangeLog	(revision 613)
@@ -1,2 +1,17 @@
+2012-04-27    <rybkin@lal.in2p3.fr> 488
+
+	* source/cmt_generators.cxx: In class LibraryGenerator, in function
+	proto_file_action, add template CONSTITUENT for fragment buildproto, in
+	function build, add template OBJS for fragment protos_header
+	* mgr/fragments/protos_header: Add dependency for each object on every
+	prototype stamp for constituent so that prototypes can be used for current
+	constituent source file(s)
+	* mgr/fragments/nmake/protos_header: idem
+	* mgr/fragments/buildproto: Introduce rule for prototype file since it may
+	be dependency of current constituent source file(s)
+	* mgr/fragments/nmake/buildproto: idem
+	* mgr/cmt_afs_readonly.sh: Add script to convert CMT setup scripts for
+	deployment on read-only AFS volume
+	
 2012-04-25    <rybkin@lal.in2p3.fr> 487
 
Index: CMT/HEAD/mgr/cmt_afs_readonly.sh
===================================================================
--- CMT/HEAD/mgr/cmt_afs_readonly.sh	(revision 613)
+++ CMT/HEAD/mgr/cmt_afs_readonly.sh	(revision 613)
@@ -0,0 +1,12 @@
+if [ $# -eq 0 ]; then
+  set setup.csh setup.sh
+fi
+
+xs=0
+for f; do
+  grep '/afs/\.' "$f">/dev/null || { [ $? -eq 1 ] || xs=`expr $xs + 1`; continue; }
+  sed 's,/afs/\.,/afs/,g' "$f" >"${f}.new" || { xs=`expr $xs + 1`; continue; }
+  mv -f "${f}.new" "${f}" || { xs=`expr $xs + 1`; continue; }
+done
+
+exit $xs
Index: CMT/HEAD/mgr/fragments/buildproto
===================================================================
--- CMT/HEAD/mgr/fragments/buildproto	(revision 612)
+++ CMT/HEAD/mgr/fragments/buildproto	(revision 613)
@@ -1,8 +1,10 @@
 #-- start of buildproto
 
-$(inc)${NAME}.pp : ${FILEPATH}${FILENAME}
-	$(echo) "Now rebuilding $@"
-	cd $(inc); $(build_prototype) ${FILEPATH}${FILENAME} >/dev/null
-	cat /dev/null >$(inc)${NAME}.pp
+$(inc)${NAME}.pp : $(inc)${NAME}.ph
+	$(silent) cat /dev/null >$@
+
+$(inc)${NAME}.ph : ${FILEPATH}${FILENAME}
+	$(echo) "(${CONSTITUENT}.make) Rebuilding $@"
+	$(silent) cd $(inc) && $(build_prototype) ${FILEPATH}${FILENAME} >/dev/null
 
 #-- end of buildproto
Index: CMT/HEAD/mgr/fragments/nmake/buildproto
===================================================================
--- CMT/HEAD/mgr/fragments/nmake/buildproto	(revision 612)
+++ CMT/HEAD/mgr/fragments/nmake/buildproto	(revision 613)
@@ -1,8 +1,10 @@
 #-- start of buildproto
 
-$(inc)${NAME}.pp : ${FILEPATH}${FILENAME}
-	$(echo) Now rebuilding $@
-	cd $(inc) & $(build_prototype) ${FILEPATH}${FILENAME} >nul
-	type nul >$(inc)${NAME}.pp
+$(inc)${NAME}.pp : $(inc)${NAME}.ph
+	$(silent) type nul >$@
+
+$(inc)${NAME}.ph : ${FILEPATH}${FILENAME}
+	$(echo) (${CONSTITUENT}.nmake) Rebuilding $@
+	$(silent) cd $(inc) && $(build_prototype) ${FILEPATH}${FILENAME} >nul
 
 #-- end of buildproto
Index: CMT/HEAD/mgr/fragments/nmake/protos_header
===================================================================
--- CMT/HEAD/mgr/fragments/nmake/protos_header	(revision 612)
+++ CMT/HEAD/mgr/fragments/nmake/protos_header	(revision 613)
@@ -3,5 +3,6 @@
 ${CONSTITUENT}PROTOS :: ${PROTOSTAMPS}
 	$(echo) "${CONSTITUENT} : Protos ok"
-#	@echo ${CONSTITUENT} : Protos ok
+
+${OBJS} : ${PROTOSTAMPS}
 
 #-- end of protos_header ------
Index: CMT/HEAD/mgr/fragments/protos_header
===================================================================
--- CMT/HEAD/mgr/fragments/protos_header	(revision 612)
+++ CMT/HEAD/mgr/fragments/protos_header	(revision 613)
@@ -1,6 +1,8 @@
 #-- start of protos_header ------
-    
+
 ${CONSTITUENT}PROTOS :: ${PROTOSTAMPS}
 	$(echo) "${CONSTITUENT} : Protos ok"
 
+${OBJS} : ${PROTOSTAMPS}
+
 #-- end of protos_header ------
Index: CMT/HEAD/source/cmt_generators.cxx
===================================================================
--- CMT/HEAD/source/cmt_generators.cxx	(revision 612)
+++ CMT/HEAD/source/cmt_generators.cxx	(revision 613)
@@ -264,5 +264,6 @@
   CmtSystem::basename (m_FILENAME, suffix, m_NAME.value);
 
-  buildproto_fragment.copy (m_output_file, constituent.variables, 3, 
+  buildproto_fragment.copy (m_output_file, constituent.variables, 4,
+			    &m_CONSTITUENT,
                             &m_NAME, 
                             &m_FILEPATH, 
@@ -691,8 +692,9 @@
       if (m_PROTOSTAMPS != "")
         {
-          protos_header_fragment.copy (m_output_file, constituent.variables, 3, 
+          protos_header_fragment.copy (m_output_file, constituent.variables, 4,
 				       &m_CONSTITUENT,
                                        &m_CONSTITUENTSUFFIX,
-                                       &m_PROTOSTAMPS);
+                                       &m_PROTOSTAMPS,
+				       &m_OBJS);
         }
 
