nut-debian/include/Makefile.am

40 lines
1.6 KiB
Makefile
Raw Permalink Normal View History

2013-11-24 17:00:12 +02:00
dist_noinst_HEADERS = attribute.h common.h extstate.h parseconf.h proto.h \
2022-07-10 10:23:45 +03:00
state.h str.h timehead.h upsconf.h nut_float.h nut_stdint.h nut_platform.h
2010-03-26 01:20:59 +02:00
# http://www.gnu.org/software/automake/manual/automake.html#Clean
2011-06-01 23:31:49 +03:00
BUILT_SOURCES = nut_version.h
2010-03-26 01:20:59 +02:00
CLEANFILES = nut_version.h
2022-07-10 10:23:45 +03:00
MAINTAINERCLEANFILES = Makefile.in .dirstamp
2010-03-26 01:20:59 +02:00
2013-11-24 17:00:12 +02:00
# magic to include Git version information in NUT version string
2022-07-10 10:23:45 +03:00
# (for builds not made from the tagged commit in a Git workspace)
2010-03-26 01:20:59 +02:00
nut_version.h: FORCE
2022-07-10 10:23:45 +03:00
@GITREV="`git describe --tags 2>/dev/null | sed -e 's/^v\([0-9]\)/\1/' -e 's,^.*/,,'`" || GITREV=""; \
{ echo '/* Autogenerated file. Do not change. */' ; \
echo '/* This file was generated by "make". */' ; \
if [ -z "$$GITREV" ]; then \
NUT_VERSION="$(PACKAGE_VERSION)"; \
echo '/* The version number is set by AC_INIT in configure.ac. */' ; \
else \
NUT_VERSION="$$GITREV"; \
echo '/* The version number is determined by Git source commit hash' ; \
echo ' * and number of commits since the most recent Git tag (if not' ; \
echo ' * building the newest tagged commit itself - then just the tag).'; \
echo ' */' ; \
fi ; \
echo "#define NUT_VERSION_MACRO \"$$NUT_VERSION\"" ; \
} > "$@.tmp" ; \
echo "NUT_VERSION: \"$$NUT_VERSION\""
-test -f "$@" || cp "$@.tmp" "$@"
-cmp -s "$@.tmp" "$@" || cp "$@.tmp" "$@"
-rm -f "$@.tmp"
2010-03-26 01:20:59 +02:00
FORCE:
2012-06-01 16:55:19 +03:00
# counter part of BUILT_SOURCES: since nut_version is not a direct
2022-07-10 10:23:45 +03:00
# deps of a local target, we must clean it by ourselves before the
2012-06-01 16:55:19 +03:00
# distribution
dist-hook:
rm -f $(distdir)/nut_version.h