#---*- Makefile -*-------------------------------------------------------
#$Author: saulius $
#$Date: 2019-03-07 15:48:47 +0000 (Thu, 07 Mar 2019) $
#$Revision: 190 $
#$URL: svn+ssh://saulius-grazulis.lt/home/saulius/svn-repositories/makefiles/run_coms_set_tt/Makelocal-run_coms_set_tt $
#------------------------------------------------------------------------

COMS   = ${wildcard *.com}
LOGS   = ${COMS:%.com=%.log}
DEPEND = ${COMS:%.com=.%.d}

TT_LOG = .svn-set-text-time.log
EXISTING_TT_LOG = ${filter-out %~, ${wildcard ${TT_LOG}*}}

#------------------------------------------------------------------------------

.PHONY: all run clean cleanAll distclean import

all: run

#------------------------------------------------------------------------------

include ${DEPEND}

run: ${LOGS} ${EXISTING_TT_LOG}

ttlog: ${TT_LOG}

#------------------------------------------------------------------------------

${TT_LOG}: ${LOGS}
	svn-set-text-time > $@; true

%.log: %.com
	./$< 2>&1 | tee $@

.%.d: %.com
	mkcomdepend $< > $@

%: %.log;

#------------------------------------------------------------------------------

clean:
	rm -f ${LOGS}

cleanAll distclean: clean
	rm -f ${DEPEND}
	rm -f ${CLEAN_FILES}
	rm -f ${CLEAN_DIRS:%=%/*}
