## Process this file with automake to produce Makefile.in # # include/Makefile.am # # Suppress 'echo' if './configure --enable-silent-rules' or 'make V=0' is used. # Variables AM_V_* are provided by automake >= 1.13. ECHO_V = ! $(AM_V_P) || echo ECHO_V_GEN = @$(AM_V_P) || echo ' GEN $@'; $(ECHO_V) all: smartmon/smartmon_config.h smartmon/version.h # Create 'smartmon_config.h' from 'config.h'. Add prefix SMARTMON_ to each define # if SMARTMON[TOOLS] is not already present. Fail if an invalid line occurs. smartmon/smartmon_config.h: ../config.h Makefile $(ECHO_V_GEN) ' $$(CONFIG_FILTER) < ../config.h > $@.tmp' $(AM_V_at)$(MKDIR_P) smartmon @echo '/* smartmon/smartmon_config.h. Generated from config.h by Makefile. */' > $@.tmp @echo '#ifndef _SMARTMON_CONFIG_H' >> $@.tmp @echo '#define _SMARTMON_CONFIG_H' >> $@.tmp @sed \ -e '/^./s/^/!!/' \ -e '/^!!\/\* [^#]/s/^!!//' \ -e '/^!!.*#.*def.*SMARTMON/s/^!!//' \ -e 's/^!!#define /#define SMARTMON_/' \ -e 's/^!!\/\* #undef /\/* #undef SMARTMON_/' \ -e 's/^!!\(.*#.*def.*\) \(AC_APPLE_UNIVERSAL_BUILD\)/\1 SMARTMON_\2/' \ -e 's/^!!\(.*#.*def.*\) \(WORDS_BIGENDIAN\)/\1 SMARTMON_\2/' \ -e '/^!!# *if.* __BIG_ENDIAN__/s/^!!//' \ -e '/^!!# *[defilns]*$$/s/^!!//' \ -e '/^!! /s/^!!//' \ -e 's/^!!/error: config.h: invalid line: /' \ < ../config.h >> $@.tmp @echo '#endif // _SMARTMON_CONFIG_H' >> $@.tmp @if grep '^error: ' $@.tmp; then exit 1; fi $(AM_V_at)mv -f $@.tmp $@ # Get version info smartmon/version.h: smartmon/version.sh $(AM_V_GEN)$(top_srcdir)/util/getversion.sh -i < smartmon/version.sh > $@.tmp $(AM_V_at)mv -f $@.tmp $@ smartmon/version.sh: ../util/getversion.sh ../config.h Makefile $(AM_V_at)$(MKDIR_P) smartmon $(AM_V_GEN)$(top_srcdir)/util/getversion.sh -s > $@.tmp $(AM_V_at)mv -f $@.tmp $@ @if $(AM_V_P); then cat $@; fi smartmon_headers = \ smartmon/ata.h \ smartmon/atacmds.h \ smartmon/byteorder.h \ smartmon/dev_interface.h \ smartmon/farmcmds.h \ smartmon/hexdump.h \ smartmon/json.h \ smartmon/knowndrives.h \ smartmon/nvme.h \ smartmon/nvmecmds.h \ smartmon/scsicmds.h \ smartmon/sg_unaligned.h \ smartmon/smartmon_defs.h \ smartmon/utility.h if INSTALL_DEVEL_INC incsmartmondir = $(includedir)/smartmon incsmartmon_DATA = \ $(smartmon_headers) \ smartmon/smartmon_config.h \ smartmon/version.h if OS_WIN32 incsmartmonw32dir = $(incsmartmondir)/os_win32 incsmartmonw32_DATA = \ smartmon/os_win32/wmiquery.h if OS_WIN32_MINGW incsmartmonw32_DATA += \ smartmon/os_win32/popen.h endif endif if NEED_REGEX incsmartmonrexdir = $(incsmartmondir)/regex incsmartmonrex_DATA = \ smartmon/regex/regex.h endif endif EXTRA_DIST = \ $(smartmon_headers) \ smartmon/os_win32/popen.h \ smartmon/os_win32/wmiquery.h \ smartmon/regex/regex.h CLEANFILES = \ smartmon/smartmon_config.h \ smartmon/smartmon_config.h.tmp \ smartmon/version.h \ smartmon/version.h.tmp \ smartmon/version.sh \ smartmon/version.sh.tmp # 'make maintainer-clean' also removes files generated by './autogen.sh' MAINTAINERCLEANFILES = \ $(srcdir)/Makefile.in