Index: /CMT/HEAD/ChangeLog
===================================================================
--- /CMT/HEAD/ChangeLog	(revision 491)
+++ /CMT/HEAD/ChangeLog	(revision 492)
@@ -1,2 +1,29 @@
+2009-03-15    <rybkin@lal.in2p3.fr> 387
+	
+	* mgr/fragments/constituent: Restore the dependency of
+	$(cmt_local_${CONSTITUENT}_makefile) on $(${CONSTITUENT}_dependencies).
+	For the constituent makefile to be generated properly, the constituent
+	source files have to exist. The latter may be generated as a result of
+	building other constituent(s). Discard the ${CONSTITUENT}clean dependency
+	on $(cmt_local_${CONSTITUENT}_makefile). Make ${CONSTITUENT}uninstall
+	also depend on $(${CONSTITUENT}uninstall_dependencies) and compute the
+	latter to insure that uninstallation be done in reverse build order
+	* mgr/fragments/constituent_lock: idem
+	* mgr/fragments/nmake/constituent:  Restore the dependency of
+	$(cmt_local_${CONSTITUENT}_makefile) on $(${CONSTITUENT}_dependencies) as
+	detailed above. Discard the ${CONSTITUENT}clean dependency
+	on $(cmt_local_${CONSTITUENT}_makefile). Make ${CONSTITUENT}uninstall
+	independent of $(cmt_local_${CONSTITUENT}_makefile) but rather generate the
+	latter in the rule command, if non-existent
+	* mgr/fragments/nmake/constituent_lock:	idem
+	* mgr/fragments/check_application_header: Discard the ${CONSTITUENT}check
+	dependency on $(cmt_local_${CONSTITUENT}_makefile) but rather generate the
+	latter in the rule command, if non-existent
+	* mgr/fragments/nmake/check_application_header: idem
+	* mgr/cmt_lockfile.sh: Use POSIX conformant syntax for the test utility
+	* mgr/fragments/nmake/library: Improve control of NMake verbosity
+	* mgr/fragments/nmake/library_no_share: idem
+	* mgr/fragments/nmake/library_no_static: idem
+	
 2009-02-11    <rybkin@lal.in2p3.fr> 386
 	
Index: /CMT/HEAD/mgr/cmt_lockfile.sh
===================================================================
--- /CMT/HEAD/mgr/cmt_lockfile.sh	(revision 491)
+++ /CMT/HEAD/mgr/cmt_lockfile.sh	(revision 492)
@@ -5,5 +5,5 @@
 # is not installed
 
-if [ "$1" == "" ]; then
+if [ "$1" = "" ]; then
     echo "Usage: cmt_lockfile.sh file" >&2
     exit 1
@@ -19,5 +19,5 @@
     fi
     while :; do
-	[ "$fstype" == afs ] && fs flush -path $dir
+	[ "$fstype" = afs ] && fs flush -path $dir
 	mkdir $1 2>/dev/null && break
 	sleep $secs
Index: /CMT/HEAD/mgr/fragments/check_application_header
===================================================================
--- /CMT/HEAD/mgr/fragments/check_application_header	(revision 491)
+++ /CMT/HEAD/mgr/fragments/check_application_header	(revision 492)
@@ -6,5 +6,9 @@
 
 #${CONSTITUENT}check : ${CONSTITUENT} $(cmt_local_${CONSTITUENT}_makefile)
-${CONSTITUENT}check : $(cmt_local_${CONSTITUENT}_makefile)
+#${CONSTITUENT}check : $(cmt_local_${CONSTITUENT}_makefile)
+${CONSTITUENT}check :
+	@if test ! -f $(cmt_local_${CONSTITUENT}_makefile); then \
+	  $(cmtexe) -tag=$(tags) $(${CONSTITUENT}_extratags) build constituent_makefile -out=$(cmt_local_${CONSTITUENT}_makefile) ${CONSTITUENT}; \
+	fi
 	$(echo) "(constituents.make) Starting $@"
 	@$(MAKE) -f $(cmt_local_${CONSTITUENT}_makefile) $@
