diff options
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 17 |
1 files changed, 15 insertions, 2 deletions
| @@ -54,7 +54,7 @@ FEATURES+=-DWANT_FULLSCRAPE | |||
| 54 | #FEATURES+=-D_DEBUG_RANDOMTORRENTS | 54 | #FEATURES+=-D_DEBUG_RANDOMTORRENTS |
| 55 | 55 | ||
| 56 | VERSION=1.0.0 | 56 | VERSION=1.0.0 |
| 57 | GIT_VERSION=`sh -c 'command -v git >/dev/null && test -d .git && git describe --tags --match "v*" --always --dirty 2>/dev/null'` | 57 | +GIT_VERSION=`sh -c 'test -r .tarball-version && read v < .tarball-version && echo "$$v" || { command -v git >/dev/null && test -d .git && git describe --tags --match "v*" --always --dirty 2>/dev/null; }'` |
| 58 | 58 | ||
| 59 | OPTS_debug=-D_DEBUG -g -ggdb # -pg -fprofile-arcs -ftest-coverage | 59 | OPTS_debug=-D_DEBUG -g -ggdb # -pg -fprofile-arcs -ftest-coverage |
| 60 | OPTS_production=-O3 | 60 | OPTS_production=-O3 |
| @@ -172,7 +172,7 @@ check-all: | |||
| 172 | $(MAKE) check-integration | 172 | $(MAKE) check-integration |
| 173 | $(MAKE) check-tsan | 173 | $(MAKE) check-tsan |
| 174 | 174 | ||
| 175 | .PHONY: all FORCE check check-poll check-sanitize check-integration check-tsan check-all clean install | 175 | .PHONY: all FORCE dist check check-poll check-sanitize check-integration check-tsan check-all clean install |
| 176 | 176 | ||
| 177 | BINARIES=opentracker opentracker.debug opentracker.integration opentracker.tsan proxy proxy.debug $(TESTBIN) $(TESTBIN).sanitize $(TESTBIN).poll | 177 | BINARIES=opentracker opentracker.debug opentracker.integration opentracker.tsan proxy proxy.debug $(TESTBIN) $(TESTBIN).sanitize $(TESTBIN).poll |
| 178 | 178 | ||
| @@ -181,3 +181,16 @@ clean: | |||
| 181 | 181 | ||
| 182 | install: | 182 | install: |
| 183 | install -m 755 opentracker $(DESTDIR)$(BINDIR) | 183 | install -m 755 opentracker $(DESTDIR)$(BINDIR) |
| 184 | |||
| 185 | # Roll a release: tag it v<something>, then make dist. The commit is written | ||
| 186 | # into the tarball, so a build from it reports the same version this checkout | ||
| 187 | # would, without a git to ask. The tarball is HEAD by construction, so the | ||
| 188 | # working tree it was rolled from does not enter into the version. | ||
| 189 | DISTNAME=opentracker-$(VERSION) | ||
| 190 | |||
| 191 | dist: | ||
| 192 | rm -rf $(DISTNAME) $(DISTNAME).tar.gz | ||
| 193 | git archive --format=tar --prefix=$(DISTNAME)/ HEAD | tar -xf - | ||
| 194 | git describe --tags --match "v*" --always > $(DISTNAME)/.tarball-version | ||
| 195 | tar -czf $(DISTNAME).tar.gz $(DISTNAME) | ||
| 196 | rm -rf $(DISTNAME) | ||
