[go: up one dir, main page]

File: Makefile.am

package info (click to toggle)
smartmontools 5.32-3
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 1,692 kB
  • ctags: 1,555
  • sloc: ansic: 14,892; sh: 3,677; asm: 597; makefile: 275
file content (236 lines) | stat: -rw-r--r-- 7,847 bytes parent folder | download
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
## Process this file with automake to produce Makefile.in
#
# $Id: Makefile.am,v 1.56 2004/03/24 22:37:38 chrfranke Exp $
#

@SET_MAKE@

AM_CPPFLAGS = -DSMARTMONTOOLS_SYSCONFDIR=\"$(sysconfdir)\"

sbin_PROGRAMS = smartd 	\
		smartctl

smartd_SOURCES =  smartd.c       \
                  smartd.h       \
                  atacmdnames.c	\
                  atacmdnames.h	\
                  atacmds.c	\
                  atacmds.h	\
                  ataprint.c 	\
                  ataprint.h	\
                  extern.h      \
                  int64.h       \
                  knowndrives.c	\
                  knowndrives.h	\
                  scsicmds.c	\
                  scsicmds.h	\
                  scsiprint.c	\
                  scsiprint.h	\
                  utility.c 	\
                  utility.h

smartd_LDADD = @os_deps@ @os_libs@
smartd_DEPENDENCIES = @os_deps@
EXTRA_smartd_SOURCES = os_linux.c \
                       os_linux.h \
		       os_freebsd.c \
		       os_freebsd.h \
		       os_netbsd.c \
		       os_netbsd.h \
		       os_solaris.c \
		       os_solaris.h \
		       os_solaris_ata.s \
		       os_win32.c \
	               os_generic.c \
	               os_generic.h


if OS_WIN32_MINGW

EXTRA_smartd_SOURCES += \
                posix/regex.h \
                posix/regex.c \
                os_win32/daemon_win32.h \
                os_win32/daemon_win32.c \
                os_win32/syslog.h \
                os_win32/syslog_win32.c

endif

smartctl_SOURCES= smartctl.c    \
                  smartctl.h    \
                  atacmdnames.c	\
                  atacmdnames.h	\
                  atacmds.c	\
                  atacmds.h	\
                  ataprint.c	\
                  ataprint.h	\
                  extern.h      \
                  int64.h       \
                  knowndrives.c	\
                  knowndrives.h	\
                  scsicmds.c	\
                  scsicmds.h	\
                  scsiprint.c	\
                  scsiprint.h	\
                  utility.c	\
                  utility.h

smartctl_LDADD = @os_deps@ @os_libs@
smartctl_DEPENDENCIES = @os_deps@
EXTRA_smartctl_SOURCES = os_linux.c \
                       os_linux.h   \
		       os_freebsd.c \
		       os_freebsd.h \
		       os_netbsd.c \
		       os_netbsd.h \
		       os_solaris.c \
		       os_solaris.h \
		       os_win32.c \
		       os_generic.c \
		       os_generic.h

if OS_WIN32_MINGW

EXTRA_smartctl_SOURCES += \
                posix/regex.h \
                posix/regex.c \
                os_win32/syslog.h

endif

if OS_SOLARIS
# This block is required because Solaris uses manual page section 1m
# for administrative command (linux/freebsd use section 8) and Solaris
# uses manual page section 4 for file formats (linux/freebsd use
# section 5).  Automake can deal cleanly with man page sections 1-8
# and n, but NOT with sections of the form 1m.
extra_MANS =      smartd.conf.4 \
                  smartctl.1m   \
                  smartd.1m
install-man: $(extra_MANS)
	@$(NORMAL_INSTALL)
	$(mkinstalldirs) $(DESTDIR)$(mandir)/man4
	$(mkinstalldirs) $(DESTDIR)$(mandir)/man1m
	for i in $(extra_MANS); do \
	  if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
	  else file=$$i; fi; \
	  ext=`echo $$i | sed -e 's/^.*\\.//'`; \
	  inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
	  inst=`echo $$inst | sed -e 's/^.*\///'`; \
	  inst=`echo $$inst | sed '$(transform)'`.$$ext; \
	  echo " $(INSTALL_DATA) $$file $(DESTDIR)$(mandir)/man$$ext/$$inst"; \
	  $(INSTALL_DATA) $$file $(DESTDIR)$(mandir)/man$$ext/$$inst; \
	done
uninstall-man:
	@$(NORMAL_UNINSTALL)
	for i in $(extra_MANS); do \
	  if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
	  else file=$$i; fi; \
	  ext=`echo $$i | sed -e 's/^.*\\.//'`; \
	  inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
	  inst=`echo $$inst | sed -e 's/^.*\///'`; \
	  inst=`echo $$inst | sed '$(transform)'`.$$ext; \
	  echo " rm -f $(DESTDIR)$(mandir)/man$$ext/$$inst"; \
	  rm -f $(DESTDIR)$(mandir)/man$$ext/$$inst; \
	done
