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

RUN_COMS   = ${wildcard run/*.com}
RUN_NAMES  = ${notdir ${RUN_COMS}}
RUN_LOGS   = ${RUN_COMS:%.com=%.log}
RUN_DEPEND = ${RUN_NAMES:%.com=.%.d}

include ${RUN_DEPEND}

.PHONY: all

all: ${RUN_LOGS}

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

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

.PHONY: cleanlocal clean cleanAll distclean

cleanlocal:
	rm -f ${RUN_LOGS}

clean: cleanlocal

cleanAll distclean: ${addprefix clean, ${RUN_NAMES:%.com=%}}
