File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,3 +4,4 @@ tinyutils*.zip
44tinyutils * .tar.gz
55* .swp
66linkscript.sh
7+ copyscript.sh
Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ UTILS = boolify \
3030 table
3131
3232LINKSCRIPT = linkscript.sh
33+ COPYSCRIPT = copyscript.sh
3334SCRIPTDIR = $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST ) ) ) )
3435
3536TESTDIR = tests
@@ -51,6 +52,19 @@ linkscript: $(UTILS)
5152 @chmod +x $(LINKSCRIPT )
5253 @echo " $( LINKSCRIPT) created, run it to create symbolic links to tinyutils in current directory"
5354
55+ copyscript : $(UTILS )
56+ @echo " #!/bin/sh" > $(COPYSCRIPT )
57+ @echo " SCRIPTDIR=$( SCRIPTDIR) " >> $(COPYSCRIPT )
58+ @echo " for util in $( UTILS) ; do" >> $(COPYSCRIPT )
59+ @echo " if [ ! -e \$ $util ] ; then" >> $(COPYSCRIPT )
60+ @echo " cp -pv $( SCRIPTDIR) /\$ $util \$ $util " >> $(COPYSCRIPT )
61+ @echo " else" >> $(COPYSCRIPT )
62+ @echo " echo Not copying \$ $util : file exists" >> $(COPYSCRIPT )
63+ @echo " fi" >> $(COPYSCRIPT )
64+ @echo " done" >> $(COPYSCRIPT )
65+ @chmod +x $(COPYSCRIPT )
66+ @echo " $( COPYSCRIPT) created, run it to copy tinyutils to current directory"
67+
5468all : test $(ZIPFILE ) $(TARBALL )
5569
5670zipfile : $(UTILS ) $(TESTDIR ) Makefile README.md
You can’t perform that action at this time.
0 commit comments