"Fossies" - the Fresh Open Source Software Archive

Member "atop-2.8.1/Makefile" (7 Jan 2023, 7449 Bytes) of package /linux/misc/atop-2.8.1.tar.gz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the last Fossies "Diffs" side-by-side code changes report for "Makefile": 2.7.1_vs_2.8.0.

    1 # Makefile for System & Process Monitor ATOP (Linux version)
    2 #
    3 # Gerlof Langeveld - gerlof.langeveld@atoptool.nl
    4 #
    5 DESTDIR  =
    6 
    7 BINPATH  = /usr/bin
    8 SBINPATH = /usr/sbin
    9 SCRPATH  = /usr/share/atop
   10 LOGPATH  = /var/log/atop
   11 MAN1PATH = /usr/share/man/man1
   12 MAN5PATH = /usr/share/man/man5
   13 MAN8PATH = /usr/share/man/man8
   14 INIPATH  = /etc/init.d
   15 DEFPATH  = /etc/default
   16 SYSDPATH = /lib/systemd/system
   17 CRNPATH  = /etc/cron.d
   18 ROTPATH  = /etc/logrotate.d
   19 PMPATH1  = /usr/lib/pm-utils/sleep.d
   20 PMPATH2  = /usr/lib64/pm-utils/sleep.d
   21 PMPATHD  = /usr/lib/systemd/system-sleep
   22 
   23 CFLAGS  += -O2 -I. -Wall -Wno-stringop-truncation # -DNOPERFEVENT   # -DHTTPSTATS
   24 OBJMOD0  = version.o
   25 OBJMOD1  = various.o  deviate.o   procdbase.o
   26 OBJMOD2  = acctproc.o photoproc.o photosyst.o  rawlog.o ifprop.o parseable.o
   27 OBJMOD3  = showgeneric.o          showlinux.o  showsys.o showprocs.o
   28 OBJMOD4  = atopsar.o  netatopif.o gpucom.o     json.o
   29 ALLMODS  = $(OBJMOD0) $(OBJMOD1) $(OBJMOD2) $(OBJMOD3) $(OBJMOD4)
   30 
   31 VERS     = $(shell ./atop -V 2>/dev/null| sed -e 's/^[^ ]* //' -e 's/ .*//')
   32 
   33 all: 		atop atopsar atopacctd atopconvert atopcat
   34 
   35 atop:		atop.o    $(ALLMODS) Makefile
   36 		$(CC) atop.o $(ALLMODS) -o atop -lncursesw -lz -lm -lrt $(LDFLAGS)
   37 
   38 atopsar:	atop
   39 		ln -sf atop atopsar
   40 
   41 atopacctd:	atopacctd.o netlink.o
   42 		$(CC) atopacctd.o netlink.o -o atopacctd $(LDFLAGS)
   43 
   44 atopconvert:	atopconvert.o
   45 		$(CC) atopconvert.o -o atopconvert -lz $(LDFLAGS)
   46 
   47 atopcat:	atopcat.o
   48 		$(CC) atopcat.o -o atopcat $(LDFLAGS)
   49 
   50 clean:
   51 		rm -f *.o atop atopsar atopacctd atopconvert atopcat
   52 
   53 distr:
   54 		rm -f *.o atop
   55 		tar czvf /tmp/atop.tar.gz *
   56 
   57 # default install is based on systemd
   58 #
   59 install:	genericinstall
   60 		if [ ! -d $(DESTDIR)$(SYSDPATH) ]; 			\
   61 		then	mkdir -p $(DESTDIR)$(SYSDPATH); fi
   62 		if [ ! -d $(DESTDIR)$(PMPATHD) ]; 			\
   63 		then	mkdir -p $(DESTDIR)$(PMPATHD); fi
   64 		#
   65 		cp atop.service        $(DESTDIR)$(SYSDPATH)
   66 		chmod 0644             $(DESTDIR)$(SYSDPATH)/atop.service
   67 		cp atopgpu.service     $(DESTDIR)$(SYSDPATH)
   68 		chmod 0644             $(DESTDIR)$(SYSDPATH)/atopgpu.service
   69 		cp atop-rotate.service $(DESTDIR)$(SYSDPATH)
   70 		chmod 0644             $(DESTDIR)$(SYSDPATH)/atop-rotate.service
   71 		cp atop-rotate.timer   $(DESTDIR)$(SYSDPATH)
   72 		chmod 0644             $(DESTDIR)$(SYSDPATH)/atop-rotate.timer
   73 		cp atopacct.service    $(DESTDIR)$(SYSDPATH)
   74 		chmod 0644             $(DESTDIR)$(SYSDPATH)/atopacct.service
   75 		cp atop-pm.sh          $(DESTDIR)$(PMPATHD)
   76 		chmod 0711             $(DESTDIR)$(PMPATHD)/atop-pm.sh
   77 		#
   78 		# only when making on target system:
   79 		#
   80 		if [ -z "$(DESTDIR)" -a -f /bin/systemctl ]; 		\
   81 		then	/bin/systemctl disable --now atop     2> /dev/null; \
   82 			/bin/systemctl disable --now atopacct 2> /dev/null; \
   83 			/bin/systemctl daemon-reload;			\
   84 			/bin/systemctl enable  --now atopacct;		\
   85 			/bin/systemctl enable  --now atop;		\
   86 			/bin/systemctl enable  --now atop-rotate.timer;	\
   87 		fi
   88 
   89 
   90 # explicitly use sysvinstall for System V init based systems
   91 #
   92 sysvinstall:	genericinstall
   93 		if [ ! -d $(DESTDIR)$(INIPATH) ]; 			\
   94 		then	mkdir -p  $(DESTDIR)$(INIPATH);	fi
   95 		if [ ! -d $(DESTDIR)$(SCRPATH) ]; 			\
   96 		then	mkdir -p $(DESTDIR)$(SCRPATH);	fi
   97 		if [ ! -d $(DESTDIR)$(CRNPATH) ]; 			\
   98 		then	mkdir -p $(DESTDIR)$(CRNPATH);	fi
   99 		if [ ! -d $(DESTDIR)$(ROTPATH) ]; 			\
  100 		then	mkdir -p $(DESTDIR)$(ROTPATH);	fi
  101 		#
  102 		cp atop.init      $(DESTDIR)$(INIPATH)/atop
  103 		cp atopacct.init  $(DESTDIR)$(INIPATH)/atopacct
  104 		cp atop.cronsysv  $(DESTDIR)$(CRNPATH)/atop
  105 		cp atop.daily     $(DESTDIR)$(SCRPATH)
  106 		chmod 0711        $(DESTDIR)$(SCRPATH)/atop.daily
  107 		touch             $(DESTDIR)$(LOGPATH)/dummy_before
  108 		touch             $(DESTDIR)$(LOGPATH)/dummy_after
  109 		#
  110 		if [   -d $(DESTDIR)$(PMPATH1) ]; 			\
  111 		then	cp 45atoppm $(DESTDIR)$(PMPATH1); 		\
  112 			chmod 0711  $(DESTDIR)$(PMPATH1)/45atoppm;	\
  113 		fi
  114 		if [ -d $(DESTDIR)$(PMPATH2) ]; 			\
  115 		then	cp 45atoppm $(DESTDIR)$(PMPATH2);		\
  116 			chmod 0711  $(DESTDIR)$(PMPATH2)/45atoppm;	\
  117 		fi
  118 		#
  119 		#
  120 		# only when making on target system:
  121 		#
  122 		if [ -z "$(DESTDIR)" -a -f /sbin/chkconfig ];		\
  123 		then 	/sbin/chkconfig --del atop     2> /dev/null;	\
  124 			/sbin/chkconfig --add atop;			\
  125 			/sbin/chkconfig --del atopacct 2> /dev/null;	\
  126 			/sbin/chkconfig --add atopacct;			\
  127 		fi
  128 		if [ -z "$(DESTDIR)" -a -f /usr/sbin/update-rc.d ];	\
  129 		then	update-rc.d atop defaults;			\
  130 			update-rc.d atopacct defaults;			\
  131 		fi
  132 		if [ -z "$(DESTDIR)" -a -f /sbin/service ];		\
  133 		then	/sbin/service atopacct start;			\
  134 			sleep 2;					\
  135 			/sbin/service atop     start;			\
  136 		fi
  137 
  138 
  139 genericinstall:	atop atopacctd atopconvert atopcat
  140 		if [ ! -d $(DESTDIR)$(LOGPATH) ]; 		\
  141 		then	mkdir -p $(DESTDIR)$(LOGPATH); fi
  142 		if [ ! -d $(DESTDIR)$(DEFPATH) ]; 		\
  143 		then	mkdir -p $(DESTDIR)$(DEFPATH); fi
  144 		if [ ! -d $(DESTDIR)$(BINPATH) ]; 		\
  145 		then	mkdir -p $(DESTDIR)$(BINPATH); fi
  146 		if [ ! -d $(DESTDIR)$(SBINPATH) ]; 		\
  147 		then mkdir -p $(DESTDIR)$(SBINPATH); fi
  148 		if [ ! -d $(DESTDIR)$(MAN1PATH) ]; 		\
  149 		then	mkdir -p $(DESTDIR)$(MAN1PATH);	fi
  150 		if [ ! -d $(DESTDIR)$(MAN5PATH) ]; 		\
  151 		then	mkdir -p $(DESTDIR)$(MAN5PATH);	fi
  152 		if [ ! -d $(DESTDIR)$(MAN8PATH) ]; 		\
  153 		then	mkdir -p $(DESTDIR)$(MAN8PATH);	fi
  154 		#
  155 		touch       		$(DESTDIR)$(DEFPATH)/atop
  156 		chmod 644      		$(DESTDIR)$(DEFPATH)/atop
  157 		#
  158 		cp atop   		$(DESTDIR)$(BINPATH)/atop
  159 		chmod 0711 		$(DESTDIR)$(BINPATH)/atop
  160 		ln -sf atop             $(DESTDIR)$(BINPATH)/atopsar
  161 		cp atopacctd  		$(DESTDIR)$(SBINPATH)/atopacctd
  162 		chmod 0700 		$(DESTDIR)$(SBINPATH)/atopacctd
  163 		cp atopgpud  		$(DESTDIR)$(SBINPATH)/atopgpud
  164 		chmod 0700 		$(DESTDIR)$(SBINPATH)/atopgpud
  165 		cp atop   		$(DESTDIR)$(BINPATH)/atop-$(VERS)
  166 		ln -sf atop-$(VERS)     $(DESTDIR)$(BINPATH)/atopsar-$(VERS)
  167 		cp atopconvert 		$(DESTDIR)$(BINPATH)/atopconvert
  168 		chmod 0711 		$(DESTDIR)$(BINPATH)/atopconvert
  169 		cp atopcat 		$(DESTDIR)$(BINPATH)/atopcat
  170 		chmod 0711 		$(DESTDIR)$(BINPATH)/atopcat
  171 		cp man/atop.1    	$(DESTDIR)$(MAN1PATH)
  172 		cp man/atopsar.1 	$(DESTDIR)$(MAN1PATH)
  173 		cp man/atopconvert.1 	$(DESTDIR)$(MAN1PATH)
  174 		cp man/atopcat.1 	$(DESTDIR)$(MAN1PATH)
  175 		cp man/atoprc.5  	$(DESTDIR)$(MAN5PATH)
  176 		cp man/atopacctd.8  	$(DESTDIR)$(MAN8PATH)
  177 		cp man/atopgpud.8  	$(DESTDIR)$(MAN8PATH)
  178 
  179 ##########################################################################
  180 
  181 versdate.h:
  182 		./mkdate
  183 
  184 atop.o:		atop.h	photoproc.h photosyst.h  acctproc.h showgeneric.h
  185 atopsar.o:	atop.h	photoproc.h photosyst.h                           
  186 rawlog.o:	atop.h	photoproc.h photosyst.h  rawlog.h   showgeneric.h
  187 various.o:	atop.h                           acctproc.h
  188 ifprop.o:	atop.h	            photosyst.h             ifprop.h
  189 parseable.o:	atop.h	photoproc.h photosyst.h             parseable.h
  190 deviate.o:	atop.h	photoproc.h photosyst.h
  191 procdbase.o:	atop.h	photoproc.h
  192 acctproc.o:	atop.h	photoproc.h atopacctd.h  acctproc.h netatop.h
  193 netatopif.o:	atop.h	photoproc.h              netatopd.h netatop.h
  194 photoproc.o:	atop.h	photoproc.h
  195 photosyst.o:	atop.h	            photosyst.h
  196 showgeneric.o:	atop.h	photoproc.h photosyst.h  showgeneric.h showlinux.h
  197 showlinux.o:	atop.h	photoproc.h photosyst.h  showgeneric.h showlinux.h
  198 showsys.o:	atop.h  photoproc.h photosyst.h  showgeneric.h 
  199 showprocs.o:	atop.h	photoproc.h photosyst.h  showgeneric.h showlinux.h
  200 version.o:	version.c version.h versdate.h
  201 gpucom.o:	atop.h	photoproc.h photosyst.h
  202 
  203 atopacctd.o:	atop.h  photoproc.h acctproc.h   atopacctd.h   version.h versdate.h
  204 
  205 atopconvert.o:	atop.h  photoproc.h photosyst.h  rawlog.h
  206 atopcat.o:	atop.h  rawlog.h