File: Makefile.am

package info (click to toggle)
nut 2.7.2-4
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 10,220 kB
  • ctags: 8,034
  • sloc: ansic: 66,197; sh: 12,738; python: 2,196; cpp: 1,710; makefile: 1,335; perl: 702; xml: 10
file content (32 lines) | stat: -rw-r--r-- 1,402 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
dist_noinst_HEADERS = attribute.h common.h extstate.h parseconf.h proto.h	\
 state.h timehead.h upsconf.h nut_stdint.h nut_platform.h

# http://www.gnu.org/software/automake/manual/automake.html#Clean
BUILT_SOURCES = nut_version.h
CLEANFILES = nut_version.h

# magic to include Git version information in NUT version string

nut_version.h: FORCE
	@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 ; \
	if [ -z "$$GITREV" ]; \
		then NUT_VERSION="$(PACKAGE_VERSION)"; \
                     echo '/* The version number is set by AC_INIT in configure.in. */'   >> _nut_version.h ; \
		else NUT_VERSION="$$GITREV"; \
                     echo '/* The version number is determined by the most recent Git tag. */'   >> _nut_version.h ; \
	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:

# 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