Index: /CMT/HEAD/mgr/fragments/constituent
===================================================================
--- /CMT/HEAD/mgr/fragments/constituent	(revision 491)
+++ /CMT/HEAD/mgr/fragments/constituent	(revision 492)
@@ -68,13 +68,13 @@
 makefiles : $(cmt_local_${CONSTITUENT}_makefile)
 
+ifndef QUICK
+$(cmt_local_${CONSTITUENT}_makefile) : $(${CONSTITUENT}_dependencies) $(cmt_local_tagfile_${CONSTITUENT}) build_library_links
+else
 $(cmt_local_${CONSTITUENT}_makefile) : $(cmt_local_tagfile_${CONSTITUENT})
+endif
 	$(echo) "(constituents.make) Building ${CONSTITUENT}.make"; \
 	  $(cmtexe) -tag=$(tags) $(${CONSTITUENT}_extratags) build constituent_makefile -out=$(cmt_local_${CONSTITUENT}_makefile) ${CONSTITUENT}
 
-ifndef QUICK
-${CONSTITUENT} :: $(${CONSTITUENT}_dependencies) $(cmt_local_${CONSTITUENT}_makefile) build_library_links dirs ${CONSTITUENT}dirs
-else
 ${CONSTITUENT} :: $(${CONSTITUENT}_dependencies) $(cmt_local_${CONSTITUENT}_makefile) dirs ${CONSTITUENT}dirs
-endif
 	$(echo) "(constituents.make) Starting ${CONSTITUENT}"
 	@$(MAKE) -f $(cmt_local_${CONSTITUENT}_makefile) ${CONSTITUENT}
@@ -83,11 +83,11 @@
 clean :: ${CONSTITUENT}clean
 
-${CONSTITUENT}clean :: $(${CONSTITUENT}clean_dependencies) $(cmt_local_${CONSTITUENT}_makefile)
+${CONSTITUENT}clean :: $(${CONSTITUENT}clean_dependencies) ##$(cmt_local_${CONSTITUENT}_makefile)
 	$(echo) "(constituents.make) Starting ${CONSTITUENT}clean"
-	@$(MAKE) -f $(cmt_local_${CONSTITUENT}_makefile) ${CONSTITUENT}clean
+	@-if test -f $(cmt_local_${CONSTITUENT}_makefile); then \
+	  $(MAKE) -f $(cmt_local_${CONSTITUENT}_makefile) ${CONSTITUENT}clean; \
+	fi
 	$(echo) "(constituents.make) ${CONSTITUENT}clean done"
-#	@-if test -f $(cmt_local_${CONSTITUENT}_makefile); then \
-#	  $(MAKE) -f $(cmt_local_${CONSTITUENT}_makefile) cmt_lock_pid=$${cmt_lock_pid} ${CONSTITUENT}clean; \
-#	fi
+#	@-$(MAKE) -f $(cmt_local_${CONSTITUENT}_makefile) ${CONSTITUENT}clean
 
 ##	  /bin/rm -f $(cmt_local_${CONSTITUENT}_makefile) $(bin)${CONSTITUENT}_dependencies.make
@@ -102,5 +102,7 @@
 uninstall :: ${CONSTITUENT}uninstall
 
-${CONSTITUENT}uninstall :: $(cmt_local_${CONSTITUENT}_makefile)
+$(foreach d,$(${CONSTITUENT}_dependencies),$(eval $(d)uninstall_dependencies += ${CONSTITUENT}uninstall))
+
+${CONSTITUENT}uninstall :: $(${CONSTITUENT}uninstall_dependencies) $(cmt_local_${CONSTITUENT}_makefile)
 	$(echo) "(constituents.make) Starting uninstall ${CONSTITUENT}"
 	@$(MAKE) -f $(cmt_local_${CONSTITUENT}_makefile) uninstall
