Commit | Line | Data |
---|---|---|
88564da0 | 1 | ## |
337d64f0 MJ |
2 | ## This target generates an include file that contains the git version |
3 | ## string of the current branch, it must be continuously updated when | |
4 | ## we build in the git repo and shipped in dist tarballs to reflect the | |
5 | ## status of the tree when it was generated. If the tree is clean and | |
6 | ## the current commit is tag a starting with "v", consider this a | |
7 | ## release version and set an empty git version. | |
88564da0 | 8 | ## |
337d64f0 MJ |
9 | ## Here is what the inline script does: |
10 | ## | |
11 | ## First, delete any stale "version.i.tmp" file. | |
12 | ## | |
13 | ## If "bootstrap" and ".git" exists in the top source directory and the git | |
14 | ## executable is available, get the current git version string in the form: | |
15 | ## | |
16 | ## "latest_tag"(-"number_of_commits_on_top")(-g"latest_commit_hash")(-dirty) | |
17 | ## | |
18 | ## And store it in "version.i.tmp", if the current commit is tagged, the tag | |
19 | ## starts with "v" and the tree is clean, consider this a release version and | |
20 | ## overwrite the git version with an empty string in "version.i.tmp". | |
21 | ## | |
22 | ## If we don't have a "version.i.tmp" nor a "version.i", generate an empty | |
23 | ## string as a failover. | |
24 | ## | |
25 | ## If we don't have a "version.i" or we have both files and they are different, | |
26 | ## copy "version.i.tmp" over "version.i". This way the dependent targets are | |
27 | ## only rebuilt when the version string changes. | |
28 | ## | |
29 | version_verbose = $(version_verbose_@AM_V@) | |
30 | version_verbose_ = $(version_verbose_@AM_DEFAULT_V@) | |
31 | version_verbose_0 = @echo " GEN " $@; | |
32 | ||
33 | version.i: | |
34 | $(version_verbose)rm -f version.i.tmp; \ | |
35 | if (test -r "$(top_srcdir)/bootstrap" && test -r "$(top_srcdir)/.git") && \ | |
36 | test -x "`which git 2>&1;true`"; then \ | |
37 | GIT_VERSION_STR="`cd "$(top_srcdir)" && git describe --tags --dirty`"; \ | |
38 | GIT_CURRENT_TAG="`cd "$(top_srcdir)" && git describe --tags --exact-match --match="v[0-9]*" HEAD 2> /dev/null`"; \ | |
39 | echo "#define GIT_VERSION \"$$GIT_VERSION_STR\"" > version.i.tmp; \ | |
40 | if ! $(GREP) -- "-dirty" version.i.tmp > /dev/null && \ | |
41 | test "x$$GIT_CURRENT_TAG" != "x"; then \ | |
42 | echo "#define GIT_VERSION \"\"" > version.i.tmp; \ | |
88564da0 | 43 | fi; \ |
337d64f0 MJ |
44 | fi; \ |
45 | if test ! -f version.i.tmp; then \ | |
46 | if test ! -f version.i; then \ | |
47 | echo '#define GIT_VERSION ""' > version.i; \ | |
88564da0 | 48 | fi; \ |
337d64f0 MJ |
49 | elif test ! -f version.i || \ |
50 | test x"`cat version.i.tmp`" != x"`cat version.i`"; then \ | |
51 | mv version.i.tmp version.i; \ | |
52 | fi; \ | |
53 | rm -f version.i.tmp; \ | |
54 | true | |
88564da0 RB |
55 | |
56 | ## | |
337d64f0 MJ |
57 | ## version.i is defined as a .PHONY target even if it's a real file, |
58 | ## we want the target to be re-run on every make. | |
88564da0 | 59 | ## |
337d64f0 | 60 | .PHONY: version.i |
88564da0 | 61 | |
337d64f0 | 62 | CLEANFILES = version.i.tmp |
ec148ec6 | 63 | |
337d64f0 MJ |
64 | ## |
65 | ## Only clean "version.i" on dist-clean, we need to keep it on regular | |
66 | ## clean when it's part of a dist tarball. | |
67 | ## | |
68 | DISTCLEANFILES = version.i | |
4c6ac053 | 69 | |
55d09795 | 70 | lttnginclude_HEADERS = \ |
d74df422 | 71 | lttng/health.h \ |
55d09795 | 72 | lttng/lttng.h \ |
1239a312 DG |
73 | lttng/constant.h \ |
74 | lttng/channel.h \ | |
75 | lttng/domain.h \ | |
76 | lttng/event.h \ | |
77 | lttng/handle.h \ | |
78 | lttng/session.h \ | |
55d09795 | 79 | lttng/lttng-error.h \ |
00c76cea | 80 | lttng/snapshot.h \ |
88564da0 | 81 | lttng/save.h \ |
9245bd0e | 82 | lttng/load.h \ |
a58c490f | 83 | lttng/endpoint.h \ |
db66e574 | 84 | lttng/rotation.h \ |
1ce46cfe JG |
85 | lttng/location.h \ |
86 | lttng/userspace-probe.h | |
da3c9ec1 | 87 | |
a58c490f JG |
88 | lttngactioninclude_HEADERS= \ |
89 | lttng/action/action.h \ | |
90 | lttng/action/notify.h | |
91 | ||
92 | lttngconditioninclude_HEADERS= \ | |
93 | lttng/condition/condition.h \ | |
94 | lttng/condition/buffer-usage.h \ | |
e8360425 | 95 | lttng/condition/session-consumed-size.h \ |
c19092cd | 96 | lttng/condition/session-rotation.h \ |
a58c490f JG |
97 | lttng/condition/evaluation.h |
98 | ||
99 | lttngnotificationinclude_HEADERS= \ | |
100 | lttng/notification/channel.h \ | |
101 | lttng/notification/notification.h | |
102 | ||
103 | lttngtriggerinclude_HEADERS= \ | |
104 | lttng/trigger/trigger.h | |
105 | ||
55d09795 MD |
106 | noinst_HEADERS = \ |
107 | lttng/snapshot-internal.h \ | |
00c76cea | 108 | lttng/health-internal.h \ |
9245bd0e | 109 | lttng/save-internal.h \ |
a58c490f JG |
110 | lttng/load-internal.h \ |
111 | lttng/action/action-internal.h \ | |
112 | lttng/action/notify-internal.h \ | |
113 | lttng/condition/condition-internal.h \ | |
114 | lttng/condition/buffer-usage-internal.h \ | |
e8360425 | 115 | lttng/condition/session-consumed-size-internal.h \ |
a58c490f | 116 | lttng/condition/evaluation-internal.h \ |
c19092cd | 117 | lttng/condition/session-rotation-internal.h \ |
a58c490f JG |
118 | lttng/notification/notification-internal.h \ |
119 | lttng/trigger/trigger-internal.h \ | |
120 | lttng/endpoint-internal.h \ | |
932a07e0 | 121 | lttng/notification/channel-internal.h \ |
159e8e73 | 122 | lttng/channel-internal.h \ |
2d1318e4 | 123 | lttng/event-internal.h \ |
8abe313a | 124 | lttng/rotate-internal.h \ |
434131e4 | 125 | lttng/ref-internal.h \ |
337d64f0 | 126 | lttng/location-internal.h \ |
1ce46cfe | 127 | lttng/userspace-probe-internal.h \ |
337d64f0 MJ |
128 | version.h \ |
129 | version.i |