aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
blob: 8e573aa6d7a6048df40effe5be9aec40c0526384 (plain) (blame)
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
GEN = $(addsuffix _gen.go, cover interior pkgid ship status)
TEST = $(wildcard *_test.go)
SRC = $(filter-out ${GEN} ${TEST}, $(wildcard *.go))

all: build lulu

test: testpkg testcli

build: .build
.build: ${SRC} ${GEN}
	go build
	touch $@

${GEN}: .gen
.gen: ${SRC}
	go generate
	touch $@

lulu: ${SRC} ${GEN} $(wildcard cmd/lulu/*.go)
	go build ./cmd/$@

testpkg: .testpkg
.testpkg: ${SRC} ${GEN} ${TEST}
	go test ./...
	touch $@

testcli: .testcli
.testcli: lulu $(wildcard $(addprefix cmd/lulu/, test tests/* testdata/* testchecks/*))
	$(eval PATH=$(shell pwd):${PATH})
	cd cmd/lulu && ./test
	touch $@

spec.yml:
	curl -L -o $@ 'https://api.lulu.com/api-docs/openapi-specs/openapi_public.yml'

clean:
	rm -rf ${GEN} lulu .build .gen .testpkg .testcli cmd/lulu/testerr cmd/lulu/testout

.PHONY: all build test testpkg testcli