-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
70 lines (57 loc) · 1.56 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
# MAKEFILE
#
# @author Nicola Asuni <info@tecnick.com>
# @link https://github.com/tecnickcom/binsearch
# ------------------------------------------------------------------------------
SHELL=/bin/bash
.SHELLFLAGS=-o pipefail -c
# Project name
PROJECT=binsearch
# Project version
VERSION=$(shell cat VERSION)
# Project release number (packaging build number)
# RELEASE=$(shell cat RELEASE)
# --- 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 go : Build and test the GO version"
@echo " make python : Build and test the Python 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: c go python
# Build and test the C version
.PHONY: c
c:
cd c && make all
# Build and test the GO version
.PHONY: go
go:
cd go && make all
# Build and test the Python version
.PHONY: python
python:
cd python && make all
# Remove any build artifact
.PHONY: clean
clean:
rm -rf target
cd c && make clean
cd go && make clean
cd python && 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