-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
122 lines (101 loc) · 2.79 KB
/
Makefile
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
# MAKEFILE
#
# @author Nicola Asuni <info@tecnick.com>
# @link https://github.com/tecnickcom/farmhash64
# ------------------------------------------------------------------------------
SHELL=/bin/bash
.SHELLFLAGS=-o pipefail -c
# Project name
PROJECT=farmhash64
# Project version
VERSION=$(shell cat VERSION)
# Project release number (packaging build number)
RELEASE=$(shell cat RELEASE)
# Current directory
CURRENTDIR=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
# --- MAKE TARGETS ---
# Display general help about this command
.PHONY: help
help:
@echo ""
@echo "$(PROJECT) Makefile."
@echo "The following commands are available:"
@echo ""
@echo " make c : Build and test the C version"
@echo " make cgo : Build and test the GO C-wrapper version"
@echo " make clean : Remove any build artifact"
@echo " make go : Build and test the GO version"
@echo " make java : Build and test the Java version"
@echo " make javascript : Build and test the Javascript version"
@echo " make php : Build and test the PHP version"
@echo " make python : Build and test the Python version"
@echo " make r : Build and test the R version"
@echo " make rust : Build and test the Rust version"
@echo " make zig : Build and test the Zig version"
@echo " make tag : Tag the Git repository"
@echo " make versionup : Increase the patch number in the VERSION file"
@echo ""
all: clean c cgo go java javascript php python r rust zig
# Build and test the C version
.PHONY: c
c:
cd c && make all
# Build and test the CGO version
.PHONY: cgo
cgo:
cd cgo && make all
# Build and test the GO version
.PHONY: go
go:
cd go && make all
# Build and test the Java version
.PHONY: java
java:
cd java && make all
# Build and test the Javascript version
.PHONY: javascript
javascript:
cd javascript && make all
# Build and test the PHP version
.PHONY: php
php:
cd php && make all
# Build and test the Python version
.PHONY: python
python:
cd python && make all
# Build and test the R version
.PHONY: r
r:
cd r && make all
# Build and test the Rust version
.PHONY: rust
rust:
cd rust && make all
# Build and test the Zig version
.PHONY: zig
zig:
cd zig && make all
# Remove any build artifact
.PHONY: clean
clean:
rm -rf vendor composer.lock
cd c && make clean
cd cgo && make clean
cd go && make clean
cd java && make clean
cd javascript && make clean
cd php && make clean
cd python && make clean
cd r && make clean
cd rust && make clean
cd zig && make clean
# Tag the Git repository
.PHONY: tag
tag:
git tag -a "v$(VERSION)" -m "Version $(VERSION)" && \
git push origin --tags
# Increase the patch number in the VERSION file
.PHONY: versionup
versionup:
echo ${VERSION} | gawk -F. '{printf("%d.%d.%d\n",$$1,$$2,(($$3+1)));}' > VERSION