#---*- Makefile -*-------------------------------------------------------
#$Author: saulius $
#$Date: 2020-11-10 06:32:23 +0000 (Tue, 10 Nov 2020) $
#$Revision: 261 $
#$URL: svn+ssh://saulius-grazulis.lt/home/saulius/svn-repositories/makefiles/run_coms/Makelocal-run_coms $
#------------------------------------------------------------------------

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

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

.PHONY: all run clean cleanAll distclean

all: run

include ${DEPEND}

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

run: ${LOGS}

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

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

.%.d: %.com
	date +"# %F %T %Z" > $@
	mkcomdepend $< >> $@

%: %.log;

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

.PHONY: clean-run-coms cleanAll-run-coms distclean-run-coms

clean-run-coms:
	rm -f ${LOGS}

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

.PHONY: clean distclean cleanAll

clean: clean-run-coms

distclean: distclean-run-coms

cleanAll: cleanAll-run-coms
