1 ## Process this file with automake to produce Makefile.in
4 # $Id: Makefile.am 4299 2016-04-16 19:45:57Z chrfranke $
6 # $Id: Makefile.am 4102 2015-06-01 19:25:47Z chrfranke $
7 >>>>>>> 3d8ad6fa4529eb02ae1391a1e937bf57aad3fb74
12 ACLOCAL_AMFLAGS = -I m4
14 # Make sure .cpp takes precedence to avoid compiling old .c file
15 SUFFIXES = .cpp .c .s .o
17 # BUILD_INFO can be provided by package maintainers (see INSTALL file)
18 BUILD_INFO= "(local build)"
21 -DBUILD_INFO='$(BUILD_INFO)' \
22 -DSMARTMONTOOLS_SYSCONFDIR='"$(sysconfdir)"' \
23 -DSMARTMONTOOLS_SMARTDSCRIPTDIR='"$(smartdscriptdir)"'
26 AM_CPPFLAGS += -DSMARTMONTOOLS_DRIVEDBDIR='"$(drivedbdir)"'
29 AM_CPPFLAGS += -DSMARTMONTOOLS_SAVESTATES='"$(savestates)"'
31 if ENABLE_ATTRIBUTELOG
32 AM_CPPFLAGS += -DSMARTMONTOOLS_ATTRIBUTELOG='"$(attributelog)"'
36 AM_CPPFLAGS += -I$(srcdir)/os_win32
39 AM_CPPFLAGS += -I$(srcdir)/getopt -DHAVE_GETOPT_LONG -D__GNU_LIBRARY__
42 AM_CPPFLAGS += -I$(srcdir)/regex
49 if ENABLE_UPDATE_SMART_DRIVEDB
52 sbin_SCRIPTS = update-smart-drivedb
89 smartctl_LDADD = $(os_deps) $(os_libs)
90 smartctl_DEPENDENCIES = $(os_deps)
92 EXTRA_smartctl_SOURCES = \
122 smartctl_LDADD += smartctl_res.o $(os_win32_manifest)
123 smartctl_DEPENDENCIES += smartctl_res.o $(os_win32_manifest)
134 dev_ata_cmd_set.cpp \
151 smartd_LDADD = $(os_deps) $(os_libs) $(CAPNG_LDADD)
152 smartd_DEPENDENCIES = $(os_deps)
154 EXTRA_smartd_SOURCES = \
180 freebsd_nvme_ioctl.h \
186 os_win32/daemon_win32.cpp \
187 os_win32/daemon_win32.h \
188 os_win32/syslog_win32.cpp \
191 smartd_LDADD += smartd_res.o $(os_win32_manifest)
192 smartd_DEPENDENCIES += smartd_res.o $(os_win32_manifest)
196 # Exclude from source tarball
197 nodist_EXTRA_smartctl_SOURCES = os_solaris_ata.s
198 nodist_EXTRA_smartd_SOURCES = os_solaris_ata.s
202 smartctl_SOURCES += \
216 smartctl_SOURCES += \
219 regex/regex_internal.h
224 regex/regex_internal.h
226 # Included by regex.c:
227 EXTRA_smartctl_SOURCES += \
230 regex/regex_internal.c
232 EXTRA_smartd_SOURCES += \
235 regex/regex_internal.c
241 smartctl_SOURCES += \
243 os_win32/wmiquery.cpp \
248 os_win32/wmiquery.cpp \
251 smartctl_LDADD += -lole32 -loleaut32
252 smartd_LDADD += -lole32 -loleaut32
257 # This block is required because Solaris uses manual page section 1m
258 # for administrative command (linux/freebsd use section 8) and Solaris
259 # uses manual page section 4 for file formats (linux/freebsd use
260 # section 5). Automake can deal cleanly with man page sections 1-8
261 # and n, but NOT with sections of the form 1m.
262 extra_MANS = smartd.conf.4 \
265 if ENABLE_UPDATE_SMART_DRIVEDB
266 extra_MANS += update-smart-drivedb.1m
269 all-local: $(extra_MANS)
270 install-man: $(extra_MANS)
273 $(MKDIR_P) '$(DESTDIR)$(mandir)/man4'
274 $(MKDIR_P) '$(DESTDIR)$(mandir)/man1m'
276 $(mkinstalldirs) '$(DESTDIR)$(mandir)/man4'
277 $(mkinstalldirs) '$(DESTDIR)$(mandir)/man1m'
278 >>>>>>> 3d8ad6fa4529eb02ae1391a1e937bf57aad3fb74
279 for i in $(extra_MANS); do \
280 if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
282 ext=`echo $$i | sed -e 's/^.*\\.//'`; \
283 inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
284 inst=`echo $$inst | sed -e 's/^.*\///'`; \
285 inst=`echo $$inst | sed '$(transform)'`.$$ext; \
286 echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(mandir)/man$$ext/$$inst'"; \
287 $(INSTALL_DATA) "$$file" "$(DESTDIR)$(mandir)/man$$ext/$$inst"; \
291 for i in $(extra_MANS); do \
292 if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
294 ext=`echo $$i | sed -e 's/^.*\\.//'`; \
295 inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
296 inst=`echo $$inst | sed -e 's/^.*\///'`; \
297 inst=`echo $$inst | sed '$(transform)'`.$$ext; \
298 echo " rm -f '$(DESTDIR)$(mandir)/man$$ext/$$inst'"; \
299 rm -f "$(DESTDIR)$(mandir)/man$$ext/$$inst"; \
302 # For systems that adopts traditional manner
304 man_MANS = smartd.conf.5 \
308 if ENABLE_UPDATE_SMART_DRIVEDB
309 man_MANS += update-smart-drivedb.8
326 examplesdir=$(exampledir)
328 examplescripts/README
330 examplescripts/Example1 \
331 examplescripts/Example2 \
332 examplescripts/Example3 \
333 examplescripts/Example4 \
334 examplescripts/Example5 \
335 examplescripts/Example6
337 sysconf_DATA = smartd.conf
339 # If modified smartd.conf exists install smartd.conf.sample instead
340 install-sysconfDATA: $(sysconf_DATA)
342 $(MKDIR_P) '$(DESTDIR)$(sysconfdir)'
344 $(mkinstalldirs) '$(DESTDIR)$(sysconfdir)'
345 >>>>>>> 3d8ad6fa4529eb02ae1391a1e937bf57aad3fb74
346 @s="$(srcdir)/smartd.conf"; \
347 f="$(DESTDIR)$(sysconfdir)/smartd.conf$(smartd_suffix)"; \
348 if test -z "$(smartd_suffix)" && test -f "$$f"; then \
349 if cmp "$$s" "$$f" >/dev/null 2>/dev/null; then :; else \
350 echo "************************************************************"; \
351 echo "*** $$f preserved"; \
352 echo "*** installing smartd.conf.sample instead"; \
353 echo "************************************************************"; \
357 echo " $(INSTALL_DATA) '$$s' '$$f'"; \
358 $(INSTALL_DATA) "$$s" "$$f"
360 # If smartd.conf.sample exists preserve smartd.conf
361 uninstall-sysconfDATA:
362 @f="$(DESTDIR)$(sysconfdir)/smartd.conf$(smartd_suffix)"; \
363 if test -z "$(smartd_suffix)" && test -f "$$f".sample; then \
364 echo "************************************************************"; \
365 echo "*** $$f preserved"; \
366 echo "*** removing smartd.conf.sample instead"; \
367 echo "************************************************************"; \
370 echo " rm -f '$$f'"; \
373 smartdscript_SCRIPTS = smartd_warning.sh
378 smartd.freebsd.initd.in \
384 smartd_warning.sh.in \
385 update-smart-drivedb.in \
386 update-smart-drivedb.8.in \
388 os_darwin/com.smartmontools.smartd.plist.in \
389 os_darwin/pkg/PackageInfo.in \
390 os_darwin/pkg/Distribution.in \
391 os_darwin/pkg/installer/README.html \
392 os_darwin/pkg/root/usr/local/sbin/smart-pkg-uninstall \
393 os_win32/default.manifest \
394 os_win32/installer.nsi \
396 os_win32/smartctl_res.rc.in \
397 os_win32/smartd_res.rc.in \
398 os_win32/smartd_warning.cmd \
399 os_win32/syslogevt.mc \
400 os_win32/update-smart-drivedb.nsi \
401 os_win32/wbemcli_small.h \
402 os_win32/wtssendmsg.c \
418 smartctl.8.html.tmp \
421 smartd.conf.5.html.tmp \
424 smartd.freebsd.initd \
428 update-smart-drivedb \
429 update-smart-drivedb.8 \
430 update-smart-drivedb.1m \
433 # 'make maintainer-clean' also removes files generated by './autogen.sh'
434 MAINTAINERCLEANFILES = \
435 $(srcdir)/Makefile.in \
436 $(srcdir)/aclocal.m4 \
438 $(srcdir)/configure \
439 $(srcdir)/config.guess \
440 $(srcdir)/config.h.in \
441 $(srcdir)/config.h.in~ \
442 $(srcdir)/config.sub \
444 $(srcdir)/install-sh \
448 utility.o: svnversion.h
451 # Get version info from SVN
452 svnversion.h: ChangeLog Makefile $(svn_deps)
453 @echo ' svn info | $$(VERSION_FROM_SVN_INFO) > $@'
454 @echo '/* svnversion.h. Generated by Makefile from svn info. */' > $@
456 && svnversion 2>/dev/null | sed -n 's,^\([0-9].*\),REV "\1",p' \
457 && TZ= LC_ALL=C svn info 2>/dev/null \
458 | sed -n 'h;s,^.* Date: *\([^ ]*\) .*$$,DATE "\1",p;g;s,^.* Date: *[^ ]* *\([^ ]*\) .*$$,TIME "\1",p') \
459 | sed 's,^,#define SMARTMONTOOLS_SVN_,' >> $@
462 # SVN not available, guess version info from Id strings
463 svnversion.h: ChangeLog Makefile NEWS
464 @echo ' cat ChangeLog NEWS $$(SOURCES) | $$(VERSION_FROM_SVN_IDS) > $@'
465 @echo '/* svnversion.h. Generated by Makefile from Id strings. */' > $@
466 @(cd $(srcdir) && cat ChangeLog NEWS Makefile.am configure.ac smart*.in *.cpp *.h) \
467 | sed -n 's,^.*\$$[I][d]: [^ ]* \([0-9][0-9]* [0-9][-0-9]* [0-9][:0-9]*\)[^:0-9][^$$]*\$$.*$$,\1,p' \
469 | sed -n 'h;s,^\([^ ]*\) .*$$,REV "\1",p;g;s,^[^ ]* \([^ ]*\) .*$$,DATE "\1",p;g;s,^[^ ]* [^ ]* \([^ ]*\)$$,TIME "\1",p;q' \
470 | sed 's,^,#define SMARTMONTOOLS_SVN_,' >> $@
475 drivedb_DATA = drivedb.h
478 update-smart-drivedb: update-smart-drivedb.in config.status
479 $(SHELL) ./config.status --file=$@
482 smartd_warning.sh: smartd_warning.sh.in config.status
483 $(SHELL) ./config.status --file=$@
486 if INSTALL_INITSCRIPT
488 initd_DATA = com.smartmontools.smartd.plist
490 initd_DATA_install = install-initdDATA-darwin
491 initd_DATA_uninstall = uninstall-initdDATA-darwin
493 com.smartmontools.smartd.plist : os_darwin/com.smartmontools.smartd.plist.in
494 sed "s|/usr/sbin/|$(sbindir)/|" $< > $@
496 install-initdDATA-darwin: $(initd_DATA)
497 $(MKDIR_P) '$(DESTDIR)$(initddir)'
498 $(INSTALL_DATA) $(top_builddir)/$(initd_DATA) $(DESTDIR)$(initddir)/$(initd_DATA)
500 uninstall-initdDATA-darwin:
501 rm -f $(DESTDIR)$(initddir)/$(initd_DATA)
505 initd_DATA = $(initdfile)
507 $(initdfile): $(srcdir)/$(initdfile).in Makefile
508 sed 's|/usr/local/sbin/|$(sbindir)/|g' $(srcdir)/$(initdfile).in > $@
510 initd_install_name = smartd$(smartd_suffix)
512 initd_DATA_install = install-initdDATA-generic
513 initd_DATA_uninstall = uninstall-initdDATA-generic
515 install-initdDATA-generic: $(initd_DATA)
517 $(MKDIR_P) '$(DESTDIR)$(initddir)'
519 $(mkinstalldirs) '$(DESTDIR)$(initddir)'
520 >>>>>>> 3d8ad6fa4529eb02ae1391a1e937bf57aad3fb74
521 $(INSTALL_SCRIPT) '$(top_builddir)/$(initdfile)' '$(DESTDIR)$(initddir)/smartd$(smartd_suffix)'
523 uninstall-initdDATA-generic:
524 rm -f '$(DESTDIR)$(initddir)/$(initd_install_name)'
528 initd_DATA_install = install-initdDATA-null
529 initd_DATA_uninstall = uninstall-initdDATA-null
531 install-initdDATA-null:
532 uninstall-initdDATA-null:
535 install-initdDATA : $(initd_DATA_install)
537 uninstall-initdDATA: $(initd_DATA_uninstall)
539 if INSTALL_SYSTEMDUNIT
540 systemdsystemunit_DATA = smartd.service
543 smartd.service: smartd.service.in Makefile
545 @echo ' $$(SMARTD_SERVICE_FILTER) < $(srcdir)/smartd.service.in > $@'
548 @echo ' cat $(srcdir)/smartd.service.in | $$(SMARTD_SERVICE_FILTER) > $@'
549 @cat $(srcdir)/smartd.service.in | \
550 >>>>>>> 3d8ad6fa4529eb02ae1391a1e937bf57aad3fb74
551 sed 's|/usr/local/sbin/smartd|$(sbindir)/smartd|' | \
552 if test -n '$(systemdenvfile)'; then \
553 sed 's|/usr/local/etc/sysconfig/smartmontools|$(systemdenvfile)|'; \
555 sed -e '/^EnvironmentFile=/d' -e 's| *\$$smartd[_a-z]* *||g'; \
556 fi; } < $(srcdir)/smartd.service.in > $@
559 # Create empty directories if configured.
560 # Default install rules no longer create empty directories since automake 1.11.
562 @for d in '$(smartdplugindir)' '$(savestatesdir)' '$(attributelogdir)'; do \
563 test -n "$$d" || continue; \
565 echo " $(MKDIR_P) '$(DESTDIR)$$d'"; \
566 $(MKDIR_P) "$(DESTDIR)$$d" || exit 1; \
568 echo " $(mkinstalldirs) '$(DESTDIR)$$d'"; \
569 $(mkinstalldirs) "$(DESTDIR)$$d" || exit 1; \
570 >>>>>>> 3d8ad6fa4529eb02ae1391a1e937bf57aad3fb74
573 install-data-local: installdirs-local
582 >>>>>>> 3d8ad6fa4529eb02ae1391a1e937bf57aad3fb74
583 sed -e 's|CURRENT_SVN_VERSION|$(releaseversion)|g' \
584 -e "s|CURRENT_SVN_DATE|`sed -n 's,^.*DATE[^"]*"\([^"]*\)".*$$,\1,p' svnversion.h`|g" \
585 -e "s|CURRENT_SVN_REV|`sed -n 's,^.*REV[^"]*"\([^"]*\)".*$$,r\1,p' svnversion.h`|g" \
586 -e 's|/usr/local/share/man/|$(mandir)/|g' \
587 -e 's|/usr/local/sbin/|$(sbindir)/|g' \
588 -e 's|/usr/local/share/doc/smartmontools/examplescripts/|!exampledir!|g' \
589 -e 's|/usr/local/share/doc/smartmontools/|$(docsdir)/|g' \
590 -e 's|!exampledir!|$(exampledir)/|g' \
591 -e 's|/usr/local/etc/smartd\.conf|$(sysconfdir)/smartd.conf|g' \
592 -e 's|/usr/local/etc/smart_drivedb\.h|$(sysconfdir)/smart_drivedb.h|g' \
593 -e 's|/usr/local/etc/smartd_warning\.sh|$(smartdscriptdir)/smartd_warning.sh|g' \
594 -e 's|\\fBmail\\fP|\\fB$(os_mailer)\\fP|g' \
595 -e 's|\\'\''mail\\'\''|\\'\''$(os_mailer)\\'\''|g' \
596 -e 's|/usr/bin/mail|/usr/bin/$(os_mailer)|g' \
597 -e 's|RELEASE_6_0_DRIVEDB|$(DRIVEDB_BRANCH)|g' | \
598 if test -n '$(drivedbdir)'; then \
599 sed 's|/usr/local/share/smartmontools/drivedb\.h|$(drivedbdir)/drivedb.h|g' ; \
601 sed '/^\.\\" %IF ENABLE_DRIVEDB/,/^\.\\" %ENDIF ENABLE_DRIVEDB/ s,^,.\\"\# ,' ; \
604 if test '$(with_update_smart_drivedb)' = 'yes'; then \
607 sed '/^\.\\" %IF ENABLE_UPDATE_SMART_DRIVEDB/,/^\.\\" %ENDIF ENABLE_UPDATE_SMART_DRIVEDB/ s,^,.\\"\# ,' ; \
610 >>>>>>> 3d8ad6fa4529eb02ae1391a1e937bf57aad3fb74
611 if test -n '$(initddir)'; then \
612 sed 's|/usr/local/etc/rc\.d/init\.d/|$(initddir)/|g' ; \
614 sed '/^\.\\" %IF ENABLE_INITSCRIPT/,/^\.\\" %ENDIF ENABLE_INITSCRIPT/ s,^,.\\"\# ,' ; \
616 if test -n '$(savestates)'; then \
617 sed 's|/usr/local/var/lib/smartmontools/smartd\.|$(savestates)|g' ; \
619 sed '/^\.\\" %IF ENABLE_SAVESTATES/,/^\.\\" %ENDIF ENABLE_SAVESTATES/ s,^,.\\"\# ,' ; \
621 if test -n '$(attributelog)'; then \
622 sed 's|/usr/local/var/lib/smartmontools/attrlog\.|$(attributelog)|g' ; \
624 sed '/^\.\\" %IF ENABLE_ATTRIBUTELOG/,/^\.\\" %ENDIF ENABLE_ATTRIBUTELOG/ s,^,.\\"\# ,' ; \
626 if test -n '$(smartdplugindir)'; then \
627 sed 's|/usr/local/etc/smartd_warning\.d|$(smartdplugindir)|g' ; \
629 sed '/^\.\\" %IF ENABLE_SMARTDPLUGINDIR/,/^\.\\" %ENDIF ENABLE_SMARTDPLUGINDIR/ s,^,.\\"\# ,' ; \
631 if test -n '$(CAPNG_LDADD)'; then \
634 sed '/^\.\\" %IF ENABLE_CAPABILITIES/,/^\.\\" %ENDIF ENABLE_CAPABILITIES/ s,^,.\\"\# ,' ; \
637 if test '$(with_nvme_devicescan)' = 'yes'; then \
640 sed '/^\.\\" %IF ENABLE_NVME_DEVICESCAN/,/^\.\\" %ENDIF ENABLE_NVME_DEVICESCAN/ s,^,.\\"\# ,' ; \
643 >>>>>>> 3d8ad6fa4529eb02ae1391a1e937bf57aad3fb74
644 if test -n '$(os_man_filter)'; then \
645 sed -e 's,OS_MAN_FILTER,$(os_man_filter),g' \
646 -e '/^\.\\" %IF NOT OS .*$(os_man_filter)/,/^.\\" %ENDIF NOT OS .*$(os_man_filter)/ s,^,.\\"\# ,' \
647 -e '/^\.\\" %IF OS .*$(os_man_filter)/,/^\.\\" %ENDIF OS .*$(os_man_filter)/ s,^,!!,' \
648 -e '/^\.\\" %IF OS ./,/^\.\\" %ENDIF OS ./ s,^,.\\"\# ,' \
649 -e '/^!*\.\\" %IF NOT OS ./,/^!*\.\\" %ENDIF NOT OS ./ s,^,!!,' \
650 -e 's,^!!!*\.\\"! \(.*\)$$,\1 \\"\#,' \
656 # Implicit rule 'smart%: smart%.in ...' does not work with BSD make
657 smartctl.8: smartctl.8.in Makefile svnversion.h
658 @echo ' $$(MAN_FILTER) < $(srcdir)/smartctl.8.in > $@'
659 @$(MAN_FILTER) < $(srcdir)/smartctl.8.in > $@
661 smartd.8: smartd.8.in Makefile svnversion.h
662 @echo ' $$(MAN_FILTER) < $(srcdir)/smartd.8.in > $@'
663 @$(MAN_FILTER) < $(srcdir)/smartd.8.in > $@
665 smartd.conf.5: smartd.conf.5.in Makefile svnversion.h
666 @echo ' $$(MAN_FILTER) < $(srcdir)/smartd.conf.5.in > $@'
667 @$(MAN_FILTER) < $(srcdir)/smartd.conf.5.in > $@
669 update-smart-drivedb.8: update-smart-drivedb.8.in Makefile svnversion.h
670 @echo ' $$(MAN_FILTER) < $(srcdir)/update-smart-drivedb.8.in > $@'
671 @$(MAN_FILTER) < $(srcdir)/update-smart-drivedb.8.in > $@
673 # Build Solaris specific man pages
674 SOLARIS_MAN_FILTER = \
675 sed -e '/^\.TH/s, \([58]\) , !!\1!! ,' \
676 -e '/^\.BR/s, (\([578]\)), (!!\1!!),' \
677 -e 's,\\fP(\([578]\)),\\fP(!!\1!!),g' \
678 -e 's,!!5!!,4,g' -e 's,!!7!!,5,g' -e 's,!!8!!,1m,g' \
679 -e 's,/var/log/messages,/var/adm/messages,g'
681 smartctl.1m: smartctl.8
682 @echo ' $$(SOLARIS_MAN_FILTER) < smartctl.8 > $@'
683 @$(SOLARIS_MAN_FILTER) < smartctl.8 > $@
686 @echo ' $$(SOLARIS_MAN_FILTER) < smartd.8 > $@'
687 @$(SOLARIS_MAN_FILTER) < smartd.8 > $@
689 smartd.conf.4: smartd.conf.5
690 @echo ' $$(SOLARIS_MAN_FILTER) < smartd.conf.5 > $@'
691 @$(SOLARIS_MAN_FILTER) < smartd.conf.5 > $@
693 update-smart-drivedb.1m: update-smart-drivedb.8
694 @echo ' $$(SOLARIS_MAN_FILTER) < update-smart-drivedb.8 > $@'
695 @$(SOLARIS_MAN_FILTER) < update-smart-drivedb.8 > $@
698 # Commands to convert man pages into .html and .txt
701 #MAN2HTML = groff -man -Thtml
702 MAN2TXT = groff -man -Tascii -P'-bcou'
704 # Remove HTTP header and fix links in man2html output
705 FIXHTML = sed -e '1s,^Content-type.*,,' \
706 -e 's,<A HREF="[^"]*/man2html?\([1-8]\)+\(smart[cd][.a-z]*\)">,<A HREF="\2.\1.html">,g' \
707 -e 's,<A HREF="[^"]*/man2html">,<A HREF=".">,g' \
708 -e 's,<A HREF="[^"]*/man2html?[^"]*">\([^<]*\)</A>,\1,g' \
709 -e 's,<A HREF="mailto:[^s][^m][^a][^"]*">\([^<]*\)</A>,\1,g'
711 # Convert man pages into .html and .txt
713 htmlman: smartctl.8.html smartd.8.html smartd.conf.5.html
715 txtman: smartctl.8.txt smartd.8.txt smartd.conf.5.txt
718 $(MAN2HTML) $< > $@.tmp
719 @echo ' $$(FIXHTML) < $@.tmp > $@'
720 @$(FIXHTML) < $@.tmp > $@
723 $(MAN2HTML) $< > $@.tmp
724 @echo ' $$(FIXHTML) < $@.tmp > $@'
725 @$(FIXHTML) < $@.tmp > $@
734 # Check drive database syntax
736 @if ./smartctl -B $(srcdir)/drivedb.h -P showall >/dev/null; then \
737 echo "$(srcdir)/drivedb.h: OK"; \
739 echo "$(srcdir)/drivedb.h: Syntax check failed"; exit 1; \
746 smartctl_res.o: smartctl_res.rc
749 smartd_res.o: smartd_res.rc syslogevt.rc
752 # Convert version for VERSIONINFO resource: 6.1 r3754 -> 6.1.0.3754, set Copyright year
754 ver=`echo '$(PACKAGE_VERSION).0' | sed -n 's,^\([0-9]*\.[0-9]*\.[0-9]*\).*$$,\1,p'` && \
755 rev=`sed -n 's,^.*REV[^"]*"\([0-9]*\).*$$,\1,p' svnversion.h` && \
756 txtver="$${ver:-0.0.0}.$${rev:-0}" && binver=`echo "$$txtver" | sed 's|\.|,|g'` && \
757 yy=`sed -n 's,^.*DATE[^"]*"20\([0-9][0-9]\).*$$,\1,p' svnversion.h` && yy="$${yy:-XX}" && \
758 sed -e "s|@BINARY_VERSION@|$$binver|g" -e "s|@TEXT_VERSION@|$$txtver|g" -e "s|@YY@|$$yy|g"; }
760 smartctl_res.rc: os_win32/smartctl_res.rc.in Makefile svnversion.h
761 @echo ' $$(WIN_RC_FILTER) < $< > $@'
762 @$(WIN_RC_FILTER) < $< > $@
764 smartd_res.rc: os_win32/smartd_res.rc.in Makefile svnversion.h
765 @echo ' $$(WIN_RC_FILTER) < $< > $@'
766 @$(WIN_RC_FILTER) < $< > $@
768 syslogevt.rc: os_win32/syslogevt.mc
771 # Application manifests
773 default.manifest.o: os_win32/default.manifest
774 echo '1 24 "$<"' | $(WINDRES) -J rc -o $@
776 defadmin.manifest.o: defadmin.manifest
777 echo '1 24 "$<"' | $(WINDRES) -J rc -o $@
779 defadmin.manifest: os_win32/default.manifest
780 sed 's,"asInvoker","requireAdministrator",' $< > $@
782 # Definitions for Windows distribution
790 distdir_win32 = $(PACKAGE)-$(VERSION).win$(win_bits)
791 distzip_win32 = $(PACKAGE)-$(VERSION).win$(win_bits).zip
792 distinst_win32 = $(PACKAGE)-$(VERSION).win$(win_bits)-setup.exe
794 exedir_win32 = $(distdir_win32)/bin
795 docdir_win32 = $(distdir_win32)/doc
798 $(exedir_win32)/smartctl.exe \
799 $(exedir_win32)/smartctl-nc.exe \
800 $(exedir_win32)/smartd.exe \
801 $(exedir_win32)/smartd_warning.cmd \
802 $(exedir_win32)/runcmda.exe \
803 $(exedir_win32)/runcmdu.exe \
804 $(exedir_win32)/wtssendmsg.exe
809 $(exedir_win32)/update-smart-drivedb.exe
815 $(docdir_win32)/AUTHORS.txt \
816 $(docdir_win32)/ChangeLog.txt \
817 $(docdir_win32)/ChangeLog-5.0-6.0.txt \
818 $(docdir_win32)/COPYING.txt \
819 $(docdir_win32)/INSTALL.txt \
820 $(docdir_win32)/NEWS.txt \
821 $(docdir_win32)/README.txt \
822 $(docdir_win32)/TODO.txt \
823 $(docdir_win32)/checksums$(win_bits).txt \
824 $(docdir_win32)/smartd.conf \
825 $(docdir_win32)/smartctl.8.html \
826 $(docdir_win32)/smartctl.8.txt \
827 $(docdir_win32)/smartd.8.html \
828 $(docdir_win32)/smartd.8.txt \
829 $(docdir_win32)/smartd.conf.5.html \
830 $(docdir_win32)/smartd.conf.5.txt
834 $(exedir_win32)/drivedb.h
841 runcmda.exe runcmdu.exe \
842 smartctl-nc.exe smartctl-nc.exe.tmp \
843 smartctl_res.rc smartd_res.rc \
845 syslogevt.rc syslogevt_*.bin \
846 update-smart-drivedb.exe \
849 # Note: Only use without options to be compatible with all variants
852 # Build Windows distribution
854 dist-win32: $(distzip_win32)
856 install-win32: $(distinst_win32)
859 installer-win32: $(distinst_win32)
861 distdir-win32: distdir.mkdir $(FILES_WIN32)
863 $(distzip_win32): distdir.mkdir $(FILES_WIN32)
864 @rm -fv $(distzip_win32)
865 cd $(distdir_win32) && zip -9 ../$(distzip_win32) bin/* doc/*
868 sha256sum $@ > $@.sha256
871 # Build NSIS installer
872 # Note: Only option character '-' is also compatible with Linux version of makensis
873 $(distinst_win32): os_win32/installer.nsi distdir.mkdir $(FILES_WIN32)
874 test -z '$(builddir_win64)' || ( cd $(builddir_win64) && make distdir-win32 )
875 @date=`sed -n 's,^.*DATE[^"]*"\([^"]*\)".*$$,\1,p' svnversion.h` && \
876 rev=`sed -n 's,^.*REV[^"]*"\([^"]*\)".*$$,r\1,p' svnversion.h` && \
877 verstr="$(PACKAGE_VERSION) $$date $$rev "$(BUILD_INFO) && \
878 d64= && if [ -n '$(builddir_win64)' ]; then d64='-DINPDIR64=$(builddir_win64)/$(PACKAGE)-$(VERSION).win64'; fi && \
879 echo "'$(MAKENSIS)' -V2 -NOCD -DINPDIR=$(distdir_win32) $$d64 -DOUTFILE=$@ -DVERSTR='$$verstr' $<" && \
880 '$(MAKENSIS)' -V2 -NOCD -DINPDIR=$(distdir_win32) $$d64 -DOUTFILE=$@ -DVERSTR="$$verstr" $<
883 sha256sum $@ > $@.sha256
885 # Build drivedb.h update tool
886 update-smart-drivedb.exe: os_win32/update-smart-drivedb.nsi
887 "$(MAKENSIS)" -V2 -NOCD -DBRANCH=$(DRIVEDB_BRANCH) $<
891 @echo "makensis: command not found. Please install NSIS from http://nsis.sourceforge.net/" 1>&2
896 rm -rf $(distdir_win32) distdir.mkdir
899 @test -d $(exedir_win32) || mkdir -pv $(exedir_win32)
900 @test -d $(docdir_win32) || mkdir -pv $(docdir_win32)
903 $(exedir_win32)/%.exe: %.exe
905 if test -n '$(STRIP)'; then $(STRIP) -s $@; else strip -s $@; fi
908 # strip would break NSIS integrity check
909 $(exedir_win32)/update-smart-drivedb.exe: update-smart-drivedb.exe
912 $(exedir_win32)/%.h: $(srcdir)/%.h
913 $(UNIX2DOS) < $< > $@
916 $(exedir_win32)/%.cmd: $(srcdir)/os_win32/%.cmd
917 $(UNIX2DOS) < $< > $@
920 $(docdir_win32)/%.html: %.html
921 $(UNIX2DOS) < $< > $@
924 $(docdir_win32)/%.txt: %.txt
925 $(UNIX2DOS) < $< > $@
928 $(docdir_win32)/%.txt: $(srcdir)/%
929 $(UNIX2DOS) < $< > $@
932 $(docdir_win32)/%.conf: $(srcdir)/%.conf
933 $(UNIX2DOS) < $< > $@
936 $(docdir_win32)/checksums$(win_bits).txt: $(EXEFILES_WIN32)
937 (cd $(exedir_win32) && md5sum *.exe && sha1sum *.exe && sha256sum *.exe) \
940 # Build non-console version of smartctl for GSmartControl.
941 # The script below changes the word at offset 220 (Subsystem) from 3
942 # (Console) to 2 (GUI) in a copy of smartctl.exe.
943 # This will be changed when a tool (like 'editbin') is available in
944 # the Cygwin distribution
945 smartctl-nc.exe: smartctl.exe
947 cp -p smartctl.exe $@.tmp
948 @if test `od -A n -j 220 -N 2 -d $@.tmp` -eq 3; then :; \
949 else echo "invalid EXE header"; exit 1; fi
950 @echo "editbin /subsystem:windows $@.tmp"
951 @echo -ne '\002' | dd bs=1 seek=220 count=1 conv=notrunc of=$@.tmp 2>/dev/null
952 @if test `od -A n -j 220 -N 2 -d $@.tmp` -eq 2; then :; \
953 else echo "EXE patch failed"; exit 1; fi
956 # Build runcmd?.exe and wtssendmsg.exe
957 runcmd.o: os_win32/runcmd.c
960 runcmdu.exe: runcmd.o $(os_win32_manifest)
963 runcmda.exe: runcmd.o defadmin.manifest.o
966 wtssendmsg.exe: os_win32/wtssendmsg.c $(os_win32_manifest)
967 $(CC) -Os -o $@ $< $(os_win32_manifest) -lwtsapi32
969 # Build os_win32/vc10/{config.h,smart*.rc,svnversion.h} for MSVC10 from MinGW files
971 config-vc10: $(srcdir)/os_win32/vc10/config.h \
972 $(srcdir)/os_win32/vc10/smartctl_res.rc \
973 $(srcdir)/os_win32/vc10/smartd_res.rc \
974 $(srcdir)/os_win32/vc10/svnversion.h
976 $(srcdir)/os_win32/vc10/config.h: config.h Makefile
977 sed -e '1i/* os_win32/vc10/config.h. Generated from config.h by Makefile. */' \
978 -e 's,^#define HAVE_\(ATTR_PACKED\|GETTIMEOFDAY\|INTTYPES_H\|[DK_]*NTDDDISK_H\|STRINGS_H\|STRTOULL\|UNISTD_H\|WORKING_SNPRINTF\) 1$$,/* #undef HAVE_\1 */,' \
979 -e 's,^\(#define SMARTMONTOOLS_BUILD_HOST "[^-]*\)[^"]*,\1-pc-w32vc10,' $< > $@
981 $(srcdir)/os_win32/vc10/svnversion.h: svnversion.h
984 $(srcdir)/os_win32/vc10/smartctl_res.rc: smartctl_res.rc
987 $(srcdir)/os_win32/vc10/smartd_res.rc: smartd_res.rc
992 # Definitions for OSX distribution
993 distdir_darwin = $(PACKAGE)-$(VERSION).darwin
994 dmg_darwin = $(PACKAGE)-$(VERSION).dmg
995 pkg_darwin = $(PACKAGE)-$(VERSION).pkg
997 # build darwin installer
999 ${MAKE} install DESTDIR=$(distdir_darwin)/root
1000 @cp $(srcdir)/os_darwin/pkg/root/usr/local/sbin/smart-pkg-uninstall $(distdir_darwin)/root$(sbindir)
1001 @mkdir -p $(distdir_darwin)/pkg
1002 @( cd $(distdir_darwin)/root && find . | cpio -o --format odc --owner 0:80 | gzip -c ) > $(distdir_darwin)/pkg/Payload
1003 PAYLOAD_FILES=`find $(distdir_darwin)/root | wc -l` &&\
1004 PAYLOAD_SIZEKB=`du -BK -s $(distdir_darwin)/root|${AWK} '{print $$1}'|tr -d 'K'` &&\
1005 sed -e "s|@version@|$(VERSION)|" -e "s|@files@|$${PAYLOAD_FILES}|" \
1006 -e "s|@size@|$${PAYLOAD_SIZEKB}|" $(srcdir)/os_darwin/pkg/PackageInfo.in \
1007 > $(distdir_darwin)/pkg/PackageInfo &&\
1008 sed -e "s|@version@|$(VERSION)|" -e "s|@files@|$${PAYLOAD_FILES}|" -e "s|@size@|$${PAYLOAD_SIZEKB}|" \
1009 -e "s|@pkgname@|$(pkg_darwin)|" \
1010 $(srcdir)/os_darwin/pkg/Distribution.in > $(distdir_darwin)/pkg/Distribution
1011 @mkdir -p $(distdir_darwin)/pkg/Resources/English.lproj
1012 @cp $(srcdir)/COPYING $(distdir_darwin)/pkg/Resources/English.lproj/license.txt
1013 @mkbom -u 0 -g 80 $(distdir_darwin)/root $(distdir_darwin)/pkg/Bom
1014 @mkdir -p $(distdir_darwin)/dmg
1015 @( cd $(distdir_darwin)/pkg && xar --compression none -cf "../dmg/$(pkg_darwin)" * )
1017 # build darwon dmg image
1019 @cp $(srcdir)/os_darwin/pkg/installer/README.html $(distdir_darwin)/dmg
1020 @mkisofs -V 'smartmontools' -no-pad -r -apple -o $(distdir_darwin)/smartmontools-$(VERSION).iso \
1021 -hfs-bless "$(distdir_darwin)/dmg/" "$(distdir_darwin)/dmg/"
1022 @dmg dmg $(distdir_darwin)/smartmontools-$(VERSION).iso $(dmg_darwin)
1024 sha1sum $@ > $@.sha1
1025 sha256sum $@ > $@.sha256
1027 install-darwin: install-darwin-cleanup $(pkg_darwin) $(dmg_darwin)
1029 install-darwin-cleanup:
1030 @rm -rf $(distdir_darwin)