-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
123 lines (101 loc) · 2.4 KB
/
Copy pathMakefile
File metadata and controls
123 lines (101 loc) · 2.4 KB
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
123
# 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 ---
.PHONY: help
help:
@echo ""
@echo "$(PROJECT) Makefile."
@echo "The following commands are available:"
@echo ""
@awk '/^## /{desc=substr($$0,4)} /^\.PHONY:/{if(NF>1) {target=$$2; if(desc) printf " make %-15s: %s\n",target,desc; desc=""}}' Makefile
@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
# Run the linters for every language
.PHONY: linter
linter:
cd c && make linter
cd cgo && make linter
cd go && make linter
cd java && make linter
cd javascript && make linter
cd php && make linter
cd python && make linter
cd r && make linter
cd rust && make linter
cd zig && make linter
# 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