SRC=README makefile Makefile TEMPLATE.c.m TEMPLATE.h.m

all:	nondebug debug

nondebug:
	make nondebug-files
	rm -f TEMPLATE.[hc]
	ln -s TEMPLATE-nondebug.c TEMPLATE.c
	ln -s TEMPLATE-nondebug.h TEMPLATE.h

debug:
	make debug-files
	rm -f TEMPLATE.[hc]
	ln -s TEMPLATE-debug.c TEMPLATE.c
	ln -s TEMPLATE-debug.h TEMPLATE.h

all-files:	debug-files nondebug-files

nondebug-files:	TEMPLATE-nondebug.c TEMPLATE-nondebug.h

TEMPLATE-nondebug.c:	TEMPLATE.c.m
	rm -f TEMPLATE.c
	../bin/mkplugin.pl TEMPLATE.c
	mv TEMPLATE.c TEMPLATE-nondebug.c

TEMPLATE-nondebug.h:	TEMPLATE.h.m
	rm -f TEMPLATE.h
	../bin/mkplugin.pl TEMPLATE.h
	mv TEMPLATE.h TEMPLATE-nondebug.h

debug-files:	TEMPLATE-debug.c TEMPLATE-debug.h

TEMPLATE-debug.c:	TEMPLATE.c.m
	rm -f TEMPLATE.c
	../bin/mkplugin.pl TEMPLATE.c debug
	mv TEMPLATE.c TEMPLATE-debug.c

TEMPLATE-debug.h:	TEMPLATE.h.m
	rm -f TEMPLATE.h
	../bin/mkplugin.pl TEMPLATE.h debug
	mv TEMPLATE.h TEMPLATE-debug.h

tar:
	tar cf TEMPLATE.tar ${SRC}

