#---*- Makefile -*-------------------------------------------------------------
#$Author: andrius $
#$Revision: 8294 $
#$Date: 2020-08-11 16:00:12 +0300 (Tue, 11 Aug 2020) $
#$URL: svn+ssh://www.crystallography.net/home/coder/svn-repositories/cod-tools/tags/v3.1.0/makefiles/Makefile-subdirs $
#------------------------------------------------------------------------------

MAKECONF_FILES = ${filter-out %~, ${wildcard Makeconf*}}

ifneq ("${MAKECONF_FILES}","")
include ${MAKECONF_FILES}
endif

# A Makeconfig file might contain a line like the following one:
# FIRST = f2mtz/
#
# The recursive Makefile will first descend to directories mentioned
# in ${FIRST}, and then into all the rest alphabetically:

DIRS  = ${FIRST} ${filter-out ${FIRST}, ${dir ${wildcard */[Mm]akefile}}}

.PHONY: all clean cleanAll distclean check install test tests out output outputs

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

all clean cleanAll distclean check install test tests out output outputs listdiff:
	@for d in ${DIRS}; do test -d $$d && ${MAKE} -C $$d $@; done

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

MAKELOCAL_FILES = ${filter-out %~, ${wildcard Makelocal*}}

ifneq ("${MAKELOCAL_FILES}","")
include ${MAKELOCAL_FILES}
endif