Index: /CMT/HEAD/mgr/fragments/constituent_lock
===================================================================
--- /CMT/HEAD/mgr/fragments/constituent_lock	(revision 491)
+++ /CMT/HEAD/mgr/fragments/constituent_lock	(revision 492)
@@ -68,13 +68,13 @@
 makefiles : $(cmt_local_${CONSTITUENT}_makefile)
 
+ifndef QUICK
+$(cmt_local_${CONSTITUENT}_makefile) : $(${CONSTITUENT}_dependencies) $(cmt_local_tagfile_${CONSTITUENT}) build_library_links
+else
 $(cmt_local_${CONSTITUENT}_makefile) : $(cmt_local_tagfile_${CONSTITUENT})
+endif
 	$(echo) "(constituents.make) Building ${CONSTITUENT}.make"; \
 	  $(cmtexe) -tag=$(tags) $(${CONSTITUENT}_extratags) build constituent_makefile -out=$(cmt_local_${CONSTITUENT}_makefile) ${CONSTITUENT}
 
-ifndef QUICK
-${CONSTITUENT} :: $(${CONSTITUENT}_dependencies) $(cmt_local_${CONSTITUENT}_makefile) build_library_links dirs ${CONSTITUENT}dirs
-else
 ${CONSTITUENT} :: $(${CONSTITUENT}_dependencies) $(cmt_local_${CONSTITUENT}_makefile) dirs ${CONSTITUENT}dirs
-endif
 	$(echo) "(constituents.make) Creating ${CONSTITUENT}${lock_suffix} and Starting ${CONSTITUENT}"
 	@${lock_command} ${CONSTITUENT}${lock_suffix} || exit $$?; \
@@ -87,11 +87,11 @@
 clean :: ${CONSTITUENT}clean
 
-${CONSTITUENT}clean :: $(${CONSTITUENT}clean_dependencies) $(cmt_local_${CONSTITUENT}_makefile)
+${CONSTITUENT}clean :: $(${CONSTITUENT}clean_dependencies) ##$(cmt_local_${CONSTITUENT}_makefile)
 	$(echo) "(constituents.make) Starting ${CONSTITUENT}clean"
-	@$(MAKE) -f $(cmt_local_${CONSTITUENT}_makefile) ${CONSTITUENT}clean
+	@-if test -f $(cmt_local_${CONSTITUENT}_makefile); then \
+	  $(MAKE) -f $(cmt_local_${CONSTITUENT}_makefile) ${CONSTITUENT}clean; \
+	fi
 	$(echo) "(constituents.make) ${CONSTITUENT}clean done"
-#	@-if test -f $(cmt_local_${CONSTITUENT}_makefile); then \
-#	  $(MAKE) -f $(cmt_local_${CONSTITUENT}_makefile) cmt_lock_pid=$${cmt_lock_pid} ${CONSTITUENT}clean; \
-#	fi
+#	@-$(MAKE) -f $(cmt_local_${CONSTITUENT}_makefile) ${CONSTITUENT}clean
 
 ##	  /bin/rm -f $(cmt_local_${CONSTITUENT}_makefile) $(bin)${CONSTITUENT}_dependencies.make
@@ -106,5 +106,7 @@
 uninstall :: ${CONSTITUENT}uninstall
 
-${CONSTITUENT}uninstall :: $(cmt_local_${CONSTITUENT}_makefile)
+$(foreach d,$(${CONSTITUENT}_dependencies),$(eval $(d)uninstall_dependencies += ${CONSTITUENT}uninstall))
+
+${CONSTITUENT}uninstall :: $(${CONSTITUENT}uninstall_dependencies) $(cmt_local_${CONSTITUENT}_makefile)
 	$(echo) "(constituents.make) Starting uninstall ${CONSTITUENT}"
 	@$(MAKE) -f $(cmt_local_${CONSTITUENT}_makefile) uninstall
Index: /CMT/HEAD/mgr/fragments/nmake/check_application_header
===================================================================
--- /CMT/HEAD/mgr/fragments/nmake/check_application_header	(revision 491)
+++ /CMT/HEAD/mgr/fragments/nmake/check_application_header	(revision 492)
@@ -6,5 +6,7 @@
 
 #${CONSTITUENT}check : ${CONSTITUENT} $(cmt_local_${CONSTITUENT}_makefile)
