-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
40 lines (30 loc) · 1.45 KB
/
Makefile
File metadata and controls
40 lines (30 loc) · 1.45 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
GITHUB_OAUTH_CLIENT_ID = 39c483e563cd5cedf7c1
GITHUB_OAUTH_CLIENT_SECRET = 024b16270452504c35f541aca4bf78781cd06db9
FLAGS = -ldflags "-X github.com/coccyx/gogen/internal.gitHubClientID=$(GITHUB_OAUTH_CLIENT_ID) -X github.com/coccyx/gogen/internal.gitHubClientSecret=$(GITHUB_OAUTH_CLIENT_SECRET) -X main.Version=$(VERSION) -X main.GitSummary=$(SUMMARY) -X main.BuildDate=$(DATE)"
GOBIN ?= $(HOME)/go/bin
VERSION = $(shell cat $(CURDIR)/VERSION)
SUMMARY = $(shell git describe --tags --always --dirty)
DATE = $(shell date --rfc-3339=date)
.PHONY: all build deps install test api-test docker splunkapp embed
ifeq ($(OS),Windows_NT)
dockercmd := docker run -e TERM -e HOME=/go/src/github.com/coccyx/gogen --rm -it -v $(CURDIR):/go/src/github.com/coccyx/gogen -v $(HOME)/.ssh:/root/.ssh clintsharp/gogen bash
else
cd := $(shell pwd)
dockercmd := docker run --rm -it -v $(cd):/go/src/github.com/coccyx/gogen clintsharp/gogen bash
endif
all: install
build:
GOOS=linux CGO_ENABLED=0 GOARCH=amd64 go build -tags netgo $(FLAGS) -o build/linux/gogen
GOOS=darwin GOARCH=amd64 go build $(FLAGS) -o build/osx/gogen
GOOS=windows GOARCH=amd64 go build $(FLAGS) -o build/windows/gogen.exe
GOOS=js GOARCH=wasm go build $(FLAGS) -o build/wasm/gogen.wasm
deps:
go install github.com/mattn/goveralls@latest
install:
go install $(FLAGS)
test:
go test -v ./...
api-test:
./.pyvenv/bin/python -m unittest gogen-api/test_auth_utils.py gogen-api/test_upsert_auth.py
docker:
$(dockercmd)