aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlessandro Iezzi <aiezzi@alessandroiezzi.it>2022-05-11 17:40:50 +0200
committerAlessandro Iezzi <aiezzi@alessandroiezzi.it>2022-05-11 17:40:50 +0200
commit1762fcf59b8a698e457e81b4e6cd73b8295fce2d (patch)
tree3ff134c0b5183ad992246d2b5e10582f109dba2d
parentfc59e926b33c1bad05b58c7fff4f2822ac071c96 (diff)
downloadhyde-1762fcf59b8a698e457e81b4e6cd73b8295fce2d.tar.gz
hyde-1762fcf59b8a698e457e81b4e6cd73b8295fce2d.zip
Add `install` and `clean` targets to Makefile
-rw-r--r--Makefile21
1 files changed, 21 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index cc6b04f..2465232 100644
--- a/Makefile
+++ b/Makefile
@@ -1,2 +1,23 @@
+#PREFIX = /usr/local
+PREFIX = ~
+
+APPNAME = hyde
+INSTALLDIR = ${PREFIX}/hyde
+BINDIR = ${PREFIX}/bin
+
+SOURCES != find * -type f -name "*.rb"
+
+install:
+ mkdir -p ${INSTALLDIR}
+ chmod +x ${APPNAME}
+ cp -f ${SOURCES} ${INSTALLDIR}/
+ cp -f ${APPNAME} ${BINDIR}/
+ sed -i '' "s|%INSTALLDIR%|${INSTALLDIR}|" ${BINDIR}/${APPNAME}
+ sed -i '' "s|%APPNAME%|${APPNAME}.rb|" ${BINDIR}/${APPNAME}
+
+clean:
+ rm -rf ${INSTALLDIR}
+ rm -f ${BINDIR}/${APPNAME}
+
~/bin/hyde: hyde.rb
cp ${.ALLSRC} ${.TARGET}