From 34f4bb0e6ddbf1fb20c2a1b108e8ad8c166dbba8 Mon Sep 17 00:00:00 2001 From: Jan Lindemann Date: Thu, 24 Apr 2014 19:13:43 +0000 Subject: [PATCH] scripts-targets.mk: Add support for perl scripts and assuming scripts without suffix to be shell scripts Signed-off-by: Jan Lindemann --- make/scripts-targets.mk | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/make/scripts-targets.mk b/make/scripts-targets.mk index c0e31fc6..8512c7c6 100644 --- a/make/scripts-targets.mk +++ b/make/scripts-targets.mk @@ -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 $@