aboutsummaryrefslogtreecommitdiff
path: root/makefile
diff options
context:
space:
mode:
Diffstat (limited to 'makefile')
-rw-r--r--makefile8
1 files changed, 6 insertions, 2 deletions
diff --git a/makefile b/makefile
index c033c8a..e2898cb 100644
--- a/makefile
+++ b/makefile
@@ -22,8 +22,12 @@ mrpropest: mrproper
cp ./todo /usr/bin/
install: todo
- [ -e /usr/bin/todo ] && sudo cp todo /usr/bin/todo
- echo 'Installation success'
+ @if [ `id -u` == "0" ] ; then cp -f todo /usr/bin/todo ; else \
+ if which sudo > /dev/null ; then sudo cp -f todo /usr/bin/todo ; else \
+ @echo must be run by superuser ;\
+ fi \
+ fi
+ @echo 'Installation success'
uninstall: /usr/bin/todo
rm /usr/bin/todo