-${CONSTITUENT}check : $(cmt_local_${CONSTITUENT}_makefile)
+#${CONSTITUENT}check : $(cmt_local_${CONSTITUENT}_makefile)
+${CONSTITUENT}check :
+	@if not exist $(cmt_local_${CONSTITUENT}_makefile) $(cmtexe) -tag=$(tags) $(${CONSTITUENT}_extratags) build -nmake constituent_makefile -out=$(cmt_local_${CONSTITUENT}_makefile) ${CONSTITUENT}
 	$(echo) "(constituents.nmake) Starting $@"
 	@$(MAKE) /nologo /f $(cmt_local_${CONSTITUENT}_makefile) /$(MAKEFLAGS) bin=$(bin) build_strategy=keep_makefiles $@ tag=$(tag)
Index: /CMT/HEAD/mgr/fragments/nmake/constituent
===================================================================
--- /CMT/HEAD/mgr/fragments/nmake/constituent	(revision 491)
+++ /CMT/HEAD/mgr/fragments/nmake/constituent	(revision 492)
@@ -52,10 +52,9 @@
 !endif
 
-#!if "$(QUICK)" == ""
-#$(cmt_local_${CONSTITUENT}_makefile) :: $(${CONSTITUENT}_dependencies) $(cmt_local_tagfile_${CONSTITUENT}) dirs
-#!else
-#$(cmt_local_${CONSTITUENT}_makefile) :: $(cmt_local_tagfile_${CONSTITUENT})
-#!endif
+!if "$(QUICK)" == ""
+$(cmt_local_${CONSTITUENT}_makefile) : $(${CONSTITUENT}_dependencies) $(cmt_local_tagfile_${CONSTITUENT})
+!else
 $(cmt_local_${CONSTITUENT}_makefile) : $(cmt_local_tagfile_${CONSTITUENT})
+!endif
 	$(echo) (constituents.nmake) Building ${CONSTITUENT}.nmake
 	@set include=$(include)
@@ -85,13 +84,11 @@
 clean :: ${CONSTITUENT}clean
 
-#${CONSTITUENT}clean :: $(${CONSTITUENT}clean_dependencies) ##$(cmt_local_${CONSTITUENT}_makefile)
-${CONSTITUENT}clean :: $(${CONSTITUENT}clean_dependencies) $(cmt_local_${CONSTITUENT}_makefile)
+${CONSTITUENT}clean :: $(${CONSTITUENT}clean_dependencies) ##$(cmt_local_${CONSTITUENT}_makefile)
 	$(echo) (constituents.nmake) Starting ${CONSTITUENT}clean
 	@set include=$(include)
 	@set lib=$(lib)
-	@$(MAKE) /nologo /f $(cmt_local_${CONSTITUENT}_makefile) /$(MAKEFLAGS) bin=$(bin) build_strategy=keep_makefiles ${CONSTITUENT}clean tag=$(tag)
+	@-if exist $(cmt_local_${CONSTITUENT}_makefile) $(MAKE) /nologo /f $(cmt_local_${CONSTITUENT}_makefile) /$(MAKEFLAGS) bin=$(bin) build_strategy=keep_makefiles ${CONSTITUENT}clean tag=$(tag)
 	$(echo) (constituents.nmake) ${CONSTITUENT}clean done
-#	@-if exist $(cmt_local_${CONSTITUENT}_makefile) $(MAKE) /nologo /f $(cmt_local_${CONSTITUENT}_makefile) /$(MAKEFLAGS) bin=$(bin) build_strategy=keep_makefiles ${CONSTITUENT}clean tag=$(tag)
-#	$(echo) (constituents.nmake) ${CONSTITUENT}clean done
+#	@$(MAKE) /nologo /f $(cmt_local_${CONSTITUENT}_makefile) /$(MAKEFLAGS) bin=$(bin) build_strategy=keep_makefiles ${CONSTITUENT}clean tag=$(tag)
 
 install :: ${CONSTITUENT}install
