aboutsummaryrefslogtreecommitdiff
path: root/makefile
blob: 4cb9ec91fce567571ffa287a74b61cda5ec6c4cc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
all: todo

todo: todo.o
	g++ todo.o -o todo

todo.o: todo.cpp
	g++ -std=c++11  -c todo.cpp -o todo.o

.PHONY: clean mrproper

clean:
	rm *.o
	rm todo

mrproper: clean
	rm todo

mrpropest: mrproper
	rm .todo.txt

/usr/bin/todo: todo
	cp ./todo /usr/bin/

install: todo
	@if [ `id -u` == "0" ] ; then cp -f todo /usr/bin/todo ; else \
		if which sudo 1> /dev/null  2> /dev/null ; then sudo cp -f todo /usr/bin/todo ; else \
			echo must be run by superuser ;\
			false ;\
		fi \
	fi
	@echo 'Installation success'

uninstall: /usr/bin/todo
	rm /usr/bin/todo