#
# Makefile for building all plugins in a predefined set
#
# Copyright (C) 2006 by Ricardo Mones <mones@debian.org>
#
# You are free to distribute this software under the terms of
# the GNU General Public License.
# 

TOBEBUILT := $(shell /bin/bash ./configure --get-plugin-list)

all:
	touch all-mark;
	for plugin in $(TOBEBUILT); \
	do cd $$plugin && \
	   echo "*** Building $$plugin " && \
	   $(MAKE) && \
	   cd .. || break; \
	done && test -f all-mark && rm -f all-mark;

install:
	touch install-mark;
	for plugin in $(TOBEBUILT); \
	do cd $$plugin && \
	   echo "*** Installing $$plugin " && \
	   $(MAKE) install DESTDIR=$(DESTDIR)/$$plugin && \
	   cd .. || break; \
	done && test -f install-mark && rm -f install-mark;

uninstall:
	touch uninstall-mark;
	for plugin in $(TOBEBUILT); \
	do cd $$plugin && \
	   echo "*** Uninstalling $$plugin " && \
	   $(MAKE) uninstall && \
	   cd .. || break; \
	done && test -f uninstall-mark && rm -f uninstall-mark;

clean:
	touch clean-mark;
	for plugin in $(TOBEBUILT); \
	do cd $$plugin && \
	   echo "*** Cleaning $$plugin " && \
	   $(MAKE) clean && \
	   cd .. || break; \
	done && test -f clean-mark && rm -f clean-mark;

distclean:
	touch distclean-mark;
	for plugin in $(TOBEBUILT); \
	do cd $$plugin && \
	   echo "*** Distcleaning $$plugin " && \
	   $(MAKE) distclean && \
	   cd .. || break; \
	done && test -f distclean-mark && rm -f distclean-mark;

.PHONY: all install uninstall clean distclean all-built