%.1m: %.8
	awk '/^.TH/ {$$3="1m"} {print}' < $< | \
	sed -e 's/smartd\.conf\(.*\)(5)/smartd.conf\1(4)/g' \
            -e 's/syslog\.conf\(.*\)(5)/syslog.conf\1(4)/g' \
	    -e 's/smartctl\(.*\)(8)/smartctl\1(1m)/g' \
	    -e 's/syslogd\(.*\)(8)/syslogd\1(1m)/g' \
            -e 's|/var/log/messages|/var/adm/messages|g' \
	    -e 's/smartd\(.*\)(8)/smartd\1(1m)/g' > $@
%.4: %.5
	awk '/^.TH/ {$$3="4"}  {print}' < $< | \
	sed -e 's/smartd\.conf\(.*\)(5)/smartd.conf\1(4)/g' \
            -e 's/syslog\.conf\(.*\)(5)/syslog.conf\1(4)/g' \
	    -e 's/smartctl\(.*\)(8)/smartdctl\1(1m)/g' \
	    -e 's/syslogd\(.*\)(8)/syslogd\1(1m)/g' \
            -e 's|/var/log/messages|/var/adm/messages|g' \
	    -e 's/smartd\(.*\)(8)/smartd\1(1m)/g' > $@
else
# For systems that adopts traditional manner
man_MANS =        smartd.conf.5 \
                  smartctl.8    \
                  smartd.8
endif

docsdir=$(docdir)
docs_DATA = AUTHORS   \
            CHANGELOG \
            COPYING   \
            INSTALL   \
            NEWS      \
            README    \
            TODO      \
            WARNINGS  \
            smartd.conf

sysconf_DATA = smartd.conf$(smartd_suffix)

if SMARTD_SUFFIX
smartd.conf$(smartd_suffix): smartd.conf
	cp smartd.conf smartd.conf$(smartd_suffix)
endif

initd_DATA = smartd.initd

EXTRA_DIST = \
                smartmontools.spec	\
                smartd.initd.in		\
		smartd.8.in		\
		smartctl.8.in		\
		smartd.conf.5.in	\
		smartd.conf		\
		autogen.sh		\
                $(docs_DATA)

CLEANFILES = smartd.conf.5 \
                 smartd.conf.4 \
                 smartd.8      \
                 smartd.1m     \
	         smartctl.8    \
	         smartctl.1m   \
		 smartd.initd

smartd.conf.5.in: smartd.8.in
	sed '1,/STARTINCLUDE/ D;/ENDINCLUDE/,$$D' < $(srcdir)/smartd.8.in > $(top_builddir)/tmp.directives
	sed '/STARTINCLUDE/,$$D'  < $(srcdir)/smartd.conf.5.in > $(top_builddir)/tmp.head
	sed '1,/ENDINCLUDE/D'   < $(srcdir)/smartd.conf.5.in > $(top_builddir)/tmp.tail
	cat $(top_builddir)/tmp.head > $(srcdir)/smartd.conf.5.in
	echo '.\" STARTINCLUDE' >> $(srcdir)/smartd.conf.5.in
	cat $(top_builddir)/tmp.directives >> $(srcdir)/smartd.conf.5.in
	echo '.\" ENDINCLUDE'   >> $(srcdir)/smartd.conf.5.in
	cat $(top_builddir)/tmp.tail >> $(srcdir)/smartd.conf.5.in
	rm -f $(top_builddir)/tmp.head $(top_builddir)/tmp.tail $(top_builddir)/tmp.directives

install-initdDATA: $(initd_DATA)
	$(mkinstalldirs) $(DESTDIR)$(initddir)
	$(INSTALL_SCRIPT) $(top_builddir)/smartd.initd $(DESTDIR)$(initddir)/smartd$(smartd_suffix)
	@echo -e "\n\n####################################################################\n#"
	@echo -e "#                       PLEASE READ THIS BOX!\n#"
	@echo -e "#   To manually start the smartd daemon, run:\n#   ${initddir}/smartd start\n#"
	@echo -e "#   To automatically start smartd on bootup, run:\n#   /sbin/chkconfig --add smartd\n#"
	@echo -e "#   smartd can now use a configuration file ${sysconfdir}/smartd.conf. Do:\n#   man smartd"
	@echo -e "#   to learn about it. A sample configuration file can be found in:\n#   ${docdir}\n#"
	@echo -e "####################################################################\n\n"

uninstall-initdDATA:
	rm -rf $(DESTDIR)$(initddir)/smartd$(smartd_suffix)

uninstall-docsDATA:
	rm -rf $(DESTDIR)$(docsdir)

smart%: $(srcdir)/smart%.in Makefile
	sed "s|CURRENT_CVS_VERSION|$(releaseversion)|g" $< | \
	sed "s|CURRENT_CVS_DATE|$(smartmontools_release_date)|g" | \
	sed "s|CURRENT_CVS_TIME|$(smartmontools_release_time)|g" | \
	sed "s|/usr/share/man/|$(mandir)/|g" | \
	sed "s|/usr/sbin/|$(sbindir)/|g" | \
	sed "s|/etc/rc\\.d/init.d/|$(initddir)/|g" | \
	sed "s|/usr/share/doc/smartmontools-5\\.1/|$(docsdir)/|g" | \
	sed "s|/etc/smartd\\.conf|$(sysconfdir)/smartd\\.conf|g" > $@

SUBDIRS= . examplescripts