-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
97 lines (75 loc) · 2.42 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
LOCAL_BIN=/usr/local/bin
APP=${LOCAL_BIN}/repp
APP_DATA=$${HOME}/.repp
SETTINGS=./config/config.yaml
NAME=repp
VERSION=0.1.0
DIST_WIN_ZIP=${NAME}_windows_${VERSION}.zip
DIST_SRC=${NAME}_src_${VERSION}
DIST_SRC_TAR=${DIST_SRC}.tar.gz
PLATFORM:=$(shell uname)
.PHONY: test dist docs
.DEFAULT_GOAL: build
ifeq ($(PLATFORM),Windows_NT)
$(error Windows not supported via make)
endif
build:
go get -d
env GOOS=linux go build -o ./bin/linux -v
env GOOS=darwin go build -o ./bin/darwin -v
env GOOS=windows go build -o ./bin/repp.exe -v
install:
mkdir -p $(APP_DATA)
cp $(SETTINGS) $(APP_DATA)/config.yaml
cp -r ./vendor/primer3_config $(APP_DATA)
cp -r ./assets/addgene/db/** $(APP_DATA)
cp -r ./assets/igem/db/** $(APP_DATA)
cp -r ./assets/dnasu/db/** $(APP_DATA)
cp ./assets/snapgene/features.tsv $(APP_DATA)
cp ./assets/neb/enzymes.tsv $(APP_DATA)
ifeq ($(PLATFORM),Linux)
install ./bin/linux $(APP)
install -C ./vendor/linux/blastn $(LOCAL_BIN)
install -C ./vendor/linux/ntthal $(LOCAL_BIN)
install -C ./vendor/linux/primer3_core $(LOCAL_BIN)
install -C ./vendor/linux/blastdbcmd $(LOCAL_BIN)
endif
ifeq ($(PLATFORM),Darwin)
install ./bin/darwin $(APP)
install -C ./vendor/darwin/blastn $(LOCAL_BIN)
install -C ./vendor/darwin/ntthal $(LOCAL_BIN)
install -C ./vendor/darwin/primer3_core $(LOCAL_BIN)
install -C ./vendor/darwin/blastdbcmd $(LOCAL_BIN)
endif
windows: build
cd scripts && makensis windows_installer.nsi
all: build install
dbs:
cd assets && sh makeblastdbs.sh
uninstall: clean
rm $(APP)
rm -rf $(APP_DATA)
test: all
go test -timeout 200s ./internal/repp
dist-dir:
mkdir -p ${DIST_SRC}
rsync -r --delete\
--exclude={'.git','dist','test','scripts','bin/repp_install.exe','bin/repp.exe','vendor/windows','assets/addgene/addgene.json','assets/dnasu/DNASU*','assets/igem/xml*','assets/neb/*/'}\
. ${DIST_SRC}
tar -czf ${DIST_SRC_TAR} ${DIST_SRC}
rm -rf ${DIST_SRC}
dist: windows dist-dir
cp ./README.md ./docs/index.md
zip ${DIST_WIN_ZIP} ./bin/repp_install.exe
scp ${DIST_SRC_TAR} [email protected]:/home/frs/project/repplasmid/
scp ${DIST_WIN_ZIP} [email protected]:/home/frs/project/repplasmid/
rm ${DIST_SRC_TAR}
rm ${DIST_WIN_ZIP}
docs:
go run . docs
cp README.md ./docs/index.md
cd docs && bundle exec just-the-docs rake search:init
find ./docs -name *make* -type f -exec sed -i -e 's/\/Users\/josh/~/g' {} \;
rm ./docs/*-e
docs-serve: docs
cd docs && bundle exec jekyll serve