-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile2
More file actions
70 lines (58 loc) · 1.89 KB
/
Makefile2
File metadata and controls
70 lines (58 loc) · 1.89 KB
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
GOCMD=go
GOBUILD=$(GOCMD) build
GOCLEAN=$(GOCMD) clean
GOTEST=$(GOCMD) test
GOGENERATE=$(GOCMD) generate
ENVCMD=env
GO_LINUX_ENV=$(ENVCMD) GOOS=linux GOARCH=amd64
GO_WIN_ENV=$(ENVCMD) GOOS=windows GOARCH=amd64
NPMCMD=@npm
NPMINSTALL=$(NPMCMD) install
BINARY_WIN=kosher.exe
BINARY_LIN=kosher
DEPCMD=@dep
DEPENSURE=$(DEPCMD) ensure
all: clean test build buildall
install: build
@java -jar kosher.jar
deps:
@echo "Downloading [kosher] project dependencies..."
@$(DEPENSURE)
@$(NPMINSTALL)
@cp node_modules/axe-core/axe.min.js libs/
@echo "Confirming [kosher-env] project is cloned to ~/go/src/github.com/cbush06/kosher-env..."
@if ! [ -f ../kosher-env/Makefile ]; then \
echo "Missing [kosher-env] project! Please clone [https://github.com/cbush06/kosher-env] and try again...";\
exit 2;\
fi
@echo "Building [kosher-env] project..."
@cd ../kosher-env && make build
@cd ../kosher
@cp ../kosher-env/windows-config.exe .
@cp ../kosher-env/linux-config .
generate:
@echo "Generating Go source files with [go generate]..."
@$(GOGENERATE)
build: deps generate
@echo "Building [kosher] project..."
@$(GO_LINUX_ENV) $(GOBUILD)
@$(GO_WIN_ENV) $(GOBUILD)
buildall: build
@echo "Confirming [IzPack] project is extracted to ~/IzPack"
@if ! [ -f ~/IzPack/bin/compile ]; then \
echo "Missing [IzPack] installation. Please extract to [~/IzPack] and try again...";\
exit 2;\
fi
@echo "Building [kosher] installer..."
@~/IzPack/bin/compile ~/go/src/github.com/cbush06/kosher/izpack.xml -b ~/go/src/github.com/cbush06/kosher/ -o kosher.jar
test: deps generate
@$(GOTEST) -v -race -coverpkg=github.com/cbush06/kosher/... -covermode=atomic -coverprofile=coverage.txt github.com/cbush06/kosher/...
clean:
@echo "Cleaning Kosher artifacts"
@$(GOCLEAN)
@rm -f ../kosher-env/windows-config.exe
@rm -f ../kosher-env/linux-config
@rm -f windows-config.exe
@rm -f linux-config
@rm -f kosher.jar
@rm -f libs/axe.min.js