forked from sysstat/sysstat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.in
693 lines (581 loc) · 22.2 KB
/
Makefile.in
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
# Makefile to build sysstat commands
# (C) 1999-2019 Sebastien GODARD (sysstat <at> orange.fr)
# Version and package name
VERSION = @PACKAGE_VERSION@
PACKAGE = @PACKAGE_NAME@
# Needed by docdir
PACKAGE_TARNAME = $(PACKAGE)-$(VERSION)
# Compiler to use
CC = @CC@
# Other commands
CHMOD = @CHMOD@
CHOWN = @CHOWN@
LN_S = @LN_S@
AR = @AR@
# Full path to prevent from using aliases
CP = @PATH_CP@
CHKCONFIG = @PATH_CHKCONFIG@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_BIN = @INSTALL_BIN@
HAVE_SENSORS = @HAVE_SENSORS@
LFSENSORS =
DFSENSORS =
ifeq ($(HAVE_SENSORS),y)
LFSENSORS = @LFSENSORS@
DFSENSORS = @DFSENSORS@
endif
HAVE_PCP = @HAVE_PCP@
LFPCP =
DFPCP =
ifeq ($(HAVE_PCP),y)
LFPCP = @LFPCP@
DFPCP = @DFPCP@
endif
# Directories
ifndef PREFIX
PREFIX = @prefix@
endif
ifndef DESTDIR
DESTDIR = $(RPM_BUILD_ROOT)
endif
# These two variables are needed by other ones (eg bindir)
prefix = $(PREFIX)
exec_prefix = @exec_prefix@
datarootdir = @datarootdir@
ifndef SA_LIB_DIR
SA_LIB_DIR = @SA_LIB_DIR@
endif
SADC_PATH = $(SA_LIB_DIR)/sadc
ifndef SA_DIR
SA_DIR = @SA_DIR@
endif
BIN_DIR = @bindir@
ifndef MAN_DIR
# With recent versions of autoconf, mandir defaults to ${datarootdir}/man
# (i.e. $prefix/share/man)
MAN_DIR = @mandir@
endif
MAN1_DIR = $(MAN_DIR)/man1
MAN5_DIR = $(MAN_DIR)/man5
MAN8_DIR = $(MAN_DIR)/man8
ifndef DOC_DIR
DOC_DIR = @docdir@
endif
NLS_DIR = $(PREFIX)/share/locale
SYSCONFIG_DIR = @SYSCONFIG_DIR@
SYSCONFIG_FILE = @SYSCONFIG_FILE@
# Compiler flags
CFLAGS = @CFLAGS@ -Wall -Wstrict-prototypes -pipe -O2
DFLAGS = @DFLAGS@
LFLAGS = @STRIP@
DFLAGS += -DSA_DIR=\"$(SA_DIR)\" -DSADC_PATH=\"$(SADC_PATH)\"
DFLAGS += $(DFSENSORS)
DFLAGS += $(DFPCP)
# Commands
ifndef MSGFMT
MSGFMT = @MSGFMT@
endif
ifndef XGETTEXT
XGETTEXT = @XGETTEXT@
endif
ifndef MSGMERGE
MSGMERGE = @MSGMERGE@
endif
ifndef ZIP
ZIP = @ZIP@
endif
# Settings
SYSMACROS = @SYSMACROS@
ifeq ($(SYSMACROS),y)
DFLAGS += -DHAVE_SYS_SYSMACROS_H
endif
LINUX_SCHED = @LINUX_SCHED@
ifeq ($(LINUX_SCHED),y)
DFLAGS += -DHAVE_LINUX_SCHED_H
endif
PCP_IMPL = @PCP_IMPL@
ifeq ($(PCP_IMPL),y)
DFLAGS += -DHAVE_PCP_IMPL_H
endif
SYSPARAM = @SYSPARAM@
ifeq ($(SYSPARAM),y)
DFLAGS += -DHAVE_SYS_PARAM_H
endif
NLS = @NLS@
ifeq ($(NLS),y)
REQUIRE_NLS = -DUSE_NLS -DPACKAGE=\"$(PACKAGE)\" -DLOCALEDIR=\"$(NLS_DIR)\"
endif
ifdef REQUIRE_NLS
DFLAGS += $(REQUIRE_NLS)
endif
INSTALL_CRON = @INSTALL_CRON@
CRON_OWNER = @CRON_OWNER@
MAN_GROUP = @MAN_GROUP@
ifndef IGNORE_FILE_ATTRIBUTES
IGNORE_FILE_ATTRIBUTES = @IGNORE_FILE_ATTRIBUTES@
endif
ifeq ($(IGNORE_FILE_ATTRIBUTES),y)
MANGRPARG =
else
MANGRPARG = -g $(MAN_GROUP)
endif
ifndef CLEAN_SA_DIR
CLEAN_SA_DIR = @CLEAN_SA_DIR@
endif
ifndef COMPRESS_MANPG
COMPRESS_MANPG = @COMPRESS_MANPG@
endif
ifndef INSTALL_DOC
INSTALL_DOC = @INSTALL_DOC@
endif
ifndef COPY_ONLY
COPY_ONLY = @COPY_ONLY@
endif
# Systemd
SYSTEMCTL = @SYSTEMCTL@
SYSTEMD_UNIT_DIR = @SYSTEMD_UNIT_DIR@
# Run-command directories
ifndef RC_DIR
RC_DIR = @RC_DIR@
endif
RC0_DIR = $(RC_DIR)/rc0.d
RC1_DIR = $(RC_DIR)/rc1.d
RC2_DIR = $(RC_DIR)/rc2.d
RC3_DIR = $(RC_DIR)/rc3.d
RC4_DIR = $(RC_DIR)/rc4.d
RC5_DIR = $(RC_DIR)/rc5.d
RC6_DIR = $(RC_DIR)/rc6.d
ifndef INIT_DIR
INIT_DIR = @INIT_DIR@
endif
ifndef INITD_DIR
INITD_DIR = @INITD_DIR@
endif
SOURCE_CODE= $(wildcard *.c *.h)
NLSPO= $(wildcard nls/*.po)
NLSGMO= $(NLSPO:.po=.gmo)
NLSPOT= $(NLSPO:.po=.pot)
%.gmo: %.po
$(MSGFMT) -o $@ $<
%.pot: %.po
$(MSGMERGE) -U $< nls/sysstat.pot
%.o: %.c
$(CC) -o $@ -c $(CFLAGS) $(DFLAGS) $<
% : %.o
$(CC) -o $@ $(CFLAGS) $^ $(LFLAGS)
all: sadc sar sadf iostat tapestat mpstat pidstat cifsiostat locales
common_sadc.o: common.c version.h common.h
$(CC) -o $@ -c $(CFLAGS) -DSOURCE_SADC $(DFLAGS) $<
common.o: common.c version.h common.h
systest.o: systest.c systest.h
sa_common_sadc.o: sa_common.c version.h sa.h common.h rd_stats.h rd_sensors.h ioconf.h sysconfig.h
$(CC) -o $@ -c $(CFLAGS) -DSOURCE_SADC $(DFLAGS) $<
sa_common.o: sa_common.c version.h sa.h common.h rd_stats.h rd_sensors.h ioconf.h sysconfig.h
ioconf.o: ioconf.c ioconf.h common.h sysconfig.h
act_sadc.o: activity.c sa.h common.h rd_stats.h rd_sensors.h
$(CC) -o $@ -c $(CFLAGS) -DSOURCE_SADC $(DFLAGS) $<
act_sar.o: activity.c sa.h common.h rd_stats.h rd_sensors.h pr_stats.h
$(CC) -o $@ -c $(CFLAGS) -DSOURCE_SAR $(DFLAGS) $<
act_sadf.o: activity.c sa.h common.h rd_stats.h rd_sensors.h rndr_stats.h xml_stats.h json_stats.h svg_stats.h raw_stats.h pcp_stats.h
$(CC) -o $@ -c $(CFLAGS) -DSOURCE_SADF $(DFLAGS) $<
rd_stats.o: rd_stats.c common.h rd_stats.h
$(CC) -o $@ -c $(CFLAGS) -DSOURCE_SADC $(DFLAGS) $<
rd_stats_light.o: rd_stats.c common.h rd_stats.h ioconf.h sysconfig.h
$(CC) -o $@ -c $(CFLAGS) $(DFLAGS) $<
count.o: count.c common.h rd_stats.h
$(CC) -o $@ -c $(CFLAGS) -DSOURCE_SADC $(DFLAGS) $<
count_light.o: count.c common.h rd_stats.h
$(CC) -o $@ -c $(CFLAGS) $(DFLAGS) $<
rd_sensors.o: rd_sensors.c common.h rd_sensors.h rd_stats.h
pr_stats.o: pr_stats.c sa.h common.h rd_stats.h rd_sensors.h ioconf.h sysconfig.h pr_stats.h
rndr_stats.o: rndr_stats.c sa.h common.h rd_stats.h rd_sensors.h ioconf.h sysconfig.h rndr_stats.h
xml_stats.o: xml_stats.c sa.h common.h rd_stats.h rd_sensors.h ioconf.h sysconfig.h xml_stats.h
json_stats.o: json_stats.c sa.h common.h rd_stats.h rd_sensors.h ioconf.h sysconfig.h json_stats.h
svg_stats.o: svg_stats.c sa.h common.h rd_stats.h rd_sensors.h ioconf.h sysconfig.h svg_stats.h
raw_stats.o: raw_stats.c sa.h common.h rd_stats.h rd_sensors.h ioconf.h sysconfig.h raw_stats.h
pcp_stats.o: pcp_stats.c sa.h pcp_stats.h
sa_wrap.o: sa_wrap.c sa.h common.h rd_stats.h count.h rd_sensors.h
$(CC) -o $@ -c $(CFLAGS) -DSOURCE_SADC $(DFLAGS) $<
format_sadf.o: format.c sadf.h sa.h common.h rd_stats.h rd_sensors.h
$(CC) -o $@ -c $(CFLAGS) -DSOURCE_SADF $(DFLAGS) $<
format_sar.o: format.c sa.h common.h rd_stats.h rd_sensors.h
$(CC) -o $@ -c $(CFLAGS) -DSOURCE_SAR $(DFLAGS) $<
pcp_def_metrics.o: pcp_def_metrics.c
sadf_misc.o: sadf_misc.c sadf.h pcp_def_metrics.h sa.h common.h rd_stats.h rd_sensors.h
sa_conv.o: sa_conv.c version.h sadf.h sa.h common.h rd_stats.h rd_sensors.h sa_conv.h
# Explicit rules needed to prevent possible file corruption
# when using parallel execution.
libsyscom.a: common.o ioconf.o systest.o
$(AR) rvs $@ $?
# Ditto
librdstats.a: rd_stats.o count.o
$(AR) rvs $@ $?
librdstats_light.a: rd_stats_light.o count_light.o
$(AR) rvs $@ $?
# librdsensors.a: librdsensors.a(rd_sensors.o)
librdsensors.a: rd_sensors.o
$(AR) rvs $@ $?
sadc.o: sadc.c sa.h version.h common.h rd_stats.h rd_sensors.h
sadc: LFLAGS += $(LFSENSORS)
sadc: sadc.o act_sadc.o sa_wrap.o sa_common_sadc.o common_sadc.o systest.o librdstats.a librdsensors.a
sar.o: sar.c sa.h version.h common.h rd_stats.h rd_sensors.h
sar: sar.o act_sar.o format_sar.o sa_common.o pr_stats.o librdstats_light.a libsyscom.a
sadf.o: sadf.c sadf.h version.h sa.h common.h rd_stats.h rd_sensors.h
sadf: LFLAGS += $(LFPCP)
sadf: sadf.o act_sadf.o format_sadf.o sadf_misc.o pcp_def_metrics.o sa_conv.o rndr_stats.o xml_stats.o json_stats.o svg_stats.o raw_stats.o pcp_stats.o sa_common.o librdstats_light.a libsyscom.a
iostat.o: iostat.c iostat.h version.h common.h ioconf.h sysconfig.h rd_stats.h count.h
iostat: iostat.o librdstats_light.a libsyscom.a
tapestat.o: tapestat.c tapestat.h version.h common.h count.h rd_stats.h
tapestat: tapestat.o librdstats_light.a libsyscom.a
pidstat.o: pidstat.c pidstat.h version.h common.h rd_stats.h count.h
pidstat: pidstat.o librdstats_light.a libsyscom.a
mpstat.o: mpstat.c mpstat.h version.h common.h rd_stats.h count.h
mpstat: mpstat.o librdstats_light.a libsyscom.a
cifsiostat.o: cifsiostat.c cifsiostat.h count.h rd_stats.h version.h common.h
cifsiostat: cifsiostat.o librdstats_light.a libsyscom.a
tests/ini/sa_common.o: tests/ini/sa_common.c tests/ini/iniversion.h tests/ini/sa.h tests/ini/common.h tests/ini/rd_stats.h tests/ini/rd_sensors.h tests/ini/ioconf.h tests/ini/inisysconfig.h
tests/ini/act_sar.o: tests/ini/activity.c tests/ini/sa.h tests/ini/common.h tests/ini/rd_stats.h tests/ini/rd_sensors.h tests/ini/pr_stats.h
$(CC) -o $@ -c $(CFLAGS) -DSOURCE_SAR $(DFLAGS) $<
tests/ini/rd_stats_light.o: tests/ini/rd_stats.c tests/ini/common.h tests/ini/rd_stats.h tests/ini/ioconf.h tests/ini/inisysconfig.h
$(CC) -o $@ -c $(CFLAGS) $(DFLAGS) $<
tests/ini/count_light.o: tests/ini/count.c tests/ini/common.h tests/ini/rd_stats.h
$(CC) -o $@ -c $(CFLAGS) $(DFLAGS) $<
tests/ini/libsyscom.a: tests/ini/common.o tests/ini/ioconf.o
$(AR) rvs $@ $?
tests/ini/format_sar.o: tests/ini/format.c tests/ini/sa.h tests/ini/common.h tests/ini/rd_stats.h tests/ini/rd_sensors.h
$(CC) -o $@ -c $(CFLAGS) -DSOURCE_SAR $(DFLAGS) $<
tests/ini/pr_stats.o: tests/ini/pr_stats.c tests/ini/sa.h tests/ini/common.h tests/ini/rd_stats.h tests/ini/rd_sensors.h tests/ini/ioconf.h tests/ini/inisysconfig.h tests/ini/pr_stats.h
tests/ini/librdstats_light.a: tests/ini/rd_stats_light.o tests/ini/count_light.o
$(AR) rvs $@ $?
tests/ini/inisar.o: tests/ini/inisar.c tests/ini/sa.h tests/ini/iniversion.h tests/ini/common.h tests/ini/rd_stats.h tests/ini/rd_sensors.h
tests/ini/inisar: tests/ini/inisar.o tests/ini/act_sar.o tests/ini/format_sar.o tests/ini/sa_common.o tests/ini/pr_stats.o tests/ini/librdstats_light.a tests/ini/libsyscom.a
ifdef REQUIRE_NLS
locales: $(NLSGMO)
else
locales:
endif
nls/sysstat.pot: $(wildcard *.c)
$(XGETTEXT) -o $@ -k_ --msgid-bugs-address="sysstat <at> orange.fr" $^
# Phony targets
.PHONY: clean distclean install install_base install_all uninstall \
uninstall_base uninstall_all dist bdist xdist gitdist squeeze simtest
install_man: man/sadc.8 man/sar.1 man/sadf.1 man/sa1.8 man/sa2.8 man/sysstat.5
ifeq ($(INSTALL_DOC),y)
mkdir -p $(DESTDIR)$(MAN1_DIR)
mkdir -p $(DESTDIR)$(MAN5_DIR)
mkdir -p $(DESTDIR)$(MAN8_DIR)
rm -f $(DESTDIR)$(MAN8_DIR)/sa1.8*
$(INSTALL_DATA) $(MANGRPARG) man/sa1.8 $(DESTDIR)$(MAN8_DIR)
rm -f $(DESTDIR)$(MAN8_DIR)/sa2.8*
$(INSTALL_DATA) $(MANGRPARG) man/sa2.8 $(DESTDIR)$(MAN8_DIR)
rm -f $(DESTDIR)$(MAN8_DIR)/sadc.8*
$(INSTALL_DATA) $(MANGRPARG) man/sadc.8 $(DESTDIR)$(MAN8_DIR)
rm -f $(DESTDIR)$(MAN1_DIR)/sar.1*
$(INSTALL_DATA) $(MANGRPARG) man/sar.1 $(DESTDIR)$(MAN1_DIR)
rm -f $(DESTDIR)$(MAN1_DIR)/sadf.1*
$(INSTALL_DATA) $(MANGRPARG) man/sadf.1 $(DESTDIR)$(MAN1_DIR)
rm -f $(DESTDIR)$(MAN5_DIR)/sysstat.5*
$(INSTALL_DATA) $(MANGRPARG) man/sysstat.5 $(DESTDIR)$(MAN5_DIR)
rm -f $(DESTDIR)$(MAN1_DIR)/iostat.1*
$(INSTALL_DATA) $(MANGRPARG) man/iostat.1 $(DESTDIR)$(MAN1_DIR)
rm -f $(DESTDIR)$(MAN1_DIR)/tapestat.1*
$(INSTALL_DATA) $(MANGRPARG) man/tapestat.1 $(DESTDIR)$(MAN1_DIR)
rm -f $(DESTDIR)$(MAN1_DIR)/mpstat.1*
$(INSTALL_DATA) $(MANGRPARG) man/mpstat.1 $(DESTDIR)$(MAN1_DIR)
rm -f $(DESTDIR)$(MAN1_DIR)/pidstat.1*
$(INSTALL_DATA) $(MANGRPARG) man/pidstat.1 $(DESTDIR)$(MAN1_DIR)
rm -f $(DESTDIR)$(MAN1_DIR)/cifsiostat.1*
$(INSTALL_DATA) $(MANGRPARG) man/cifsiostat.1 $(DESTDIR)$(MAN1_DIR)
ifeq ($(COMPRESS_MANPG),y)
$(ZIP) $(DESTDIR)$(MAN8_DIR)/sa1.8
$(ZIP) $(DESTDIR)$(MAN8_DIR)/sa2.8
$(ZIP) $(DESTDIR)$(MAN8_DIR)/sadc.8
$(ZIP) $(DESTDIR)$(MAN1_DIR)/sar.1
$(ZIP) $(DESTDIR)$(MAN1_DIR)/sadf.1
$(ZIP) $(DESTDIR)$(MAN5_DIR)/sysstat.5
$(ZIP) $(DESTDIR)$(MAN1_DIR)/iostat.1
$(ZIP) $(DESTDIR)$(MAN1_DIR)/tapestat.1
$(ZIP) $(DESTDIR)$(MAN1_DIR)/mpstat.1
$(ZIP) $(DESTDIR)$(MAN1_DIR)/pidstat.1
$(ZIP) $(DESTDIR)$(MAN1_DIR)/cifsiostat.1
endif
endif
squeeze:
catalogs="$(SOURCE_CODE)"; \
for c in $$catalogs; do \
echo "Squeezing file: $$c"; \
sed 's/[\t ]*$$//g' $$c > squeeze.tmp; \
mv squeeze.tmp $$c; \
done
install_nls: locales
ifdef REQUIRE_NLS
catalogs='$(NLSGMO)'; \
for c in $$catalogs; do \
c=`basename $$c`; \
c=`echo $$c | sed 's/\.gmo$$//'`; \
mkdir -p $(DESTDIR)$(NLS_DIR)/$$c/LC_MESSAGES; \
echo "NLS: Installing $$c file..." ; \
$(INSTALL_DATA) nls/$$c.gmo $(DESTDIR)$(NLS_DIR)/$$c/LC_MESSAGES/$(PACKAGE).mo; \
done
endif
install_base: all sa1 sa2 sysstat.sysconfig install_man install_nls
mkdir -p $(DESTDIR)$(SA_LIB_DIR)
mkdir -p $(DESTDIR)$(SA_DIR)
ifeq ($(CLEAN_SA_DIR),y)
find $(DESTDIR)$(SA_DIR) \( -name 'sar??' -o -name 'sa??' -o -name 'sar??.gz' -o -name 'sa??.gz' \) \
-exec rm -f {} \;
-rmdir --ignore-fail-on-non-empty $(DESTDIR)$(SA_DIR)/[0-9]?????
endif
mkdir -p $(DESTDIR)$(BIN_DIR)
mkdir -p $(DESTDIR)$(DOC_DIR)
mkdir -p $(DESTDIR)$(SYSCONFIG_DIR)
$(INSTALL_BIN) sa1 $(DESTDIR)$(SA_LIB_DIR)
$(INSTALL_BIN) sa2 $(DESTDIR)$(SA_LIB_DIR)
$(INSTALL_BIN) sadc $(DESTDIR)$(SA_LIB_DIR)
$(INSTALL_BIN) sar $(DESTDIR)$(BIN_DIR)
$(INSTALL_BIN) sadf $(DESTDIR)$(BIN_DIR)
$(INSTALL_BIN) iostat $(DESTDIR)$(BIN_DIR)
$(INSTALL_BIN) tapestat $(DESTDIR)$(BIN_DIR)
$(INSTALL_BIN) mpstat $(DESTDIR)$(BIN_DIR)
$(INSTALL_BIN) pidstat $(DESTDIR)$(BIN_DIR)
$(INSTALL_BIN) cifsiostat $(DESTDIR)$(BIN_DIR)
$(INSTALL_DATA) sysstat.ioconf $(DESTDIR)$(SYSCONFIG_DIR)
$(INSTALL_DATA) sysstat.sysconfig $(DESTDIR)$(SYSCONFIG_DIR)/$(SYSCONFIG_FILE)
ifeq ($(INSTALL_DOC),y)
$(INSTALL_DATA) CHANGES $(DESTDIR)$(DOC_DIR)
$(INSTALL_DATA) COPYING $(DESTDIR)$(DOC_DIR)
$(INSTALL_DATA) CREDITS $(DESTDIR)$(DOC_DIR)
$(INSTALL_DATA) README.md $(DESTDIR)$(DOC_DIR)
$(INSTALL_DATA) FAQ.md $(DESTDIR)$(DOC_DIR)
$(INSTALL_DATA) *.lsm $(DESTDIR)$(DOC_DIR)
endif
install_all: install_base cron/crontab sysstat \
cron/sysstat.crond cron/sysstat.cron.daily cron/sysstat.cron.hourly
ifneq ($(IGNORE_FILE_ATTRIBUTES),y)
$(CHOWN) $(CRON_OWNER) $(DESTDIR)$(SA_DIR)
endif
ifdef SYSTEMD_UNIT_DIR
mkdir -p $(DESTDIR)$(SYSTEMD_UNIT_DIR)
else
if [ -d /etc/cron.d ]; then \
mkdir -p $(DESTDIR)/etc/cron.d; \
elif [ -d /etc/cron.hourly -a -d /etc/cron.daily ]; then \
mkdir -p $(DESTDIR)/etc/cron.hourly $(DESTDIR)/etc/cron.daily; \
fi
if [ -d $(INIT_DIR) ]; then \
mkdir -p $(DESTDIR)$(INIT_DIR); \
elif [ -d $(RC_DIR) ]; then \
mkdir -p $(DESTDIR)$(RC_DIR); \
fi
endif
if [ -z "$(SYSTEMD_UNIT_DIR)" -o ! -d "$(DESTDIR)$(SYSTEMD_UNIT_DIR)" ]; then \
if [ -d $(DESTDIR)/etc/cron.d ]; then \
$(INSTALL_DATA) cron/sysstat.crond $(DESTDIR)/etc/cron.d/sysstat; \
elif [ -d $(DESTDIR)/etc/cron.hourly -a -d $(DESTDIR)/etc/cron.daily ]; then \
$(INSTALL_BIN) cron/sysstat.cron.hourly $(DESTDIR)/etc/cron.hourly/sysstat; \
$(INSTALL_BIN) cron/sysstat.cron.daily $(DESTDIR)/etc/cron.daily/sysstat; \
fi \
fi
ifeq ($(COPY_ONLY),n)
if [ \( -z "$(SYSTEMD_UNIT_DIR)" -o ! -d "$(DESTDIR)$(SYSTEMD_UNIT_DIR)" \) -a ! -d $(DESTDIR)/etc/cron.d ]; then \
if [ ! -d $(DESTDIR)/etc/cron.hourly -o ! -d $(DESTDIR)/etc/cron.daily ]; then \
su $(CRON_OWNER) -c "crontab -l > /tmp/crontab-$(CRON_OWNER).save"; \
$(CP) -a /tmp/crontab-$(CRON_OWNER).save ./crontab-$(CRON_OWNER).`date '+%Y%m%d.%H%M%S'`.save; \
echo "USER'S PREVIOUS CRONTAB SAVED IN CURRENT DIRECTORY (USING .save SUFFIX)."; \
su $(CRON_OWNER) -c "crontab cron/crontab"; \
fi \
fi
endif
if [ -n "$(SYSTEMD_UNIT_DIR)" -a -d "$(DESTDIR)$(SYSTEMD_UNIT_DIR)" ]; then \
$(INSTALL_DATA) sysstat.service $(DESTDIR)$(SYSTEMD_UNIT_DIR); \
$(INSTALL_DATA) cron/sysstat-collect.service $(DESTDIR)$(SYSTEMD_UNIT_DIR); \
$(INSTALL_DATA) cron/sysstat-collect.timer $(DESTDIR)$(SYSTEMD_UNIT_DIR); \
$(INSTALL_DATA) cron/sysstat-summary.service $(DESTDIR)$(SYSTEMD_UNIT_DIR); \
$(INSTALL_DATA) cron/sysstat-summary.timer $(DESTDIR)$(SYSTEMD_UNIT_DIR); \
elif [ -d $(DESTDIR)$(INIT_DIR) ]; then \
$(INSTALL_BIN) sysstat $(DESTDIR)$(INIT_DIR)/sysstat; \
if [ "$(COPY_ONLY)" = "n" ]; then \
if [ -x "$(CHKCONFIG)" ]; then \
cd $(DESTDIR)$(INIT_DIR) && $(CHKCONFIG) --add sysstat; \
else \
[ -d $(DESTDIR)$(RC2_DIR) ] || mkdir -p $(DESTDIR)$(RC2_DIR); \
[ -d $(DESTDIR)$(RC3_DIR) ] || mkdir -p $(DESTDIR)$(RC3_DIR); \
[ -d $(DESTDIR)$(RC5_DIR) ] || mkdir -p $(DESTDIR)$(RC5_DIR); \
cd $(DESTDIR)$(RC2_DIR) && $(LN_S) -f ../$(INITD_DIR)/sysstat S01sysstat; \
cd $(DESTDIR)$(RC3_DIR) && $(LN_S) -f ../$(INITD_DIR)/sysstat S01sysstat; \
cd $(DESTDIR)$(RC5_DIR) && $(LN_S) -f ../$(INITD_DIR)/sysstat S01sysstat; \
fi \
fi \
elif [ -d $(DESTDIR)$(RC_DIR) ]; then \
$(INSTALL_BIN) sysstat $(DESTDIR)$(RC_DIR)/rc.sysstat; \
if [ "$(COPY_ONLY)" = "n" ]; then \
if [ -x "$(CHKCONFIG)" ]; then \
cd $(DESTDIR)$(RC_DIR) && $(CHKCONFIG) --add rc.sysstat; \
else \
[ -d $(DESTDIR)$(RC2_DIR) ] || mkdir -p $(DESTDIR)$(RC2_DIR); \
[ -d $(DESTDIR)$(RC3_DIR) ] || mkdir -p $(DESTDIR)$(RC3_DIR); \
[ -d $(DESTDIR)$(RC5_DIR) ] || mkdir -p $(DESTDIR)$(RC5_DIR); \
cd $(DESTDIR)$(RC2_DIR) && $(LN_S) -f ../rc.sysstat S01sysstat; \
cd $(DESTDIR)$(RC3_DIR) && $(LN_S) -f ../rc.sysstat S01sysstat; \
cd $(DESTDIR)$(RC5_DIR) && $(LN_S) -f ../rc.sysstat S01sysstat; \
fi \
fi \
fi
ifeq ($(COPY_ONLY),n)
if [ -x "$(SYSTEMCTL)" ]; then \
$(SYSTEMCTL) enable sysstat.service; \
fi
endif
uninstall_man:
ifeq ($(INSTALL_DOC),y)
rm -f $(DESTDIR)$(MAN8_DIR)/sadc.8*
rm -f $(DESTDIR)$(MAN8_DIR)/sa1.8*
rm -f $(DESTDIR)$(MAN8_DIR)/sa2.8*
rm -f $(DESTDIR)$(MAN1_DIR)/sar.1*
rm -f $(DESTDIR)$(MAN1_DIR)/sadf.1*
rm -f $(DESTDIR)$(MAN5_DIR)/sysstat.5*
rm -f $(DESTDIR)$(MAN1_DIR)/iostat.1*
rm -f $(DESTDIR)$(MAN1_DIR)/tapestat.1*
rm -f $(DESTDIR)$(MAN1_DIR)/mpstat.1*
rm -f $(DESTDIR)$(MAN1_DIR)/pidstat.1*
rm -f $(DESTDIR)$(MAN1_DIR)/cifsiostat.1*
endif
uninstall_nls:
ifdef REQUIRE_NLS
-catalogs='$(NLSGMO)'; \
for c in $$catalogs; do \
c=`basename $$c`; \
c=`echo $$c | sed 's/\.gmo$$//'`; \
rm -f $(DESTDIR)$(PREFIX)/share/locale/$$c/LC_MESSAGES/$(PACKAGE).mo; \
rmdir --ignore-fail-on-non-empty $(DESTDIR)$(PREFIX)/share/locale/$$c/LC_MESSAGES 2>/dev/null; \
rmdir --ignore-fail-on-non-empty $(DESTDIR)$(PREFIX)/share/locale/$$c 2>/dev/null; \
done
endif
uninstall_base: uninstall_man uninstall_nls
rm -f $(DESTDIR)$(SA_LIB_DIR)/sadc
rm -f $(DESTDIR)$(SA_LIB_DIR)/sa1
rm -f $(DESTDIR)$(SA_LIB_DIR)/sa2
rm -f $(DESTDIR)$(BIN_DIR)/sar
rm -f $(DESTDIR)$(BIN_DIR)/sadf
rm -f $(DESTDIR)$(BIN_DIR)/iostat
rm -f $(DESTDIR)$(BIN_DIR)/tapestat
rm -f $(DESTDIR)$(BIN_DIR)/mpstat
rm -f $(DESTDIR)$(BIN_DIR)/pidstat
rm -f $(DESTDIR)$(BIN_DIR)/cifsiostat
-rmdir --ignore-fail-on-non-empty $(DESTDIR)$(SA_LIB_DIR)
-rmdir --ignore-fail-on-non-empty $(DESTDIR)$(SA_DIR)/[0-9]?????
-rmdir --ignore-fail-on-non-empty $(DESTDIR)$(SA_DIR)
# No need to keep sysstat scripts, config files and links since
# the binaries have been deleted.
rm -f $(DESTDIR)$(INIT_DIR)/sysstat
rm -f $(DESTDIR)$(RC_DIR)/rc.sysstat
rm -f $(DESTDIR)$(SYSCONFIG_DIR)/$(SYSCONFIG_FILE)
rm -f $(DESTDIR)$(SYSCONFIG_DIR)/sysstat.ioconf
rm -f $(DESTDIR)$(RC2_DIR)/S??sysstat
rm -f $(DESTDIR)$(RC2_DIR)/S??rc.sysstat
rm -f $(DESTDIR)$(RC3_DIR)/S??sysstat
rm -f $(DESTDIR)$(RC3_DIR)/S??rc.sysstat
rm -f $(DESTDIR)$(RC5_DIR)/S??sysstat
rm -f $(DESTDIR)$(RC5_DIR)/S??rc.sysstat
# Delete possible kill entries installed by chkconfig
rm -f $(DESTDIR)$(RC0_DIR)/K??sysstat
rm -f $(DESTDIR)$(RC0_DIR)/K??rc.sysstat
rm -f $(DESTDIR)$(RC1_DIR)/K??sysstat
rm -f $(DESTDIR)$(RC1_DIR)/K??rc.sysstat
rm -f $(DESTDIR)$(RC4_DIR)/K??sysstat
rm -f $(DESTDIR)$(RC4_DIR)/K??rc.sysstat
rm -f $(DESTDIR)$(RC6_DIR)/K??sysstat
rm -f $(DESTDIR)$(RC6_DIR)/K??rc.sysstat
# Vixie cron entries also can be safely deleted here
rm -f $(DESTDIR)/etc/cron.d/sysstat
# Id. for Slackware cron entries
rm -f $(DESTDIR)/etc/cron.hourly/sysstat
rm -f $(DESTDIR)/etc/cron.daily/sysstat
ifeq ($(INSTALL_DOC),y)
rm -f $(DESTDIR)$(DOC_DIR)/*
-rmdir $(DESTDIR)$(DOC_DIR)
endif
@echo "Please ignore the errors above, if any."
uninstall_all: uninstall_base
ifeq ($(COPY_ONLY),n)
if [ -z "$(SYSTEMD_UNIT_DIR)" -o ! -d $(DESTDIR)$(SYSTEMD_UNIT_DIR) ]; then \
-su $(CRON_OWNER) -c "crontab -l > /tmp/crontab-$(CRON_OWNER).old" ; \
-$(CP) -a /tmp/crontab-$(CRON_OWNER).old ./crontab-$(CRON_OWNER).`date '+%Y%m%d.%H%M%S'`.old ; \
@echo "USER'S CRONTAB SAVED IN CURRENT DIRECTORY (USING .old SUFFIX)." ; \
-su $(CRON_OWNER) -c "crontab -r" ; \
fi
if [ -x $(SYSTEMCTL) ]; then \
$(SYSTEMCTL) disable sysstat.service; \
fi
endif
if [ -n "$(SYSTEMD_UNIT_DIR)" -a -d $(DESTDIR)$(SYSTEMD_UNIT_DIR) ]; then \
rm -f $(DESTDIR)$(SYSTEMD_UNIT_DIR)/sysstat.service; \
rm -f $(DESTDIR)$(SYSTEMD_UNIT_DIR)/sysstat-collect.service; \
rm -f $(DESTDIR)$(SYSTEMD_UNIT_DIR)/sysstat-collect.timer; \
rm -f $(DESTDIR)$(SYSTEMD_UNIT_DIR)/sysstat-summary.service; \
rm -f $(DESTDIR)$(SYSTEMD_UNIT_DIR)/sysstat-summary.timer; \
fi
ifeq ($(INSTALL_CRON),y)
uninstall: uninstall_all
else
uninstall: uninstall_base
endif
ifeq ($(INSTALL_CRON),y)
install: install_all
else
install: install_base
endif
ifdef REQUIRE_NLS
po-files: nls/sysstat.pot $(NLSPOT)
else
po-files:
endif
TESTDIR="tests"
TESTRUN="/bin/sh"
TESTLIST:=$(shell ls $(TESTDIR) | egrep '^[0-9]+$$' | sort -n)
testcomp: tests/ini/inisar
unit:
@echo $(X) 2>&1
@cat $(TESTDIR)/$(X) | $(TESTRUN)
# Use "do_test" script to make the following target
simtest: all testcomp
@$(foreach x, $(TESTLIST), $(MAKE) X=$x unit || exit;)
rm -f tests/root
ln -s root1 tests/root
@echo Simulation tests: Success!
clean:
rm -f sadc sar sadf iostat tapestat mpstat pidstat cifsiostat *.o *.a core TAGS tests/*.tmp
rm -f nfsiostat* man/nfsiostat*
rm -f tests/sa[012]*
rm -f tests/root
ln -s root1 tests/root
rm -f tests/ini/inisar
rm -f tests/ini/*.o tests/ini/*.a tests/ini/core tests/pcpar.*
find nls -name "*.gmo" -exec rm -f {} \;
almost-distclean: clean nls/sysstat.pot
rm -f sa1 sa2 sysstat cron/crontab version.h sysconfig.h
rm -f sysstat.sysconfig cron/sysstat.crond cron/sysstat.cron.daily sysstat.service
rm -f cron/sysstat-collect.service cron/sysstat-collect.timer cron/sysstat-summary.service cron/sysstat-summary.timer
rm -f cron/sysstat.cron.hourly cron/sysstat.crond.sample cron/sysstat.crond.sample.in
rm -f man/sa1.8 man/sa2.8 man/sadc.8 man/sadf.1 man/sar.1 man/iostat.1 man/sysstat.5
rm -f tests/variables tests/data
rm -f man/cifsiostat.1
rm -f *.log config.status
rm -rf autom4te.cache
rm -f *.save *.old .*.swp data
find . -name "*~" -exec rm -f {} \;
distclean: almost-distclean
rm -f Makefile
maintainer-clean: distclean
rm -f configure
dist: almost-distclean
cd .. && (tar --exclude=Makefile --exclude=.git -cvf - sysstat-$(VERSION) | gzip -v9 > sysstat-$(VERSION).tar.gz)
bdist: almost-distclean
cd .. && (tar --exclude=Makefile --exclude=.git -cvf - sysstat-$(VERSION) | bzip2 > sysstat-$(VERSION).tar.bz2)
xdist: almost-distclean
cd .. && (tar --exclude=Makefile --exclude=.git -cvf - sysstat-$(VERSION) | xz > sysstat-$(VERSION).tar.xz)
gitdist: almost-distclean
cd .. && (tar --exclude=Makefile -cvf - sysstat-$(VERSION) | bzip2 > sysstat-$(VERSION)-git.tar.bz2)
tags:
etags ./*.[hc]