aboutsummaryrefslogtreecommitdiffstats
path: root/skate/Makefile
blob: e87e1128eb1740e10b587afccb9029a787aca82c (plain)
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
SHELL := /bin/bash
TARGETS := skate-conv skate-cleanup skate-from-unstructured skate-wikipedia-doi skate-map skate-reduce skate-cdx-lookup skate-resolve-journal-name
PKGNAME := skate

.PHONY: test
test:
	go test -cover -v ./...

.PHONY: bench
bench:
	go test -bench=.

.PHONY: generate
generate:
	go install golang.org/x/tools/cmd/stringer@latest && go generate

.PHONY: all
all: generate $(TARGETS)
	go mod tidy

%: cmd/%/main.go
	go build -ldflags="-s -w" -o $@ $<

.PHONY: clean
clean:
	rm -f $(TARGETS)
	rm -f $(PKGNAME)_*.deb
	rm -rf packaging/debian/$(PKGNAME)/usr

.PHONY: deb
deb: all
	mkdir -p packaging/debian/$(PKGNAME)/usr/local/bin
	cp $(TARGETS) packaging/debian/$(PKGNAME)/usr/local/bin
	cd packaging/debian && fakeroot dpkg-deb --build $(PKGNAME) .
	mv packaging/debian/$(PKGNAME)_*.deb .