#============================================================================
# perl_prog.mk
#
# "compile" *.pl files to *.

PERL_PROG_MK =

# Prerequisites:
PERL_COMPILE_MK +=
INST_VARS_MK += 

#----------------------------------------

# "compilation" rule. add "./" to path if $@ has no directory. workaround
# for bug in FindBin which doesn't handle bare filenames correctly,
# even if they are executables
SUFFIXES += .pl
.pl :
	p="$@"; $(mst__mkdir_p)
	cp $< $@
	chmod +x $@
	p="$@"; pp="$@" ; f=$(strip_dir); \
	test "$$p" = "$$f" && pp="./$$pp" ; \
	$(PERL_COMPILE) $$pp || { rm $@; false ; }
