@SET_MAKE@
LN_S=@LN_S@ -f
MKDIR_P=@MKDIR_P@
CC=@CC@
M32=@M32@
PACKAGE=@PACKAGE_TARNAME@
PACKAGE_TARNAME=@PACKAGE_TARNAME@-@PACKAGE_VERSION@
VERSION=@PACKAGE_VERSION@
prefix=@prefix@
exec_prefix=@exec_prefix@
datarootdir=@datarootdir@
bindir=@bindir@
libdir=@libdir@
docdir=@docdir@
includedir=@includedir@
mandir=@mandir@
infodir=@mandir@

plugins = pid ipc alloc dl

default:
	for p in $(plugins); do (cd $$p && $(MAKE)); done

all: default

libs: default

$(plugins):
	cd $@ && $(MAKE)

tidy:
	rm -rf dmtcp-autotest-* ckpt_*_files
	rm -f ckpt_*.dmtcp dmtcp_restart_script* \
	  dmtcp-shared-memory.* dmtcp-test-typescript.tmp core*
	rm -rf ckpt_*

clean: tidy
	for p in $(plugins); do (cd $$p && $(MAKE) clean); done

distclean: clean
	for p in $(plugins); do (cd $$p && $(MAKE) distclean); done
	rm -f Makefile

install-libs: all
	test -e $(DESTDIR)$(libdir) || $(MKDIR_P) $(DESTDIR)$(libdir)
	for p in $(plugins); do (cd $$p && $(MAKE) install-libs); done

install: all
	test -e $(DESTDIR)$(bindir) || $(MKDIR_P) $(DESTDIR)$(bindir)
	test -e $(DESTDIR)$(libdir) || $(MKDIR_P) $(DESTDIR)$(libdir)
	test -e $(DESTDIR)$(includedir) || $(MKDIR_P) $(DESTDIR)$(includedir)
	for p in $(plugins); do (cd $$p && $(MAKE) install); done

uninstall:
	for p in $(plugins); do (cd $$p && $(MAKE) uninstall); done

uninstall-libs:
	for p in $(plugins); do (cd $$p && $(MAKE) uninstall-libs); done

install-exec-hook:
uninstall-hook:

.PHONY: default all pid ipc alloc dl tidy clean distclean install uninstall \
	install-exec-hook uninstall-hook
