scripts-targets.mk: Add support for perl scripts and assuming scripts without suffix to be shell scripts

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2014-04-24 19:13:43 +00:00
commit 34f4bb0e6d

View file

@ -9,13 +9,24 @@ install: install-home-bin
endif
HOME_BIN_EXE_SH = $(addprefix $(HOME)/bin/, $(notdir $(EXE_SH)))
$(HOME)/bin/%.py: %.py
echo -e "#!/bin/sh\nexec /usr/bin/python $(shell pwd)/$<" '"$$@"' > $@.tmp
chmod 755 $@.tmp
mv $@.tmp $@
$(HOME)/bin/%.pl: %.pl
echo -e "#!/bin/sh\nexec /usr/bin/perl $(shell pwd)/$<" '"$$@"' > $@.tmp
chmod 755 $@.tmp
mv $@.tmp $@
$(HOME)/bin/%.sh: %.sh
echo -e "#!/bin/sh\n. $(shell pwd)/$<" '"$$@"' > $@.tmp
chmod 755 $@.tmp
mv $@.tmp $@
$(HOME)/bin/%.py: %.py
echo -e "#!/bin/sh\nexec /usr/bin/python $(shell pwd)/$<" '"$$@"' > $@.tmp
$(HOME)/bin/%: %
echo -e "#!/bin/sh\n. $(shell pwd)/$<" '"$$@"' > $@.tmp
chmod 755 $@.tmp
mv $@.tmp $@