@@ -106,8 +103,10 @@
 uninstall :: ${CONSTITUENT}uninstall
 
-${CONSTITUENT}uninstall :: $(cmt_local_${CONSTITUENT}_makefile)
+#${CONSTITUENT}uninstall :: $(cmt_local_${CONSTITUENT}_makefile)
+${CONSTITUENT}uninstall :: $(cmt_local_tagfile_${CONSTITUENT})
 	$(echo) (constituents.nmake) Starting uninstall ${CONSTITUENT}
 	@set include=$(include)
 	@set lib=$(lib)
+	@if not exist $(cmt_local_${CONSTITUENT}_makefile) $(cmtexe) -tag=$(tags) $(${CONSTITUENT}_extratags) build -nmake constituent_makefile -out=$(cmt_local_${CONSTITUENT}_makefile) ${CONSTITUENT}
 	@-$(MAKE) /nologo /f $(cmt_local_${CONSTITUENT}_makefile) /$(MAKEFLAGS) bin=$(bin) build_strategy=keep_makefiles uninstall tag=$(tag)
 	$(echo) (constituents.nmake) uninstall ${CONSTITUENT} done
Index: /CMT/HEAD/mgr/fragments/nmake/constituent_lock
===================================================================
--- /CMT/HEAD/mgr/fragments/nmake/constituent_lock	(revision 491)
+++ /CMT/HEAD/mgr/fragments/nmake/constituent_lock	(revision 492)
@@ -52,10 +52,9 @@
 !endif
 
-#!if "$(QUICK)" == ""
-#$(cmt_local_${CONSTITUENT}_makefile) :: $(${CONSTITUENT}_dependencies) $(cmt_local_tagfile_${CONSTITUENT}) dirs
-#!else
-#$(cmt_local_${CONSTITUENT}_makefile) :: $(cmt_local_tagfile_${CONSTITUENT})
-#!endif
+!if "$(QUICK)" == ""
+$(cmt_local_${CONSTITUENT}_makefile) : $(${CONSTITUENT}_dependencies) $(cmt_local_tagfile_${CONSTITUENT})
+!else
 $(cmt_local_${CONSTITUENT}_makefile) : $(cmt_local_tagfile_${CONSTITUENT})
+!endif
 	$(echo) (constituents.nmake) Building ${CONSTITUENT}.nmake
 	@set include=$(include)
@@ -89,13 +88,11 @@
 clean :: ${CONSTITUENT}clean
 
-#${CONSTITUENT}clean :: $(${CONSTITUENT}clean_dependencies) ##$(cmt_local_${CONSTITUENT}_makefile)
-${CONSTITUENT}clean :: $(${CONSTITUENT}clean_dependencies) $(cmt_local_${CONSTITUENT}_makefile)
+${CONSTITUENT}clean :: $(${CONSTITUENT}clean_dependencies) ##$(cmt_local_${CONSTITUENT}_makefile)
 	$(echo) (constituents.nmake) Starting ${CONSTITUENT}clean
 	@set include=$(include)
 	@set lib=$(lib)
-	@$(MAKE) /nologo /f $(cmt_local_${CONSTITUENT}_makefile) /$(MAKEFLAGS) bin=$(bin) build_strategy=keep_makefiles ${CONSTITUENT}clean tag=$(tag)
+	@-if exist $(cmt_local_${CONSTITUENT}_makefile) $(MAKE) /nologo /f $(cmt_local_${CONSTITUENT}_makefile) /$(MAKEFLAGS) bin=$(bin) build_strategy=keep_makefiles ${CONSTITUENT}clean tag=$(tag)
 	$(echo) (constituents.nmake) ${CONSTITUENT}clean done
