-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
32 lines (28 loc) · 813 Bytes
/
Makefile
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
# Simple install file for MyLog
#
NAME = mylog
PREFIX = ~/bin
INSTALL = $(PREFIX)/$(NAME)
LOGDIR = ~/.local/share/$(NAME)
LOGFILE = $(LOGDIR)/$(NAME)
install: mylog
@-printf 'Installing MyLog as $(INSTALL)\n'
@-cp mylog /tmp/mylog
@-sed -i "/MYLOG=/c\MYLOG=$(LOGFILE)" /tmp/mylog
@-install -cDm 750 /tmp/mylog $(INSTALL)
@-rm -f /tmp/mylog
@-printf 'Creating the symlinks\n'
@-ln -sf $(INSTALL) $(PREFIX)/myview
@-ln -sf $(INSTALL) $(PREFIX)/mysearch
@-printf 'Creating the log file\n'
@-mkdir -pm 764 $(LOGDIR)
@-touch $(LOGFILE)
@-printf '\nYou are now ready to use MyLog. Please enjoy.\n'
@-exit 0
update:
@-printf 'Updating MyLog as $(INSTALL)\n'
@-cp mylog /tmp/mylog
@-sed -i "/MYLOG=/c\MYLOG=$(LOGFILE)" /tmp/mylog
@-install -c /tmp/mylog $(INSTALL)
@-rm -f /tmp/mylog
@-exit 0