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
|
## Process this file with automake to produce Makefile.in
#
# $Id: Makefile.am,v 1.74 2005/11/29 18:22:51 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_darwin.c \
os_darwin.h \
os_linux.c \
os_linux.h \
os_freebsd.c \
os_freebsd.h \
os_netbsd.c \
os_netbsd.h \
os_openbsd.c \
os_openbsd.h \
os_solaris.c \
os_solaris.h \
os_solaris_ata.s \
os_win32.c \
os_generic.c \
os_generic.h
if OS_WIN32_MINGW
smartd_SOURCES += \
posix/regex.h \
posix/regex.c \
os_win32/daemon_win32.h \
os_win32/daemon_win32.c \
os_win32/hostname_win32.h \
os_win32/hostname_win32.c \
os_win32/syslog.h \
os_win32/syslog_win32.c
# Included by regex.c:
EXTRA_smartd_SOURCES += \
posix/regcomp.c \
posix/regexec.c \
posix/regex_internal.c \
posix/regex_internal.h
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_openbsd.c \
os_openbsd.h \
os_solaris.c \
os_solaris.h \
os_win32.c \
os_generic.c \
os_generic.h
if OS_WIN32_MINGW
smartctl_SOURCES += \
posix/regex.h \
posix/regex.c \
os_win32/syslog.h
# Included by regex.c:
EXTRA_smartctl_SOURCES += \
posix/regcomp.c \
posix/regexec.c \
posix/regex_internal.c \
posix/regex_internal.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 ${srcdir}/smartd.conf smartd.conf$(smartd_suffix)
endif
EXTRA_DIST = smartmontools.spec \
smartd.initd.in \
smartd.8.in \
smartctl.8.in \
smartd.conf.5.in \
smartd.conf \
autogen.sh \
os_darwin/SMART.in \
os_darwin/StartupParameters.plist \
os_darwin/English_Localizable.strings \
$(docs_DATA)
CLEANFILES = smartd.conf.5 \
smartd.conf.4 \
smartd.8 \
smartd.1m \
smartd.8.html \
smartd.8.txt \
smartctl.8 \
smartctl.1m \
smartctl.8.html \
smartctl.8.txt \
smartd.conf.5.html \
smartd.conf.5.txt \
smartd.initd \
SMART
if SMARTD_SUFFIX
CLEANFILES += smartd.conf$(smartd_suffix)
endif
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
if OS_DARWIN
initd_DATA = SMART \
os_darwin/StartupParameters.plist \
os_darwin/English_Localizable.strings
initd_install_name = SMART
initd_DATA_install = install-initdDATA-darwin
SMART : os_darwin/SMART.in
sed "s|/usr/sbin/|$(sbindir)/|" $< > $@
install-initdDATA-darwin: $(initd_DATA)
$(mkinstalldirs) $(DESTDIR)$(initddir)
$(mkinstalldirs) $(DESTDIR)$(initddir)/SMART
$(mkinstalldirs) $(DESTDIR)$(initddir)/SMART/Resources
$(INSTALL_SCRIPT) $(top_builddir)/SMART $(DESTDIR)$(initddir)/SMART
$(INSTALL_DATA) $(srcdir)/os_darwin/StartupParameters.plist \
$(DESTDIR)$(initddir)/SMART/StartupParameters.plist
for i in English ; do \
RDIR=$(DESTDIR)$(initddir)/SMART/Resources/$${i}.lproj ; \
$(mkinstalldirs) $$RDIR ;\
$(INSTALL_DATA) $(srcdir)/os_darwin/$${i}_Localizable.strings \
$$RDIR/Localizable.strings ; \
done
@echo -e "\n\n####################################################################\n#"
@echo -e "# PLEASE READ THIS BOX!\n#"
@echo -e "# To manually start the smartd daemon, run:\n# ${initddir}/SMART/SMART start\n#"
@echo -e "# To automatically start smartd on bootup, add the line:\n# SMARTd=-YES-\n# to /etc/hostconfig\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"
else
initd_DATA = smartd.initd
smartd.initd: $(srcdir)/smartd.initd.in Makefile
sed "s|/usr/local/sbin/|$(sbindir)/|g" $(srcdir)/smartd.initd.in > $@
initd_install_name = smartd$(smartd_suffix)
initd_DATA_install = install-initdDATA-generic
install-initdDATA-generic: $(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"
endif
install-initdDATA : $(initd_DATA_install)
uninstall-initdDATA:
rm -rf $(DESTDIR)$(initddir)/$(initd_install_name)
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/local/share/man/|$(mandir)/|g" | \
sed "s|/usr/local/sbin/|$(sbindir)/|g" | \
sed "s|/usr/local/etc/rc\\.d/init.d/|$(initddir)/|g" | \
sed "s|/usr/local/share/doc/smartmontools-5.1/|$(docsdir)/|g" | \
sed "s|/usr/local/etc/smartd\\.conf|$(sysconfdir)/smartd.conf|g" > $@
# Commands to convert man pages into .html and .txt
# TODO: configure
MAN2HTML = man2html
#MAN2HTML = groff -man -Thtml
MAN2TXT = groff -man -Tascii -P'-bcou'
# Fix links in man2html output
FIXHTML = sed 's,<A HREF="http://[-a-z/]*/man2html?\([1-8]\)+\(smart[cd][.a-z]*\)">,<A HREF="\2.\1.html">,g' \
| sed 's,<A HREF="http://[-a-z/]*/man2html">,<A HREF=".">,g' \
| sed 's,<A HREF="http://[-a-z/]*/man2html?[^"]*">\([^<]*\)</A>,\1,g' \
| sed 's,<A HREF="mailto:[^s][^m][^a][^"]*">\([^<]*\)</A>,\1,g'
# Convert man pages into .html and .txt
htmlman: smartctl.8.html smartd.8.html smartd.conf.5.html
txtman: smartctl.8.txt smartd.8.txt smartd.conf.5.txt
%.5.html: %.5
$(MAN2HTML) $< | $(FIXHTML) > $@
%.8.html: %.8
$(MAN2HTML) $< | $(FIXHTML) > $@
%.5.txt: %.5
$(MAN2TXT) $< > $@
%.8.txt: %.8
$(MAN2TXT) $< > $@
if OS_WIN32_MINGW
# Definitions for Windows distribution
distdir_win32 = $(PACKAGE)-$(VERSION).win32
distzip_win32 = $(PACKAGE)-$(VERSION).win32.zip
exedir_win32 = $(distdir_win32)/bin
docdir_win32 = $(distdir_win32)/doc
FILES_WIN32 = $(exedir_win32)/smartctl.exe \
$(exedir_win32)/smartd.exe \
$(docdir_win32)/AUTHORS.txt \
$(docdir_win32)/CHANGELOG.txt \
$(docdir_win32)/COPYING.txt \
$(docdir_win32)/INSTALL.txt \
$(docdir_win32)/NEWS.txt \
$(docdir_win32)/README.txt \
$(docdir_win32)/TODO.txt \
$(docdir_win32)/WARNINGS.txt \
$(docdir_win32)/smartd.conf \
$(docdir_win32)/smartctl.8.html \
$(docdir_win32)/smartctl.8.txt \
$(docdir_win32)/smartd.8.html \
$(docdir_win32)/smartd.8.txt \
$(docdir_win32)/smartd.conf.5.html \
$(docdir_win32)/smartd.conf.5.txt
CLEANFILES += $(FILES_WIN32) $(exedir_win32)/syslogevt.exe distdir.mkdir syslogevt.check
# Textfile converter from cygutils
UNIX2DOS = unix2dos -D
# Build Windows distribution
dist-win32: $(distzip_win32)
distdir-win32: distdir.mkdir $(FILES_WIN32) syslogevt.check
$(distzip_win32): distdir.mkdir $(FILES_WIN32) syslogevt.check
@rm -fv $(distzip_win32)
cd $(distdir_win32) && zip -9Dr ../$(distzip_win32) .
cleandist-win32:
rm -rf $(distdir_win32) distdir.mkdir syslogevt.check
distdir.mkdir:
@test -d $(exedir_win32) || mkdir -pv $(exedir_win32)
@test -d $(docdir_win32) || mkdir -pv $(docdir_win32)
touch $@
syslogevt.check:
@if [ -f $(srcdir)/os_win32/syslogevt.exe ]; then \
cp -pv $(srcdir)/os_win32/syslogevt.exe $(exedir_win32)/syslogevt.exe; \
else echo "Warning: $(srcdir)/os_win32/syslogevt.exe missing."; fi
touch $@
$(exedir_win32)/%.exe: %.exe
cp -p $< $@
strip -s $@
touch -r $< $@
$(docdir_win32)/%: %
$(UNIX2DOS) < $< > $@
touch -r $< $@
$(docdir_win32)/%.txt: $(srcdir)/%
$(UNIX2DOS) < $< > $@
touch -r $< $@
$(docdir_win32)/%.conf: $(srcdir)/%.conf
$(UNIX2DOS) < $< > $@
touch -r $< $@
# Build config_vc6.h for MSVC 6 from MinGW config.h
config-vc6: $(srcdir)/os_win32/config_vc6.h
$(srcdir)/os_win32/config_vc6.h: config.h
sed '1i/* config_vc6.h. Generated by Makefile. */' $< | \
sed 's,^#define HAVE_\(ATTR_PACKED\|INTTYPES_H\|STDINT_H\|STRTOULL\|U*INT64_T\|UNISTD_H\) 1$$,/* #undef HAVE_\1 */,' | \
sed 's,i.86-pc-mingw32,i686-pc-win32vc6,' > $@
endif
SUBDIRS= . examplescripts
|