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

all: build lulu

build: ${SRC} ${GEN}
	go build

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

${GEN}: .gen

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

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

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

clean:
	cat .gitignore | xargs -I{} sh -c "rm -rf ./{}"

.PHONY: testcli