-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMakefile
50 lines (39 loc) · 1010 Bytes
/
Makefile
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
41
42
43
44
45
46
47
48
49
50
.DEFAULT_GOAL := build
VERSION := 1.1.1
BUILDNUMBER := 1
# fpm settings
NAME := postforward
ARCH := x86_64
MAINTAINER := Nick Groenen <[email protected]>
DESCRIPTION := Postfix SRS forwarding agent
EXTRA_ARGS :=
.PHONY: build
build:
go build -ldflags="-s -w" *.go
.PHONY: debian
debian:
mkdir -p usr/bin
GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" -o usr/bin/postforward *.go
fpm -f -t deb -s dir \
--name "$(NAME)" \
--version "$(VERSION)-$(BUILDNUMBER)" \
--architecture "$(ARCH)" \
--maintainer "$(MAINTAINER)" \
--description "$(DESCRIPTION)" \
$(EXTRA_ARGS) \
usr/
.PHONY: freebsd
freebsd:
mkdir -p usr/local/bin
GOOS=freebsd GOARCH=amd64 go build -ldflags="-s -w" -o usr/local/bin/postforward *.go
fpm -f -t freebsd -s dir \
--name "$(NAME)" \
--version "$(VERSION)-$(BUILDNUMBER)" \
--architecture "$(ARCH)" \
--maintainer "$(MAINTAINER)" \
--description "$(DESCRIPTION)" \
$(EXTRA_ARGS) \
usr/
.PHONY: clean
clean:
rm -rf postforward usr/ *.txz *.deb