-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathMakefile
102 lines (86 loc) · 2.91 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
# MAKEFILE
#
# @author Nicola Asuni <nicola.asuni@genomicsplc.com>
# @link https://github.com/genomicsplc/variantkey
# ------------------------------------------------------------------------------
# List special make targets that are not associated with files
.PHONY: help c go javascript python python-class r format clean pubdocs
# CVS path (path to the parent dir containing the project)
CVSPATH=github.com/genomicsplc
# Project vendor
VENDOR=genomicsplc
# Project name
PROJECT=variantkey
# --- MAKE TARGETS ---
# Display general help about this command
help:
@echo ""
@echo "VariantKey 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 javascript : Build and test the Javascript version"
@echo " make python : Build and test the Python version"
@echo " make python-class : Build and test the Python wrapper class"
@echo " make r : Build and test the R version"
@echo " make clean : Remove any build artifact"
@echo " make dbuild : Build everything inside a Docker container"
@echo ""
all: clean c go javascript python python-class r
# Build and test the C version
c:
cd c && make all
# Build and test the GO version
go:
cd go && make all
# Build and test the Javascript version
javascript:
cd javascript && make all
# Build and test the Python version
python:
cd python && make all
# Build and test the Python wrapper class
python-class:
cd python-class && make all
# Build and test the R version
r:
cd r && make all
# Remove any build artifact
clean:
rm -rf target
cd c && make clean
cd go && make clean
cd javascript && make clean
cd python && make clean
cd r && make clean
# Build everything inside a Docker container
dbuild:
@mkdir -p target
@rm -rf target/*
@echo 0 > target/make.exit
CVSPATH=$(CVSPATH) VENDOR=$(VENDOR) PROJECT=$(PROJECT) MAKETARGET='$(MAKETARGET)' ./dockerbuild.sh
@exit `cat target/make.exit`
# Publish Documentation in GitHub (requires writing permissions)
pubdocs:
rm -rf ./target/DOCS
rm -rf ./target/gh-pages
mkdir -p ./target/DOCS/c
cp -r ./c/target/build/doc/html/* ./target/DOCS/c/
mkdir -p ./target/DOCS/go
cp -r ./go/target/docs/* ./target/DOCS/go/
mkdir -p ./target/DOCS/python
cp -r ./python/target/doc/variantkey.html ./target/DOCS/python/
mkdir -p ./target/DOCS/python-class
cp -r ./python-class/target/doc/*.html ./target/DOCS/python-class/
mkdir -p ./target/DOCS/r
cp -r ./r/variantkey/docs/* ./target/DOCS/r/
cp ./resources/doc/index.html ./target/DOCS/
git clone git@github.com:Genomicsplc/variantkey.git ./target/gh-pages
cd target/gh-pages && git checkout gh-pages
mv -f ./target/gh-pages/.git ./target/DOCS/
rm -rf ./target/gh-pages
cd ./target/DOCS/ && \
git add . -A && \
git commit -m 'Update documentation' && \
git push origin gh-pages --force