1 # Network UPS Tools: include
3 # Export certain values for ccache which NUT ci_build.sh can customize,
4 # to facilitate developer iteration re-runs of "make" later.
5 # At least GNU and BSD make implementations are okay with this syntax.
6 @NUT_AM_MAKE_CAN_EXPORT@@NUT_AM_EXPORT_CCACHE_NAMESPACE@export CCACHE_NAMESPACE=@CCACHE_NAMESPACE@
7 @NUT_AM_MAKE_CAN_EXPORT@@NUT_AM_EXPORT_CCACHE_BASEDIR@export CCACHE_BASEDIR=@CCACHE_BASEDIR@
8 @NUT_AM_MAKE_CAN_EXPORT@@NUT_AM_EXPORT_CCACHE_DIR@export CCACHE_DIR=@CCACHE_DIR@
9 @NUT_AM_MAKE_CAN_EXPORT@@NUT_AM_EXPORT_CCACHE_PATH@export CCACHE_PATH=@CCACHE_PATH@
10 @NUT_AM_MAKE_CAN_EXPORT@@NUT_AM_EXPORT_CCACHE_PATH@export PATH=@PATH_DURING_CONFIGURE@
12 dist_noinst_HEADERS = \
13 attribute.h common.h extstate.h proto.h \
14 state.h str.h timehead.h upsconf.h \
15 nut_bool.h nut_float.h nut_stdint.h nut_platform.h \
16 nutstream.hpp nutwriter.hpp nutipc.hpp nutconf.hpp \
19 # Optionally deliverable as part of NUT public API:
21 include_HEADERS = parseconf.h
23 dist_noinst_HEADERS += parseconf.h
26 # http://www.gnu.org/software/automake/manual/automake.html#Clean
27 BUILT_SOURCES = nut_version.h
28 CLEANFILES = nut_version.h
29 MAINTAINERCLEANFILES = Makefile.in .dirstamp
31 # magic to include Git version information in NUT version string
32 # (for builds not made from the tagged commit in a Git workspace)
34 nut_version.h: @FORCE_NUT_VERSION@
35 @GITREV="`$(top_srcdir)/tools/gitlog2version.sh`" || GITREV=""; \
36 GITREV_IS_RELEASE="`NUT_VERSION_QUERY=IS_RELEASE $(top_srcdir)/tools/gitlog2version.sh 2>/dev/null`" || GITREV_IS_RELEASE="false"; \
37 GITREV_SEMVER="`NUT_VERSION_QUERY=SEMVER $(top_srcdir)/tools/gitlog2version.sh 2>/dev/null`" || GITREV_SEMVER=""; \
38 { echo '/* Autogenerated file. Do not change. */' ; \
39 echo '/* This file was generated by "make". */' ; \
40 if [ -z "$$GITREV" ]; then \
41 NUT_VERSION="$(PACKAGE_VERSION)"; \
42 echo '/* The version number is set by AC_INIT in configure.ac. */' ; \
44 NUT_VERSION="$$GITREV"; \
45 echo '/* The version number is determined by Git source commit hash' ; \
46 echo ' * and number of commits since the most recent Git tag (if not' ; \
47 echo ' * building the newest tagged commit itself - then just the tag).'; \
50 if [ -z "$$GITREV_SEMVER" ]; then \
51 GITREV_SEMVER="@NUT_SOURCE_GITREV_SEMVER@"; \
53 echo "#define NUT_VERSION_MACRO \"$$NUT_VERSION\"" ; \
54 echo "#define NUT_VERSION_SEMVER_MACRO \"$$GITREV_SEMVER\"" ; \
55 if $$GITREV_IS_RELEASE ; then \
56 echo "#define NUT_VERSION_IS_RELEASE 1" ; \
58 echo "#define NUT_VERSION_IS_RELEASE 0" ; \
61 echo "NUT_VERSION: \"$$NUT_VERSION\" NUT_VERSION_IS_RELEASE:$$GITREV_IS_RELEASE NUT_VERSION_SEMVER: \"$$GITREV_SEMVER\""
62 -test -f "$@" || cp "$@.tmp" "$@"
63 -cmp -s "$@.tmp" "$@" || cp "$@.tmp" "$@"
68 # counter part of BUILT_SOURCES: since nut_version is not a direct
69 # deps of a local target, we must clean it by ourselves before the
72 $(AM_V_at)rm -f $(distdir)/nut_version.h