nut/include/Makefile.am

33 lines
1.4 KiB
Makefile
Raw Normal View History

2013-11-24 15:00:12 +00:00
dist_noinst_HEADERS = attribute.h common.h extstate.h parseconf.h proto.h \
2016-07-18 00:11:41 +00:00
state.h str.h timehead.h upsconf.h nut_stdint.h nut_platform.h
2010-03-25 23:20:59 +00:00
# http://www.gnu.org/software/automake/manual/automake.html#Clean
2011-06-01 20:31:49 +00:00
BUILT_SOURCES = nut_version.h
2010-03-25 23:20:59 +00:00
CLEANFILES = nut_version.h
2013-11-24 15:00:12 +00:00
# magic to include Git version information in NUT version string
2010-03-25 23:20:59 +00:00
nut_version.h: FORCE
2013-11-24 15:00:12 +00:00
@GITREV=`git describe --tags 2>/dev/null | sed -e 's/^v\([0-9]\)/\1/' -e 's,^.*/,,' ` || GITREV=""; \
echo '/* Autogenerated file. Do not change. */' > _nut_version.h ; \
echo '/* This file was generated by "make". */' >> _nut_version.h ; \
2012-01-24 10:22:33 +00:00
if [ -z "$$GITREV" ]; \
2013-11-24 15:00:12 +00:00
then NUT_VERSION="$(PACKAGE_VERSION)"; \
echo '/* The version number is set by AC_INIT in configure.in. */' >> _nut_version.h ; \
2012-01-24 10:22:33 +00:00
else NUT_VERSION="$$GITREV"; \
2013-11-24 15:00:12 +00:00
echo '/* The version number is determined by the most recent Git tag. */' >> _nut_version.h ; \
2010-03-25 23:20:59 +00:00
fi ; \
echo "#define NUT_VERSION_MACRO \"$$NUT_VERSION\"" >> _nut_version.h ; \
echo "NUT_VERSION: \"$$NUT_VERSION\""
-test -f nut_version.h || cp _nut_version.h nut_version.h
-cmp -s _nut_version.h nut_version.h || cp _nut_version.h nut_version.h
-rm -f _nut_version.h
FORCE:
2012-06-01 13:55:19 +00:00
# counter part of BUILT_SOURCES: since nut_version is not a direct
# deps of a local target, we must clean it by ourself before the
# distribution
dist-hook:
rm -f $(distdir)/nut_version.h