jw-pkg/make/py-run.mk
Jan Lindemann f9193c989d py-run.mk: Add target run.sh
Allow creation of a run.sh script, to be used from outside the make context.

Signed-off-by: Jan Lindemann <jan@janware.com>
2024-12-03 12:26:33 +00:00

23 lines
480 B
Makefile

include $(JWBDIR)/make/defs.mk
include $(JWBDIR)/make/py-defs.mk
#include $(JWBDIR)/make/scripts-targets.mk
#include $(JWBDIR)/make/rules.mk
EXE ?= $(firstword $(wildcard main.py runme.py test.py *.py))
EXE_ARGS ?=
all:
install:
clean:
distclean:
run:
$(PYTHON) $(EXE) $(EXE_ARGS)
run.sh:
echo -e "#!/bin/bash\n\nexport PYTHONPATH=$(PYTHONPATH)\nset -x\nexec $(PYTHON) $(EXE)" '"$$*"' > $@.tmp
chmod 755 $@.tmp
mv $@.tmp $@
clean-run-sh:
rm -f run.sh
clean: clean-run-sh