-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
93 lines (76 loc) · 2.13 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
# MAKEFILE
#
# @author Nicola Asuni
# @link https://github.com/Vonage/numkey
# ------------------------------------------------------------------------------
SHELL=/bin/bash
.SHELLFLAGS=-o pipefail -c
# Project name
PROJECT=numkey
# 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 go : Build and test the GO version"
@echo " make javascript : Build and test the Javascript version"
@echo " make python : Build and test the Python version"
@echo " make java : Build and test the Java version"
@echo " make clean : Remove any build artifact"
@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 python
# 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 Javascript version
.PHONY: javascript
javascript:
cd javascript && make all
# Build and test the Python version
.PHONY: python
python:
cd python && make all
# Build and test the Java version
.PHONY: java
java:
cd java && make all
# Remove any build artifact
.PHONY: clean
clean:
cd c && make clean
cd cgo && make clean
cd go && make clean
cd javascript && make clean
cd python && make clean
cd java && 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