aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: ba7f80206530b2594c6e9e53137701d77e7a0a78 (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
.POSIX:

PREFIX = /usr/local
DPREFIX = ${DESTDIR}${PREFIX}

target = gsp
sources = main.go \
          formatter/formatter.go \
          parser/errors.go \
          parser/parser.go \
          parser/reader.go

all: ${target}
gsp: ${sources}
	go build

install:
	mkdir -p ${DPREFIX}/bin \
	         ${DPREFIX}/share/man/man1 \
	         ${DPREFIX}/share/man/man5
	cp ${target}   ${DPREFIX}/bin
	cp ${target}.1 ${DPREFIX}/share/man/man1
	cp ${target}.5 ${DPREFIX}/share/man/man5

dist:
	mkdir -p dist
	for os in darwin linux windows; do \
		for arch in amd64 arm64; do \
			GOARCH=$$arch GOOS=$$os go build -o dist/gsp-$$os-$$arch; \
		done; \
	done

test:
	go test ./...

clean:
	rm -rf dist