#-- start of application

$(bin)${CONSTITUENT}${application_suffix} :: ${OBJS} $(use_stamps) $(${CONSTITUENT}stamps) requirements $(use_requirements)
	@if test "${PRINT_PREREQUISITES}" = "1"; then \
		echo "------> Triggering dependencies: $?"; \
	fi	
	$(link_echo) $@
	$(link_silent) cd $(bin); ${LINKMACRO} -o ${CONSTITUENT}.exe.new ${OBJS} $(use_linkopts) $(${CONSTITUENT}linkopts); mv -f ${CONSTITUENT}.exe.new ${CONSTITUENT}${application_suffix}

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

install_dir = ${CMTINSTALLAREA}/$(tag)/bin
${CONSTITUENT}installname = ${CONSTITUENT}${application_suffix}

${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 ::
	@echo "------> (${CONSTITUENT}.make) Removing installed files"
	@if test ! "${CMTINSTALLAREA}" = ""; then \
	  $(cmt_uninstall_action) \
	    -source "`(cd $(bin); pwd)`" \
	    -name "$(${CONSTITUENT}installname)" \
	    -out "$(install_dir)" \
	    -cmtpath "$($(package)_cmtpath)"; \
	fi

#-- end of application
