-
Notifications
You must be signed in to change notification settings - Fork 53
/
Makefile
61 lines (49 loc) · 1.65 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
#
# Makefile for managing docopts build
#
# See also: deploy.sh
PREFIX ?= /usr/local
# keep docopts: as first target for development
# govvv define main.Version with the contents of ./VERSION file, if exists
BUILD_FLAGS=$(shell ./get_ldflags.sh)
docopts: docopts.go Makefile
go build -o $@ -ldflags "${BUILD_FLAGS} ${LDFLAGS}"
# dependancies
install_builddep:
go get github.com/docopt/docopts
go get github.com/docopt/docopt-go
go get github.com/mitchellh/gox
go get github.com/itchio/gothub
go get gopkg.in/yaml.v2
go get github.com/ahmetb/govvv
all: install_builddep docopts README.md
./deploy.sh build current
############################ cross compile, we use gox now inside deploy.sh
## build 32 bits version too
#docopts-32bits: docopts.go
# env GOOS=linux GOARCH=386 go build -o docopts-32bits docopts.go
#
## build for OSX
#docopts-OSX: docopts.go
# env GOOS=darwin go build -o docopts-OSX docopts.go
#
## build 32 bits version too
#docopts-arm: docopts.go
# env GOOS=linux GOARCH=arm go build -o docopts-arm docopts.go
###########################
# requires write access to $PREFIX
install: all
install -m 755 docopts $(PREFIX)/bin
install -m 755 docopts.sh $(PREFIX)/bin
test: docopts
./docopts --version
go test -v
python3 language_agnostic_tester.py ./testee.sh
cd ./tests/ && bats .
# README.md is composed with external source too
# Markdown hidden markup are used to insert some text form the dependancies
README.md: examples/legacy_bash/rock_hello_world.sh examples/legacy_bash/rock_hello_world_with_grep.sh docopts build_doc.sh
./build_doc.sh README.md > README.tmp
mv README.tmp README.md
clean:
rm -f docopts-* docopts README.tmp build/*