X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=Makefile.am;h=cd3d8a51e06ab0da622230c2cfc9bdc536986b04;hb=f55b7a7b37eda529795f2a8207ef78a8168f7721;hp=6661801eee3037e790f551ccfaa08d1fccf16d2e;hpb=4d561bdbb71727621a1890b24b1ec50e21da1fe9;p=mirror_smartmontools-debian.git diff --git a/Makefile.am b/Makefile.am index 6661801..cd3d8a5 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,10 +1,12 @@ ## Process this file with automake to produce Makefile.in # -# $Id: Makefile.am 3296 2011-03-16 22:17:51Z chrfranke $ +# $Id: Makefile.am 3527 2012-03-25 16:42:24Z chrfranke $ # @SET_MAKE@ +ACLOCAL_AM_FLAGS = -I m4 + # Make sure .cpp takes precedence to avoid compiling old .c file SUFFIXES = .cpp .c .s .o @@ -22,6 +24,9 @@ if ENABLE_ATTRIBUTELOG AM_CPPFLAGS += -DSMARTMONTOOLS_ATTRIBUTELOG='"$(attributelog)"' endif +if OS_WIN32_MINGW +AM_CPPFLAGS += -I$(srcdir)/os_win32 +endif if NEED_GETOPT_LONG AM_CPPFLAGS += -I$(srcdir)/getopt -DHAVE_GETOPT_LONG -D__GNU_LIBRARY__ endif @@ -83,6 +88,7 @@ EXTRA_smartd_SOURCES = os_darwin.cpp \ os_generic.h \ cciss.cpp \ cciss.h \ + cissio_freebsd.h \ dev_legacy.cpp \ megaraid.h @@ -145,6 +151,7 @@ EXTRA_smartctl_SOURCES = os_linux.cpp \ os_generic.h \ cciss.cpp \ cciss.h \ + cissio_freebsd.h \ dev_legacy.cpp \ megaraid.h @@ -315,17 +322,23 @@ uninstall-sysconfDATA: rm -f "$$f" EXTRA_DIST = \ + autogen.sh \ smartd.initd.in \ + smartd.freebsd.initd.in \ smartd.8.in \ smartctl.8.in \ smartd.conf.5.in \ smartd.conf \ - autogen.sh \ + smartd.service.in \ update-smart-drivedb.in \ + m4/pkg.m4 \ os_darwin/SMART.in \ os_darwin/StartupParameters.plist \ os_darwin/English_Localizable.strings \ os_win32/installer.nsi \ + os_win32/runcmd.c \ + os_win32/runcmda.exe.manifest \ + os_win32/runcmdu.exe.manifest \ os_win32/syslogevt.c \ os_win32/syslogevt.mc \ os_win32/update-smart-drivedb.nsi \ @@ -334,22 +347,25 @@ EXTRA_DIST = \ $(examples_DATA) \ $(examples_SCRIPTS) -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 \ - svnversion.h \ - update-smart-drivedb \ - SMART +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 \ + smartd.freebsd.initd \ + smartd.service \ + svnversion.h \ + update-smart-drivedb \ + SMART # 'make maintainer-clean' also removes files generated by './autogen.sh' MAINTAINERCLEANFILES = \ @@ -363,13 +379,14 @@ MAINTAINERCLEANFILES = \ $(srcdir)/depcomp \ $(srcdir)/install-sh \ $(srcdir)/missing \ - $(srcdir)/mkinstalldirs + $(srcdir)/mkinstalldirs \ + $(srcdir)/m4/pkg.m4 utility.o: svnversion.h if IS_SVN_BUILD # Get version info from SVN -svnversion.h: CHANGELOG Makefile $(srcdir)/.svn/entries +svnversion.h: CHANGELOG Makefile $(svn_deps) echo '/* svnversion.h. Generated by Makefile from svn info. */' > $@ (cd $(srcdir) \ && svnversion 2>/dev/null | sed -n 's,^\([0-9].*\),REV "\1",p' \ @@ -403,17 +420,6 @@ if ENABLE_ATTRIBUTELOG attributelog_DATA = 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 - update-smart-drivedb: update-smart-drivedb.in config.status $(SHELL) ./config.status --file=$@ chmod +x $@ @@ -452,10 +458,10 @@ uninstall-initdDATA-darwin: else -initd_DATA = smartd.initd +initd_DATA = @initdfile@ -smartd.initd: $(srcdir)/smartd.initd.in Makefile - sed "s|/usr/local/sbin/|$(sbindir)/|g" $(srcdir)/smartd.initd.in > $@ +@initdfile@: $(srcdir)/@initdfile@.in Makefile + sed "s|/usr/local/sbin/|$(sbindir)/|g" $(srcdir)/@initdfile@.in > $@ initd_install_name = smartd$(smartd_suffix) @@ -464,7 +470,7 @@ initd_DATA_uninstall = uninstall-initdDATA-generic install-initdDATA-generic: $(initd_DATA) $(mkinstalldirs) $(DESTDIR)$(initddir) - $(INSTALL_SCRIPT) $(top_builddir)/smartd.initd $(DESTDIR)$(initddir)/smartd$(smartd_suffix) + $(INSTALL_SCRIPT) $(top_builddir)/@initdfile@ $(DESTDIR)$(initddir)/smartd$(smartd_suffix) uninstall-initdDATA-generic: @@ -483,28 +489,37 @@ install-initdDATA : $(initd_DATA_install) uninstall-initdDATA: $(initd_DATA_uninstall) +if INSTALL_SYSTEMDUNIT +systemdsystemunit_DATA = smartd.service +endif + +smartd.service: smartd.service.in Makefile + sed "s|/usr/local/sbin/smartd|$(sbindir)/smartd|g; \ + s|/usr/local/etc/sysconfig/smartmontools|$(sysconfdir)/sysconfig/smartmontools|g" \ + $(srcdir)/smartd.service.in > $@ + if ENABLE_CAPABILITIES MAN_CAPABILITIES = cat else -MAN_CAPABILITIES = sed '/BEGIN ENABLE_CAPABILITIES/,/END ENABLE_CAPABILITIES/d' +MAN_CAPABILITIES = sed '/^\.\\" %IF ENABLE_CAPABILITIES/,/^\.\\" %ENDIF ENABLE_CAPABILITIES/ s,^,.\\"\# ,' endif if ENABLE_DRIVEDB MAN_DRIVEDB = sed "s|/usr/local/share/smartmontools/drivedb\\.h|$(drivedbdir)/drivedb.h|g" else -MAN_DRIVEDB = sed '/BEGIN ENABLE_DRIVEDB/,/END ENABLE_DRIVEDB/d' +MAN_DRIVEDB = sed '/^\.\\" %IF ENABLE_DRIVEDB/,/^\.\\" %ENDIF ENABLE_DRIVEDB/ s,^,.\\"\# ,' endif if ENABLE_SAVESTATES MAN_SAVESTATES = sed "s|/usr/local/var/lib/smartmontools/smartd\\.|$(savestates)|g" else -MAN_SAVESTATES = sed '/BEGIN ENABLE_SAVESTATES/,/END ENABLE_SAVESTATES/d' +MAN_SAVESTATES = sed '/^\.\\" %IF ENABLE_SAVESTATES/,/^\.\\" %ENDIF ENABLE_SAVESTATES/ s,^,.\\"\# ,' endif if ENABLE_ATTRIBUTELOG MAN_ATTRIBUTELOG = sed "s|/usr/local/var/lib/smartmontools/attrlog\\.|$(attributelog)|g" else -MAN_ATTRIBUTELOG = sed '/BEGIN ENABLE_ATTRIBUTELOG/,/END ENABLE_ATTRIBUTELOG/d' +MAN_ATTRIBUTELOG = sed '/^\.\\" %IF ENABLE_ATTRIBUTELOG/,/^\.\\" %ENDIF ENABLE_ATTRIBUTELOG/ s,^,.\\"\# ,' endif MAN_FILTER = \ @@ -519,10 +534,21 @@ MAN_FILTER = \ s|!exampledir!|$(exampledir)/|g; \ s|/usr/local/etc/smartd\\.conf|$(sysconfdir)/smartd.conf|g; \ s|/usr/local/etc/smart_drivedb\\.h|$(sysconfdir)/smart_drivedb\\.h|g" | \ + $(MAN_ATTRIBUTELOG) | \ $(MAN_CAPABILITIES) | \ $(MAN_DRIVEDB) | \ $(MAN_SAVESTATES) | \ - $(MAN_ATTRIBUTELOG) + if test -n '$(os_man_filter)'; then \ + sed -e 's,OS_MAN_FILTER,$(os_man_filter),g' \ + -e '/^\.\\" %IF NOT OS .*$(os_man_filter)/,/^.\\" %ENDIF NOT OS .*$(os_man_filter)/ s,^,.\\"\# ,' \ + -e '/^\.\\" %IF OS .*$(os_man_filter)/,/^\.\\" %ENDIF OS .*$(os_man_filter)/ s,^,!!,' \ + -e '/^\.\\" %IF OS ./,/^\.\\" %ENDIF OS ./ s,^,.\\"\# ,' \ + -e '/^!*\.\\" %IF NOT OS ./,/^!*\.\\" %ENDIF NOT OS ./ s,^,!!,' \ + -e 's,^!!!*\.\\"! \(.*\)$$,\1 \\"\#,' \ + -e 's,^!!!*,,' ; \ + else \ + cat; \ + fi # Implicit rule 'smart%: smart%.in ...' does not work with BSD make smartctl.8: smartctl.8.in Makefile svnversion.h @@ -604,7 +630,9 @@ docdir_win32 = $(distdir_win32)/doc EXEFILES_WIN32 = \ $(exedir_win32)/smartctl.exe \ $(exedir_win32)/smartctl-nc.exe \ - $(exedir_win32)/smartd.exe + $(exedir_win32)/smartd.exe \ + $(exedir_win32)/runcmda.exe \ + $(exedir_win32)/runcmdu.exe if OS_WIN32_WINDMC EXEFILES_WIN32 += \ @@ -635,7 +663,9 @@ FILES_WIN32 = \ $(docdir_win32)/smartd.8.html \ $(docdir_win32)/smartd.8.txt \ $(docdir_win32)/smartd.conf.5.html \ - $(docdir_win32)/smartd.conf.5.txt + $(docdir_win32)/smartd.conf.5.txt \ + $(exedir_win32)/runcmda.exe.manifest \ + $(exedir_win32)/runcmdu.exe.manifest if ENABLE_DRIVEDB FILES_WIN32 += \ @@ -644,6 +674,7 @@ endif CLEANFILES += \ $(FILES_WIN32) \ + runcmdu.exe \ smartctl-nc.exe smartctl-nc.exe.tmp \ syslogevt.exe syslogevt.h syslogevt.o \ syslogevt.res.o syslogevt.rc syslogevt_*.bin \ @@ -713,10 +744,18 @@ $(exedir_win32)/%.exe: %.exe $(exedir_win32)/update-smart-drivedb.exe: update-smart-drivedb.exe cp -p $< $@ +# runcmd?.exe only differ by .exe.manifest files +$(exedir_win32)/runcmda.exe: $(exedir_win32)/runcmdu.exe + cp -p $< $@ + $(exedir_win32)/%.h: $(srcdir)/%.h $(UNIX2DOS) < $< > $@ touch -r $< $@ +$(exedir_win32)/%.exe.manifest: $(srcdir)/os_win32/%.exe.manifest + $(UNIX2DOS) < $< > $@ + touch -r $< $@ + $(docdir_win32)/%.html: %.html $(UNIX2DOS) < $< > $@ touch -r $< $@ @@ -753,6 +792,10 @@ smartctl-nc.exe: smartctl.exe else echo "EXE patch failed"; exit 1; fi mv -f $@.tmp $@ +# Build runcmd?.exe +runcmdu.exe: os_win32/runcmd.c + $(CC) -Os -o $@ $< + if OS_WIN32_WINDMC # Build syslogevt.exe event message file tool @@ -769,16 +812,16 @@ syslogevt.rc: os_win32/syslogevt.mc $(WINDMC) -b $< endif -# Build {config,svnversion}_vc8.h for MSVC8 from MinGW {config,svnversion}.h +# Build {config,svnversion}_vc10.h for MSVC10 from MinGW {config,svnversion}.h -config-vc8: $(srcdir)/os_win32/config_vc8.h $(srcdir)/os_win32/svnversion_vc8.h +config-vc10: $(srcdir)/os_win32/config_vc10.h $(srcdir)/os_win32/svnversion_vc10.h -$(srcdir)/os_win32/config_vc8.h: config.h Makefile - sed '1i/* config_vc8.h. Generated from config.h by Makefile. */' $< | \ - sed 's,^#define HAVE_\(ATTR_PACKED\|INTTYPES_H\|[DK_]*NTDDDISK_H\|STDINT_H\|STRINGS_H\|STRTOULL\|U*INT64_T\|UNISTD_H\|WORKING_SNPRINTF\) 1$$,/* #undef HAVE_\1 */,' | \ - sed 's,^\(#define SMARTMONTOOLS_BUILD_HOST "[^-]*\)[^"]*,\1-pc-win32vc8,' > $@ +$(srcdir)/os_win32/config_vc10.h: config.h Makefile + sed -e '1i/* config_vc10.h. Generated from config.h by Makefile. */' \ + -e 's,^#define HAVE_\(ATTR_PACKED\|GETTIMEOFDAY\|INTTYPES_H\|[DK_]*NTDDDISK_H\|STRINGS_H\|STRTOULL\|UNISTD_H\|WORKING_SNPRINTF\) 1$$,/* #undef HAVE_\1 */,' \ + -e 's,^\(#define SMARTMONTOOLS_BUILD_HOST "[^-]*\)[^"]*,\1-pc-w32vc10,' $< > $@ -$(srcdir)/os_win32/svnversion_vc8.h: svnversion.h - cp svnversion.h $@ +$(srcdir)/os_win32/svnversion_vc10.h: svnversion.h + cp $< $@ endif