File: Makefile.am

package info (click to toggle)
nut 2.8.4%2Breally-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 25,720 kB
  • sloc: ansic: 132,030; sh: 17,256; cpp: 12,566; makefile: 5,646; python: 1,114; perl: 856; xml: 47
file content (101 lines) | stat: -rw-r--r-- 4,432 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# Network UPS Tools: include

# Export certain values for ccache which NUT ci_build.sh can customize,
# to facilitate developer iteration re-runs of "make" later.
# At least GNU and BSD make implementations are okay with this syntax.
@NUT_AM_MAKE_CAN_EXPORT@@NUT_AM_EXPORT_CCACHE_NAMESPACE@export CCACHE_NAMESPACE=@CCACHE_NAMESPACE@
@NUT_AM_MAKE_CAN_EXPORT@@NUT_AM_EXPORT_CCACHE_BASEDIR@export CCACHE_BASEDIR=@CCACHE_BASEDIR@
@NUT_AM_MAKE_CAN_EXPORT@@NUT_AM_EXPORT_CCACHE_DIR@export CCACHE_DIR=@CCACHE_DIR@
@NUT_AM_MAKE_CAN_EXPORT@@NUT_AM_EXPORT_CCACHE_PATH@export CCACHE_PATH=@CCACHE_PATH@
@NUT_AM_MAKE_CAN_EXPORT@@NUT_AM_EXPORT_CCACHE_PATH@export PATH=@PATH_DURING_CONFIGURE@

include_HEADERS =
dist_noinst_HEADERS = \
    attribute.h common.h extstate.h proto.h			\
    state.h str.h timehead.h upsconf.h				\
    nut_bool.h nut_float.h nut_stdint.h nut_platform.h		\
    wincompat.h

# Optionally deliverable as part of NUT public API:
if WITH_DEV
include_HEADERS += parseconf.h
if WITH_DEV_LIBNUTCONF
include_HEADERS += nutstream.hpp nutwriter.hpp nutipc.hpp nutconf.hpp
else !WITH_DEV_LIBNUTCONF
dist_noinst_HEADERS += nutstream.hpp nutwriter.hpp nutipc.hpp nutconf.hpp
endif !WITH_DEV_LIBNUTCONF
else !WITH_DEV
dist_noinst_HEADERS += parseconf.h
dist_noinst_HEADERS += nutstream.hpp nutwriter.hpp nutipc.hpp nutconf.hpp
endif !WITH_DEV

# http://www.gnu.org/software/automake/manual/automake.html#Clean
BUILT_SOURCES = nut_version.h
CLEANFILES = nut_version.h nut_version.h.tmp*
MAINTAINERCLEANFILES = Makefile.in .dirstamp

# magic to include Git version information in NUT version string
# (for builds not made from the tagged commit in a Git workspace)
# NOTE: For pre-releases, SEMVER may differ from NUT_VERSION base
# (e.g. a commit tagged as 2.8.3-rc5 can have its own NUT_VERSION based
# on 2.8.2-something, but is assumed as a pre-release for 2.8.3 SEMVER)
nut_version.h: @FORCE_NUT_VERSION@
	@echo "  GENERATE-HEADER	$@" ; \
	 RES=0; \
	 GITREV="`$(top_srcdir)/tools/gitlog2version.sh`" || GITREV=""; \
	 GITREV_IS_RELEASE="`NUT_VERSION_QUERY=IS_RELEASE $(top_srcdir)/tools/gitlog2version.sh 2>/dev/null`" || GITREV_IS_RELEASE="false"; \
	 GITREV_IS_PRERELEASE="`NUT_VERSION_QUERY=IS_PRERELEASE $(top_srcdir)/tools/gitlog2version.sh 2>/dev/null`" || GITREV_IS_PRERELEASE="false"; \
	 GITREV_SEMVER="`NUT_VERSION_QUERY=SEMVER $(top_srcdir)/tools/gitlog2version.sh 2>/dev/null`" || GITREV_SEMVER=""; \
	 {  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 ; \
	    if [ -z "$$GITREV_SEMVER" ]; then \
	        GITREV_SEMVER="@NUT_SOURCE_GITREV_SEMVER@"; \
	    fi ; \
	    echo "#define NUT_VERSION_MACRO \"$$NUT_VERSION\"" ; \
	    echo "#define NUT_VERSION_SEMVER_MACRO \"$$GITREV_SEMVER\"" ; \
	    if $$GITREV_IS_RELEASE ; then \
	        echo "#define NUT_VERSION_IS_RELEASE 1" ; \
	    else \
	        echo "#define NUT_VERSION_IS_RELEASE 0" ; \
	    fi ; \
	    if $$GITREV_IS_PRERELEASE ; then \
	        echo "#define NUT_VERSION_IS_PRERELEASE 1" ; \
	    else \
	        echo "#define NUT_VERSION_IS_PRERELEASE 0" ; \
	    fi ; \
	 } > "$@.tmp.$$$$" && \
	 echo "NUT_VERSION: \"$$NUT_VERSION\"  NUT_VERSION_IS_RELEASE:$$GITREV_IS_RELEASE  NUT_VERSION_IS_PRERELEASE:$$GITREV_IS_PRERELEASE  NUT_VERSION_SEMVER: \"$$GITREV_SEMVER\"" && \
	 if test -f "$@" && test -s "$@" ; then \
		if cmp -s "$@.tmp.$$$$" "$@" ; then \
			echo "  GENERATE-HEADER	$@ did not change" ; \
		else \
			echo "  GENERATE-HEADER	$@ got changed" ; \
			cp "$@.tmp.$$$$" "$@" ; \
		fi ; \
	 else \
		echo "  GENERATE-HEADER	$@ was absent"; \
		cp "$@.tmp.$$$$" "$@" ; \
	 fi \
	 || RES=$$? ; \
	 rm -f "$@.tmp.$$$$" ; \
	 exit $$RES

FORCE:

# counter part of BUILT_SOURCES: since nut_version is not a direct
# deps of a local target, we must clean it by ourselves before the
# distribution
dist-hook:
	$(AM_V_at)rm -f $(distdir)/nut_version.h

all-libs-local: nut_version.h