LIB = ../../../lib/
BIN = ../../../bin/

PERL = perl -I$(LIB)
PERLC = $(PERL) -c -w

LS = ls
MAKE = make
RM = rm -fv
SED = sed
XARGS = xargs

MKPLUGIN2_PL = $(BIN)mkplugin2.pl
MKPLUGIN2 = $(PERL) $(MKPLUGIN2_PL)

all:
	$(LS) *.wp2 | $(SED) s/\.wp2/.pm/ | $(XARGS) $(MAKE)

%.pm: %.wp2 $(MKPLUGIN2_PL)
	$(MKPLUGIN2) $< > $@
	$(PERLC) $@

clean:
	$(RM) *.pm
	$(RM) *~ *.BAK .*~ .*.BAK

distclean: clean

