#-- start of library_no_share ------

${CONSTITUENT}LIB :: $(${CONSTITUENT}lib)
	@/bin/echo ${CONSTITUENT} : library ok

$(${CONSTITUENT}lib) :: ${OBJS}
	$(lib_echo) library
	$(lib_silent) cd $(bin); \
	  $(ar) $(${CONSTITUENT}lib) $?
	$(lib_silent) $(ranlib) $(${CONSTITUENT}lib)
	$(lib_silent) cat /dev/null >$(${CONSTITUENT}stamp)

#------------------------------------------------------------------
#  Future improvement? to empty the object files after
#  storing in the library
#
##	  for f in $?; do \
##	    rm $${f}; touch $${f}; \
##	  done
#------------------------------------------------------------------

#-----------------------------------------------------------------
#
#  New section for automatic installation
#
#-----------------------------------------------------------------

install_dir = ${CMTINSTALLAREA}/$(tag)/lib
${CONSTITUENT}installname = $(library_prefix)${CONSTITUENT}$(library_suffix).a

${CONSTITUENT} :: ${CONSTITUENT}install

install :: ${CONSTITUENT}install

${CONSTITUENT}install :: $(install_dir)/$(${CONSTITUENT}installname)
	@if test ! "${CMTINSTALLAREA}" = ""; then\
	  echo "installation done"; \
	fi

$(install_dir)/$(${CONSTITUENT}installname) :: $(bin)$(${CONSTITUENT}installname)
	@if test ! "${CMTINSTALLAREA}" = ""; then \
	  $(cmt_install_action) \
	    -source "`(cd $(bin); pwd)`" \
	    -name "$(${CONSTITUENT}installname)" \
	    -out "$(install_dir)" \
	    -cmd "$(cmt_installarea_command)" \
	    -cmtpath "$($(package)_cmtpath)" ; \
	fi

##${CONSTITUENT}clean :: ${CONSTITUENT}uninstall

uninstall :: ${CONSTITUENT}uninstall

${CONSTITUENT}uninstall ::
	@if test ! "${CMTINSTALLAREA}" = ""; then \
	  $(cmt_uninstall_action) \
	    -source "`(cd $(bin); pwd)`" \
	    -name "$(${CONSTITUENT}installname)" \
	    -out "$(install_dir)" \
	    -cmtpath "$($(package)_cmtpath)" ; \
	fi

${CONSTITUENT}clean ::
	$(cleanup_echo) ${OBJS}
	$(cleanup_silent) cd $(bin); /bin/rm -f ${OBJS}

#-- end of library_no_share ------
