forked from Atoptool/atop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
97 lines (89 loc) · 3.68 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# Makefile for System & Process Monitor ATOP (Linux version)
#
# Gerlof Langeveld - [email protected]
#
DESTDIR =
BINPATH = /usr/bin
SCRPATH = /etc/atop
LOGPATH = /var/log/atop
MAN1PATH = /usr/share/man/man1
MAN5PATH = /usr/share/man/man5
INIPATH = /etc/rc.d/init.d
CRNPATH = /etc/cron.d
ROTPATH = /etc/logrotate.d
PMPATH1 = /usr/lib/pm-utils/sleep.d
PMPATH2 = /usr/lib64/pm-utils/sleep.d
CFLAGS += -O2 -I. -Wall # -DHTTPSTATS
LDFLAGS += -lncurses -lm -lz
OBJMOD0 = version.o
OBJMOD1 = various.o deviate.o procdbase.o
OBJMOD2 = acctproc.o photoproc.o photosyst.o rawlog.o ifprop.o parseable.o
OBJMOD3 = showgeneric.o showlinux.o showsys.o showprocs.o
OBJMOD4 = atopsar.o
ALLMODS = $(OBJMOD0) $(OBJMOD1) $(OBJMOD2) $(OBJMOD3) $(OBJMOD4)
VERS = $(shell ./atop -V 2>/dev/null| sed -e 's/^[^ ]* //' -e 's/ .*//')
all: atop
atop: atop.o $(ALLMODS) Makefile
$(CC) atop.o $(ALLMODS) -o atop $(LDFLAGS)
clean:
rm -f *.o
install: atop
if [ ! -d $(DESTDIR)$(LOGPATH) ]; \
then mkdir -p $(DESTDIR)$(LOGPATH); fi
if [ ! -d $(DESTDIR)$(BINPATH) ]; \
then mkdir -p $(DESTDIR)$(BINPATH); fi
if [ ! -d $(DESTDIR)$(SCRPATH) ]; \
then mkdir -p $(DESTDIR)$(SCRPATH); fi
if [ ! -d $(DESTDIR)$(MAN1PATH) ]; \
then mkdir -p $(DESTDIR)$(MAN1PATH); fi
if [ ! -d $(DESTDIR)$(MAN5PATH) ]; \
then mkdir -p $(DESTDIR)$(MAN5PATH); fi
if [ ! -d $(DESTDIR)$(INIPATH) ]; \
then mkdir -p $(DESTDIR)$(INIPATH); fi
if [ ! -d $(DESTDIR)$(CRNPATH) ]; \
then mkdir -p $(DESTDIR)$(CRNPATH); fi
if [ ! -d $(DESTDIR)$(ROTPATH) ]; \
then mkdir -p $(DESTDIR)$(ROTPATH); fi
if [ -d $(DESTDIR)$(PMPATH1) ]; \
then cp 45atoppm $(DESTDIR)$(PMPATH1); \
chmod 0711 $(DESTDIR)$(PMPATH1)/45atoppm; fi
if [ -d $(DESTDIR)$(PMPATH2) ]; \
then cp 45atoppm $(DESTDIR)$(PMPATH2); \
chmod 0711 $(DESTDIR)$(PMPATH2)/45atoppm; fi
#
cp atop $(DESTDIR)$(BINPATH)/atop
chown root $(DESTDIR)$(BINPATH)/atop
chmod 04711 $(DESTDIR)$(BINPATH)/atop
ln -sf atop $(DESTDIR)$(BINPATH)/atopsar
cp atop $(DESTDIR)$(BINPATH)/atop-$(VERS)
ln -sf atop-$(VERS) $(DESTDIR)$(BINPATH)/atopsar-$(VERS)
cp atop.daily $(DESTDIR)$(SCRPATH)
chmod 0711 $(DESTDIR)$(SCRPATH)/atop.daily
cp man/atop.1 $(DESTDIR)$(MAN1PATH)
cp man/atopsar.1 $(DESTDIR)$(MAN1PATH)
cp man/atoprc.5 $(DESTDIR)$(MAN5PATH)
cp atop.init $(DESTDIR)$(INIPATH)/atop
cp atop.cron $(DESTDIR)$(CRNPATH)/atop
cp psaccs_atop $(DESTDIR)$(ROTPATH)/psaccs_atop
cp psaccu_atop $(DESTDIR)$(ROTPATH)/psaccu_atop
touch $(DESTDIR)$(LOGPATH)/dummy_before
touch $(DESTDIR)$(LOGPATH)/dummy_after
if [ -z "$(DESTDIR)" ]; then /sbin/chkconfig --add atop; fi
distr: rm -f *.o
tar czvf /tmp/atop.tar.gz *
##########################################################################
atop.o: atop.h photoproc.h photosyst.h acctproc.h showgeneric.h
atopsar.o: atop.h photoproc.h photosyst.h
rawlog.o: atop.h photoproc.h photosyst.h showgeneric.h
various.o: atop.h acctproc.h
ifprop.o: atop.h photosyst.h ifprop.h
parseable.o: atop.h photoproc.h photosyst.h parseable.h
deviate.o: atop.h photoproc.h photosyst.h
procdbase.o: atop.h photoproc.h
acctproc.o: atop.h photoproc.h acctproc.h
photoproc.o: atop.h photoproc.h
photosyst.o: atop.h photosyst.h
showgeneric.o: atop.h photoproc.h photosyst.h showgeneric.h showlinux.h
showlinux.o: atop.h photoproc.h photosyst.h showgeneric.h showlinux.h
showsys.o: atop.h photoproc.h photosyst.h showgeneric.h
showprocs.o: atop.h photoproc.h photosyst.h showgeneric.h showlinux.h