forked from alibaba/tsar
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
64 lines (56 loc) · 1.87 KB
/
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
DIRS = src modules lualib
all:
for i in $(DIRS); do make -C $$i; done
clean:
for i in $(DIRS); do cd $$i;make clean;cd ..; done
install: all
#mkdir for tsar
mkdir -p /usr/local/tsar/modules
mkdir -p /etc/tsar
mkdir -p /usr/local/man/man8/
#copy tsar shared so
cp modules/*.so /usr/local/tsar/modules
#copy bin file
cp src/tsar /usr/bin/tsar
#copy config file
cp conf/tsar.conf /etc/tsar/tsar.conf
cp conf/tsar.logrotate /etc/logrotate.d/tsar
cp conf/tsar.cron /etc/cron.d/tsar
#copy man file
cp conf/tsar.8 /usr/local/man/man8/
#install lualib
make -C lualib install
uninstall:
#rm tsar
rm -rf /usr/local/tsar
rm -rf /etc/tsar/cron.d
rm -f /etc/logrotate.d/tsar
rm -f /etc/cron.d/tsar
rm -f /usr/local/man/man8/tsar.8
#rm tsar
rm -f /usr/bin/tsar
#rm tsardevel
rm -f /usr/bin/tsardevel
#rm tsarluadevel
rm -f /usr/bin/tsarluadevel
#backup configure file
if [ -f /etc/tsar/tsar.conf ]; then mv /etc/tsar/tsar.conf /etc/tsar/tsar.conf.rpmsave; fi
#backup the log data file
if [ -f /var/log/tsar.data ]; then mv /var/log/tsar.data /var/log/tsar.data.bak; fi
tsardevel:
mkdir -p $(DESTDIR)/usr/local/tsar/devel
cp devel/mod_test.c $(DESTDIR)/usr/local/tsar/devel/mod_test.c
cp devel/mod_test.conf $(DESTDIR)/usr/local/tsar/devel/mod_test.conf
cp devel/tsar.h $(DESTDIR)/usr/local/tsar/devel/tsar.h
cp devel/Makefile.test $(DESTDIR)/usr/local/tsar/devel/Makefile.test
cp devel/tsardevel $(DESTDIR)/usr/bin/tsardevel
tsarluadevel:
mkdir -p $(DESTDIR)/usr/local/tsar/luadevel
cp luadevel/mod_lua_test.lua $(DESTDIR)/usr/local/tsar/luadevel/mod_lua_test.lua
cp luadevel/mod_lua_test.conf $(DESTDIR)/usr/local/tsar/luadevel/mod_lua_test.conf
cp luadevel/Makefile.test $(DESTDIR)/usr/local/tsar/luadevel/Makefile.test
cp luadevel/tsarluadevel $(DESTDIR)/usr/bin/tsarluadevel
tags:
ctags -R
cscope -Rbq
.PHONY: all clean install unintall tsardevel tsarluadevel tags