-#	@-if exist $(cmt_local_${CONSTITUENT}_makefile) $(MAKE) /nologo /f $(cmt_local_${CONSTITUENT}_makefile) /$(MAKEFLAGS) bin=$(bin) build_strategy=keep_makefiles ${CONSTITUENT}clean tag=$(tag)
-#	$(echo) (constituents.nmake) ${CONSTITUENT}clean done
+#	@$(MAKE) /nologo /f $(cmt_local_${CONSTITUENT}_makefile) /$(MAKEFLAGS) bin=$(bin) build_strategy=keep_makefiles ${CONSTITUENT}clean tag=$(tag)
 
 install :: ${CONSTITUENT}install
@@ -110,8 +107,10 @@
 uninstall :: ${CONSTITUENT}uninstall
 
-${CONSTITUENT}uninstall :: $(cmt_local_${CONSTITUENT}_makefile)
+#${CONSTITUENT}uninstall :: $(cmt_local_${CONSTITUENT}_makefile)
+${CONSTITUENT}uninstall :: $(cmt_local_tagfile_${CONSTITUENT})
 	$(echo) (constituents.nmake) Starting uninstall ${CONSTITUENT}
 	@set include=$(include)
 	@set lib=$(lib)
+	@if not exist $(cmt_local_${CONSTITUENT}_makefile) $(cmtexe) -tag=$(tags) $(${CONSTITUENT}_extratags) build -nmake constituent_makefile -out=$(cmt_local_${CONSTITUENT}_makefile) ${CONSTITUENT}
 	@-$(MAKE) /nologo /f $(cmt_local_${CONSTITUENT}_makefile) /$(MAKEFLAGS) bin=$(bin) build_strategy=keep_makefiles uninstall tag=$(tag)
 	$(echo) (constituents.nmake) uninstall ${CONSTITUENT} done
Index: /CMT/HEAD/mgr/fragments/nmake/library
===================================================================
--- /CMT/HEAD/mgr/fragments/nmake/library	(revision 491)
+++ /CMT/HEAD/mgr/fragments/nmake/library	(revision 492)
@@ -18,5 +18,5 @@
 ${CONSTITUENT}clean ::
 	$(cleanup_echo) #objects
-	$(cleanup_silent) for %f in (${OBJS}) do if exist %f del %f
+	$(cleanup_silent) for %f in (${OBJS}) do $(cleanup_silent)if exist %f del %f
 	$(cleanup_silent) if exist $(bin)${CONSTITUENT}.arc del $(bin)${CONSTITUENT}.arc
 	$(cleanup_silent) if exist $(bin)${CONSTITUENT}.lib del $(bin)${CONSTITUENT}.lib
Index: /CMT/HEAD/mgr/fragments/nmake/library_no_share
===================================================================
--- /CMT/HEAD/mgr/fragments/nmake/library_no_share	(revision 491)
+++ /CMT/HEAD/mgr/fragments/nmake/library_no_share	(revision 492)
@@ -13,5 +13,5 @@
 ${CONSTITUENT}clean ::
 	$(cleanup_echo) #objects
-	$(cleanup_silent) for %f in (${OBJS}) do if exist %f del %f
+	$(cleanup_silent) for %f in (${OBJS}) do $(cleanup_silent)if exist %f del %f
 	$(cleanup_silent) if exist $(${CONSTITUENT}lib) del $(${CONSTITUENT}lib)
 
Index: /CMT/HEAD/mgr/fragments/nmake/library_no_static
===================================================================
--- /CMT/HEAD/mgr/fragments/nmake/library_no_static	(revision 491)
+++ /CMT/HEAD/mgr/fragments/nmake/library_no_static	(revision 492)
@@ -36,5 +36,5 @@
 ${CONSTITUENT}clean ::
 	$(cleanup_echo) #objects
-	$(cleanup_silent) for %f in (${OBJS}) do if exist %f del %f
+	$(cleanup_silent) for %f in (${OBJS}) do $(cleanup_silent)if exist %f del %f
 	$(cleanup_silent) if exist $(bin)${CONSTITUENT}.arc del $(bin)${CONSTITUENT}.arc
 	$(cleanup_silent) if exist $(bin)${CONSTITUENT}.lib del $(bin)${CONSTITUENT}.lib
