# @configure_input@
# we want to ignore the --datarootdir setting, whatever that means, so here we we mention it: @datarootdir@
VPATH = @srcdir@
include ../include/config.Makefile
all: initialize-in-subdirs @pre_docdir@/COPYING-GPL-2 @pre_docdir@/COPYING-GPL-3 @pre_docdir@/README @pre_docdir@/LAYOUT
$(foreach d,d e,							\
	$(eval initialize-in-$d:; $$(MAKE) -C $d initialize DEPENDS=no)	\
	$(eval .PHONY initialize-in-subdirs:initialize-in-$d)		\
	$(eval .PHONY: initialize-in-subdirs))
SUBDIRS = compat util probe regex c 
ifeq "@DUMPDATA@" "yes"
SUBDIRS += dumpdata
endif
SUBDIRS += e-includes d e bin packages/Macaulay2Doc/basictests m2 emacs man packages html-check-links tests
SUBDIRS += book
SUBDIRS += packages/Macaulay2Doc/test

define do-in-subdirs
$(foreach d,$(SUBDIRS),
	$(eval .PHONY: $1-in-subdirs)
	$(eval .PHONY $1 $1-in-subdirs:$1-in-$d)
	$(eval $1-in-$d:; $$(MAKE) -C $d $1 $2))
endef
$(foreach t,all check,				\
	$(eval $(call do-in-subdirs,$t)))
$(foreach t,clean distclean,				\
	$(eval $(call do-in-subdirs,$t,DEPENDS=no)))
@pre_docdir@:; $(MKDIR_P) "$@"
@pre_docdir@/% : % | @pre_docdir@ ; @INSTALL_DATA@ $< "$@"
Makefile: Makefile.in; cd ..; ./config.status Macaulay2/Makefile
unmark-packages:; $(MAKE) -C packages $@
clean:; rm -f gmon.out
distclean:; rm -f Makefile
# Local Variables:
# compile-command: "make -C $M2BUILDDIR/Macaulay2 "
# End:
