1 ## Process this file with automake to produce Makefile.in
3 # $Id: Makefile.am 3545 2012-05-25 21:19:03Z chrfranke $
8 ACLOCAL_AM_FLAGS = -I m4
10 # Make sure .cpp takes precedence to avoid compiling old .c file
11 SUFFIXES = .cpp .c .s .o
13 # BUILD_INFO can be provided by package maintainers (see INSTALL file)
14 BUILD_INFO= "(local build)"
16 AM_CPPFLAGS = -DBUILD_INFO='$(BUILD_INFO)' -DSMARTMONTOOLS_SYSCONFDIR='"$(sysconfdir)"'
18 AM_CPPFLAGS += -DSMARTMONTOOLS_DRIVEDBDIR='"$(drivedbdir)"'
21 AM_CPPFLAGS += -DSMARTMONTOOLS_SAVESTATES='"$(savestates)"'
23 if ENABLE_ATTRIBUTELOG
24 AM_CPPFLAGS += -DSMARTMONTOOLS_ATTRIBUTELOG='"$(attributelog)"'
28 AM_CPPFLAGS += -I$(srcdir)/os_win32
31 AM_CPPFLAGS += -I$(srcdir)/getopt -DHAVE_GETOPT_LONG -D__GNU_LIBRARY__
34 AM_CPPFLAGS += -I$(srcdir)/regex
37 sbin_PROGRAMS = smartd \
43 sbin_SCRIPTS = update-smart-drivedb
48 smartd_SOURCES = smartd.cpp \
68 smartd_LDADD = @os_deps@ @os_libs@ @CAPNG_LDADD@
69 smartd_DEPENDENCIES = @os_deps@
71 EXTRA_smartd_SOURCES = os_darwin.cpp \
99 os_win32/daemon_win32.cpp \
100 os_win32/daemon_win32.h \
101 os_win32/hostname_win32.cpp \
102 os_win32/hostname_win32.h \
103 os_win32/syslog_win32.cpp \
108 smartctl_SOURCES= smartctl.cpp \
116 dev_ata_cmd_set.cpp \
134 smartctl_LDADD = @os_deps@ @os_libs@
135 smartctl_DEPENDENCIES = @os_deps@
137 EXTRA_smartctl_SOURCES = os_linux.cpp \
160 smartctl_SOURCES += \
174 smartctl_SOURCES += \
177 regex/regex_internal.h
182 regex/regex_internal.h
184 # Included by regex.c:
185 EXTRA_smartctl_SOURCES += \
188 regex/regex_internal.c
190 EXTRA_smartd_SOURCES += \
193 regex/regex_internal.c
199 smartctl_SOURCES += \
201 os_win32/wmiquery.cpp \
206 os_win32/wmiquery.cpp \
209 smartctl_LDADD += -lole32 -loleaut32
210 smartd_LDADD += -lole32 -loleaut32
215 # This block is required because Solaris uses manual page section 1m
216 # for administrative command (linux/freebsd use section 8) and Solaris
217 # uses manual page section 4 for file formats (linux/freebsd use
218 # section 5). Automake can deal cleanly with man page sections 1-8
219 # and n, but NOT with sections of the form 1m.
220 extra_MANS = smartd.conf.4 \
223 install-man: $(extra_MANS)
225 $(mkinstalldirs) $(DESTDIR)$(mandir)/man4
226 $(mkinstalldirs) $(DESTDIR)$(mandir)/man1m
227 for i in $(extra_MANS); do \
228 if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
230 ext=`echo $$i | sed -e 's/^.*\\.//'`; \
231 inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
232 inst=`echo $$inst | sed -e 's/^.*\///'`; \
233 inst=`echo $$inst | sed '$(transform)'`.$$ext; \
234 echo " $(INSTALL_DATA) $$file $(DESTDIR)$(mandir)/man$$ext/$$inst"; \
235 $(INSTALL_DATA) $$file $(DESTDIR)$(mandir)/man$$ext/$$inst; \
239 for i in $(extra_MANS); do \
240 if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
242 ext=`echo $$i | sed -e 's/^.*\\.//'`; \
243 inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
244 inst=`echo $$inst | sed -e 's/^.*\///'`; \
245 inst=`echo $$inst | sed '$(transform)'`.$$ext; \
246 echo " rm -f $(DESTDIR)$(mandir)/man$$ext/$$inst"; \
247 rm -f $(DESTDIR)$(mandir)/man$$ext/$$inst; \
250 awk '/^.TH/ {$$3="1m"} {print}' < $< | \
251 sed -e 's/smartd\.conf\(.*\)(5)/smartd.conf\1(4)/g' \
252 -e 's/syslog\.conf\(.*\)(5)/syslog.conf\1(4)/g' \
253 -e 's/smartctl\(.*\)(8)/smartctl\1(1m)/g' \
254 -e 's/syslogd\(.*\)(8)/syslogd\1(1m)/g' \
255 -e 's|/var/log/messages|/var/adm/messages|g' \
256 -e 's/smartd\(.*\)(8)/smartd\1(1m)/g' > $@
258 awk '/^.TH/ {$$3="4"} {print}' < $< | \
259 sed -e 's/smartd\.conf\(.*\)(5)/smartd.conf\1(4)/g' \
260 -e 's/syslog\.conf\(.*\)(5)/syslog.conf\1(4)/g' \
261 -e 's/smartctl\(.*\)(8)/smartdctl\1(1m)/g' \
262 -e 's/syslogd\(.*\)(8)/syslogd\1(1m)/g' \
263 -e 's|/var/log/messages|/var/adm/messages|g' \
264 -e 's/smartd\(.*\)(8)/smartd\1(1m)/g' > $@
266 # For systems that adopts traditional manner
267 man_MANS = smartd.conf.5 \
273 docs_DATA = AUTHORS \
283 examplesdir=$(exampledir)
285 examplescripts/README
287 examplescripts/Example1 \
288 examplescripts/Example2 \
289 examplescripts/Example3 \
290 examplescripts/Example4
292 sysconf_DATA = smartd.conf
294 # If modified smartd.conf exists install smartd.conf.sample instead
295 install-sysconfDATA: $(sysconf_DATA)
296 $(mkinstalldirs) $(DESTDIR)$(sysconfdir)
297 @s="$(srcdir)/smartd.conf"; \
298 f="$(DESTDIR)$(sysconfdir)/smartd.conf$(smartd_suffix)"; \
299 if test -z "$(smartd_suffix)" && test -f "$$f"; then \
300 if cmp "$$s" "$$f" >/dev/null 2>/dev/null; then :; else \
301 echo "************************************************************"; \
302 echo "*** $$f preserved"; \
303 echo "*** installing smartd.conf.sample instead"; \
304 echo "************************************************************"; \
308 echo " $(INSTALL_DATA) $$s $$f"; \
309 $(INSTALL_DATA) "$$s" "$$f"
311 # If smartd.conf.sample exists preserve smartd.conf
312 uninstall-sysconfDATA:
313 @f="$(DESTDIR)$(sysconfdir)/smartd.conf$(smartd_suffix)"; \
314 if test -z "$(smartd_suffix)" && test -f "$$f".sample; then \
315 echo "************************************************************"; \
316 echo "*** $$f preserved"; \
317 echo "*** removing smartd.conf.sample instead"; \
318 echo "************************************************************"; \
327 smartd.freebsd.initd.in \
333 update-smart-drivedb.in \
336 os_darwin/StartupParameters.plist \
337 os_darwin/English_Localizable.strings \
338 os_win32/installer.nsi \
340 os_win32/runcmda.exe.manifest \
341 os_win32/runcmdu.exe.manifest \
342 os_win32/syslogevt.c \
343 os_win32/syslogevt.mc \
344 os_win32/update-smart-drivedb.nsi \
345 os_win32/wbemcli_small.h \
364 smartd.freebsd.initd \
367 update-smart-drivedb \
370 # 'make maintainer-clean' also removes files generated by './autogen.sh'
371 MAINTAINERCLEANFILES = \
372 $(srcdir)/Makefile.in \
373 $(srcdir)/aclocal.m4 \
374 $(srcdir)/configure \
375 $(srcdir)/config.guess \
376 $(srcdir)/config.h.in \
377 $(srcdir)/config.h.in~ \
378 $(srcdir)/config.sub \
380 $(srcdir)/install-sh \
382 $(srcdir)/mkinstalldirs \
385 utility.o: svnversion.h
388 # Get version info from SVN
389 svnversion.h: CHANGELOG Makefile $(svn_deps)
390 echo '/* svnversion.h. Generated by Makefile from svn info. */' > $@
392 && svnversion 2>/dev/null | sed -n 's,^\([0-9].*\),REV "\1",p' \
393 && TZ= LC_ALL=C svn info 2>/dev/null \
394 | sed -n 'h;s,^.* Date: *\([^ ]*\) .*$$,DATE "\1",p;g;s,^.* Date: *[^ ]* *\([^ ]*\) .*$$,TIME "\1",p') \
395 | sed 's,^,#define SMARTMONTOOLS_SVN_,' >> $@
398 # SVN not available, guess version info from Id strings
399 svnversion.h: CHANGELOG Makefile
400 echo '/* svnversion.h. Generated by Makefile from Id strings. */' > $@
401 (cd $(srcdir) && cat CHANGELOG Makefile.am configure.in smart*.in *.cpp *.h *.s) \
402 | sed -n 's,^.*\$$[I][d]: [^ ]* \([0-9][0-9]* [0-9][-0-9]* [0-9][:0-9]*\)[^:0-9][^$$]*\$$.*$$,\1,p' \
404 | sed -n 'h;s,^\([^ ]*\) .*$$,REV "\1",p;g;s,^[^ ]* \([^ ]*\) .*$$,DATE "\1",p;g;s,^[^ ]* [^ ]* \([^ ]*\)$$,TIME "\1",p;q' \
405 | sed 's,^,#define SMARTMONTOOLS_SVN_,' >> $@
410 drivedb_DATA = drivedb.h
414 # Create $(savestatesdir) only
418 if ENABLE_ATTRIBUTELOG
419 # Create $(attributelogdir) only
423 update-smart-drivedb: update-smart-drivedb.in config.status
424 $(SHELL) ./config.status --file=$@
428 if INSTALL_INITSCRIPT
431 os_darwin/StartupParameters.plist \
432 os_darwin/English_Localizable.strings
434 initd_install_name = SMART
436 initd_DATA_install = install-initdDATA-darwin
437 initd_DATA_uninstall = uninstall-initdDATA-darwin
439 SMART : os_darwin/SMART.in
440 sed "s|/usr/sbin/|$(sbindir)/|" $< > $@
442 install-initdDATA-darwin: $(initd_DATA)
443 $(mkinstalldirs) $(DESTDIR)$(initddir)
444 $(mkinstalldirs) $(DESTDIR)$(initddir)/SMART
445 $(mkinstalldirs) $(DESTDIR)$(initddir)/SMART/Resources
446 $(INSTALL_SCRIPT) $(top_builddir)/SMART $(DESTDIR)$(initddir)/SMART
447 $(INSTALL_DATA) $(srcdir)/os_darwin/StartupParameters.plist \
448 $(DESTDIR)$(initddir)/SMART/StartupParameters.plist
449 for i in English ; do \
450 RDIR=$(DESTDIR)$(initddir)/SMART/Resources/$${i}.lproj ; \
451 $(mkinstalldirs) $$RDIR ;\
452 $(INSTALL_DATA) $(srcdir)/os_darwin/$${i}_Localizable.strings \
453 $$RDIR/Localizable.strings ; \
456 uninstall-initdDATA-darwin:
457 rm -rf $(DESTDIR)$(initddir)/$(initd_install_name)
461 initd_DATA = @initdfile@
463 @initdfile@: $(srcdir)/@initdfile@.in Makefile
464 sed "s|/usr/local/sbin/|$(sbindir)/|g" $(srcdir)/@initdfile@.in > $@
466 initd_install_name = smartd$(smartd_suffix)
468 initd_DATA_install = install-initdDATA-generic
469 initd_DATA_uninstall = uninstall-initdDATA-generic
471 install-initdDATA-generic: $(initd_DATA)
472 $(mkinstalldirs) $(DESTDIR)$(initddir)
473 $(INSTALL_SCRIPT) $(top_builddir)/@initdfile@ $(DESTDIR)$(initddir)/smartd$(smartd_suffix)
476 uninstall-initdDATA-generic:
477 rm -rf $(DESTDIR)$(initddir)/$(initd_install_name)
481 initd_DATA_install = install-initdDATA-null
482 initd_DATA_uninstall = uninstall-initdDATA-null
484 install-initdDATA-null:
485 uninstall-initdDATA-null:
488 install-initdDATA : $(initd_DATA_install)
490 uninstall-initdDATA: $(initd_DATA_uninstall)
492 if INSTALL_SYSTEMDUNIT
493 systemdsystemunit_DATA = smartd.service
496 smartd.service: smartd.service.in Makefile
497 sed "s|/usr/local/sbin/smartd|$(sbindir)/smartd|g; \
498 s|/usr/local/etc/sysconfig/smartmontools|$(sysconfdir)/sysconfig/smartmontools|g" \
499 $(srcdir)/smartd.service.in > $@
501 if ENABLE_CAPABILITIES
502 MAN_CAPABILITIES = cat
504 MAN_CAPABILITIES = sed '/^\.\\" %IF ENABLE_CAPABILITIES/,/^\.\\" %ENDIF ENABLE_CAPABILITIES/ s,^,.\\"\# ,'
508 MAN_DRIVEDB = sed "s|/usr/local/share/smartmontools/drivedb\\.h|$(drivedbdir)/drivedb.h|g"
510 MAN_DRIVEDB = sed '/^\.\\" %IF ENABLE_DRIVEDB/,/^\.\\" %ENDIF ENABLE_DRIVEDB/ s,^,.\\"\# ,'
514 MAN_SAVESTATES = sed "s|/usr/local/var/lib/smartmontools/smartd\\.|$(savestates)|g"
516 MAN_SAVESTATES = sed '/^\.\\" %IF ENABLE_SAVESTATES/,/^\.\\" %ENDIF ENABLE_SAVESTATES/ s,^,.\\"\# ,'
519 if ENABLE_ATTRIBUTELOG
520 MAN_ATTRIBUTELOG = sed "s|/usr/local/var/lib/smartmontools/attrlog\\.|$(attributelog)|g"
522 MAN_ATTRIBUTELOG = sed '/^\.\\" %IF ENABLE_ATTRIBUTELOG/,/^\.\\" %ENDIF ENABLE_ATTRIBUTELOG/ s,^,.\\"\# ,'
526 sed "s|CURRENT_SVN_VERSION|$(releaseversion)|g; \
527 s|CURRENT_SVN_DATE|`sed -n 's,^.*DATE[^"]*"\([^"]*\)".*$$,\1,p' svnversion.h`|g; \
528 s|CURRENT_SVN_REV|`sed -n 's,^.*REV[^"]*"\([^"]*\)".*$$,r\1,p' svnversion.h`|g; \
529 s|/usr/local/share/man/|$(mandir)/|g; \
530 s|/usr/local/sbin/|$(sbindir)/|g; \
531 s|/usr/local/etc/rc\\.d/init.d/|$(initddir)/|g; \
532 s|/usr/local/share/doc/smartmontools/examplescripts/|!exampledir!|g; \
533 s|/usr/local/share/doc/smartmontools/|$(docsdir)/|g; \
534 s|!exampledir!|$(exampledir)/|g; \
535 s|/usr/local/etc/smartd\\.conf|$(sysconfdir)/smartd.conf|g; \
536 s|/usr/local/etc/smart_drivedb\\.h|$(sysconfdir)/smart_drivedb\\.h|g" | \
537 $(MAN_ATTRIBUTELOG) | \
538 $(MAN_CAPABILITIES) | \
540 $(MAN_SAVESTATES) | \
541 if test -n '$(os_man_filter)'; then \
542 sed -e 's,OS_MAN_FILTER,$(os_man_filter),g' \
543 -e '/^\.\\" %IF NOT OS .*$(os_man_filter)/,/^.\\" %ENDIF NOT OS .*$(os_man_filter)/ s,^,.\\"\# ,' \
544 -e '/^\.\\" %IF OS .*$(os_man_filter)/,/^\.\\" %ENDIF OS .*$(os_man_filter)/ s,^,!!,' \
545 -e '/^\.\\" %IF OS ./,/^\.\\" %ENDIF OS ./ s,^,.\\"\# ,' \
546 -e '/^!*\.\\" %IF NOT OS ./,/^!*\.\\" %ENDIF NOT OS ./ s,^,!!,' \
547 -e 's,^!!!*\.\\"! \(.*\)$$,\1 \\"\#,' \
553 # Implicit rule 'smart%: smart%.in ...' does not work with BSD make
554 smartctl.8: smartctl.8.in Makefile svnversion.h
555 cat $(srcdir)/smartctl.8.in | $(MAN_FILTER) > $@
557 smartd.8: smartd.8.in Makefile svnversion.h
558 cat $(srcdir)/smartd.8.in | $(MAN_FILTER) > $@
560 smartd.conf.5: smartd.conf.5.in Makefile svnversion.h
561 cat $(srcdir)/smartd.conf.5.in | $(MAN_FILTER) > $@
563 # Commands to convert man pages into .html and .txt
566 #MAN2HTML = groff -man -Thtml
567 MAN2TXT = groff -man -Tascii -P'-bcou'
569 # Remove HTTP header and fix links in man2html output
570 FIXHTML = sed '1s,^Content-type.*,,' \
571 | sed 's,<A HREF="http://[-a-z/]*/man2html?\([1-8]\)+\(smart[cd][.a-z]*\)">,<A HREF="\2.\1.html">,g' \
572 | sed 's,<A HREF="http://[-a-z/]*/man2html">,<A HREF=".">,g' \
573 | sed 's,<A HREF="http://[-a-z/]*/man2html?[^"]*">\([^<]*\)</A>,\1,g' \
574 | sed 's,<A HREF="mailto:[^s][^m][^a][^"]*">\([^<]*\)</A>,\1,g'
576 # Convert man pages into .html and .txt
578 htmlman: smartctl.8.html smartd.8.html smartd.conf.5.html
580 txtman: smartctl.8.txt smartd.8.txt smartd.conf.5.txt
585 $(DOS2UNIX) < $< | $(MAN2HTML) | $(FIXHTML) > $@
588 $(DOS2UNIX) < $< | $(MAN2HTML) | $(FIXHTML) > $@
592 $(MAN2HTML) $< | $(FIXHTML) > $@
595 $(MAN2HTML) $< | $(FIXHTML) > $@
605 # Check drive database syntax
607 @if ./smartctl -B $(srcdir)/drivedb.h -P showall >/dev/null; then \
608 echo "$(srcdir)/drivedb.h: OK"; \
610 echo "$(srcdir)/drivedb.h: Syntax check failed"; exit 1; \
615 # Definitions for Windows distribution
623 distdir_win32 = $(PACKAGE)-$(VERSION).win$(win_bits)
624 distzip_win32 = $(PACKAGE)-$(VERSION).win$(win_bits).zip
625 distinst_win32 = $(PACKAGE)-$(VERSION).win$(win_bits)-setup.exe
627 exedir_win32 = $(distdir_win32)/bin
628 docdir_win32 = $(distdir_win32)/doc
631 $(exedir_win32)/smartctl.exe \
632 $(exedir_win32)/smartctl-nc.exe \
633 $(exedir_win32)/smartd.exe \
634 $(exedir_win32)/runcmda.exe \
635 $(exedir_win32)/runcmdu.exe
639 $(exedir_win32)/syslogevt.exe
645 $(exedir_win32)/update-smart-drivedb.exe
651 $(docdir_win32)/AUTHORS.txt \
652 $(docdir_win32)/CHANGELOG.txt \
653 $(docdir_win32)/COPYING.txt \
654 $(docdir_win32)/INSTALL.txt \
655 $(docdir_win32)/NEWS.txt \
656 $(docdir_win32)/README.txt \
657 $(docdir_win32)/TODO.txt \
658 $(docdir_win32)/WARNINGS.txt \
659 $(docdir_win32)/checksums$(win_bits).txt \
660 $(docdir_win32)/smartd.conf \
661 $(docdir_win32)/smartctl.8.html \
662 $(docdir_win32)/smartctl.8.txt \
663 $(docdir_win32)/smartd.8.html \
664 $(docdir_win32)/smartd.8.txt \
665 $(docdir_win32)/smartd.conf.5.html \
666 $(docdir_win32)/smartd.conf.5.txt \
667 $(exedir_win32)/runcmda.exe.manifest \
668 $(exedir_win32)/runcmdu.exe.manifest
672 $(exedir_win32)/drivedb.h
678 smartctl-nc.exe smartctl-nc.exe.tmp \
679 syslogevt.exe syslogevt.h syslogevt.o \
680 syslogevt.res.o syslogevt.rc syslogevt_*.bin \
681 update-smart-drivedb.exe \
684 # Textfile converter from package cygutils or tofrodos
685 # Note: Only use without options to be compatible with both packages
689 # Build Windows distribution
691 dist-win32: $(distzip_win32)
693 install-win32: $(distinst_win32)
696 installer-win32: $(distinst_win32)
698 distdir-win32: distdir.mkdir $(FILES_WIN32)
700 $(distzip_win32): distdir.mkdir $(FILES_WIN32)
701 @rm -fv $(distzip_win32)
702 cd $(distdir_win32) && zip -9 ../$(distzip_win32) bin/* doc/*
705 sha256sum $@ > $@.sha256
708 # Build NSIS installer
709 # Note: Only option character '-' is also compatible with Linux version of makensis
710 $(distinst_win32): os_win32/installer.nsi distdir.mkdir $(FILES_WIN32)
711 test -z '$(builddir_win64)' || ( cd $(builddir_win64) && make distdir-win32 )
712 @date=`sed -n 's,^.*DATE[^"]*"\([^"]*\)".*$$,\1,p' svnversion.h`; \
713 rev=`sed -n 's,^.*REV[^"]*"\([^"]*\)".*$$,r\1,p' svnversion.h`; \
714 verstr="$(PACKAGE_VERSION) $$date $$rev "$(BUILD_INFO); \
715 d64=; test -z '$(builddir_win64)' || d64='-DINPDIR64=$(builddir_win64)/$(PACKAGE)-$(VERSION).win64'; \
716 echo "'$(MAKENSIS)' -V2 -NOCD -DINPDIR=$(distdir_win32) $$d64 -DOUTFILE=$@ -DVERSTR='$$verstr' $<"; \
717 '$(MAKENSIS)' -V2 -NOCD -DINPDIR=$(distdir_win32) $$d64 -DOUTFILE=$@ -DVERSTR="$$verstr" $<
720 sha256sum $@ > $@.sha256
722 # Build drivedb.h update tool
723 update-smart-drivedb.exe: os_win32/update-smart-drivedb.nsi
724 "$(MAKENSIS)" -V2 -NOCD -DBRANCH=$(DRIVEDB_BRANCH) $<
728 @echo "makensis: command not found. Please install NSIS from http://nsis.sourceforge.net/" 1>&2
733 rm -rf $(distdir_win32) distdir.mkdir
736 @test -d $(exedir_win32) || mkdir -pv $(exedir_win32)
737 @test -d $(docdir_win32) || mkdir -pv $(docdir_win32)
740 $(exedir_win32)/%.exe: %.exe
742 if test -n '$(STRIP)'; then $(STRIP) -s $@; else strip -s $@; fi
745 # strip would break NSIS integrity check
746 $(exedir_win32)/update-smart-drivedb.exe: update-smart-drivedb.exe
749 # runcmd?.exe only differ by .exe.manifest files
750 $(exedir_win32)/runcmda.exe: $(exedir_win32)/runcmdu.exe
753 $(exedir_win32)/%.h: $(srcdir)/%.h
754 $(UNIX2DOS) < $< > $@
757 $(exedir_win32)/%.exe.manifest: $(srcdir)/os_win32/%.exe.manifest
758 $(UNIX2DOS) < $< > $@
761 $(docdir_win32)/%.html: %.html
762 $(UNIX2DOS) < $< > $@
765 $(docdir_win32)/%.txt: %.txt
766 $(UNIX2DOS) < $< > $@
769 $(docdir_win32)/%.txt: $(srcdir)/%
770 $(UNIX2DOS) < $< > $@
773 $(docdir_win32)/%.conf: $(srcdir)/%.conf
774 $(UNIX2DOS) < $< > $@
777 $(docdir_win32)/checksums$(win_bits).txt: $(EXEFILES_WIN32)
778 (cd $(exedir_win32) && md5sum *.exe && sha1sum *.exe && sha256sum *.exe) \
781 # Build non-console version of smartctl for GSmartControl.
782 # The script below changes the word at offset 220 (Subsystem) from 3
783 # (Console) to 2 (GUI) in a copy of smartctl.exe.
784 # This will be changed when a tool (like 'editbin') is available in
785 # the Cygwin distribution
786 smartctl-nc.exe: smartctl.exe
788 cp -p smartctl.exe $@.tmp
789 @if test `od -A n -j 220 -N 2 -d $@.tmp` -eq 3; then :; \
790 else echo "invalid EXE header"; exit 1; fi
791 @echo "editbin /subsystem:windows $@.tmp"
792 @echo -ne '\002' | dd bs=1 seek=220 count=1 conv=notrunc of=$@.tmp 2>/dev/null
793 @if test `od -A n -j 220 -N 2 -d $@.tmp` -eq 2; then :; \
794 else echo "EXE patch failed"; exit 1; fi
798 runcmdu.exe: os_win32/runcmd.c
802 # Build syslogevt.exe event message file tool
804 syslogevt.exe: syslogevt.o syslogevt.res.o
807 syslogevt.o: os_win32/syslogevt.c syslogevt.rc
808 $(CC) -c -I. -Os -o $@ $<
810 syslogevt.res.o: syslogevt.rc
813 syslogevt.rc: os_win32/syslogevt.mc
817 # Build {config,svnversion}_vc10.h for MSVC10 from MinGW {config,svnversion}.h
819 config-vc10: $(srcdir)/os_win32/config_vc10.h $(srcdir)/os_win32/svnversion_vc10.h
821 $(srcdir)/os_win32/config_vc10.h: config.h Makefile
822 sed -e '1i/* config_vc10.h. Generated from config.h by Makefile. */' \
823 -e 's,^#define HAVE_\(ATTR_PACKED\|GETTIMEOFDAY\|INTTYPES_H\|[DK_]*NTDDDISK_H\|STRINGS_H\|STRTOULL\|UNISTD_H\|WORKING_SNPRINTF\) 1$$,/* #undef HAVE_\1 */,' \
824 -e 's,^\(#define SMARTMONTOOLS_BUILD_HOST "[^-]*\)[^"]*,\1-pc-w32vc10,' $< > $@
826 $(srcdir)/os_win32/svnversion_vc10.h: svnversion.h