summarylogtreecommitdiffstats
path: root/makefile.patch
blob: edc49e368bec3061e592c809d294bc807e384d52 (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
37
38
1,2c1,14
< GITREV=`git describe | cut -c 2-`
< LDFLAGS=-ldflags="-X 'github.com/writeas/writefreely.softwareVer=$(GITREV)'"
---
> # make(1) from NetBSD (bmake on many Linux's) uses $(.CURDIR), but GNU Make uses
> # $(CURDIR). Normalize on $(.CURDIR) by setting it to $(CURDIR) if not set, and
> # then $(PWD) if still not set.
> .CURDIR ?= $(CURDIR)
> .CURDIR ?= $(PWD)
> 
> # For reproducible builds, don't store the current build directory by default;
> # instead store only the path from the root of the repo (so there is still
> # enough info in debug messages to find the correct file).
> GCFLAGS  = -gcflags="all=-trimpath=$(.CURDIR)"
> ASMFLAGS = -asmflags="all=-trimpath=$(.CURDIR)"
> 
> GITREV!=git describe --tags | cut -c 2-
> GOLDFLAGS=-ldflags="-X 'github.com/writeas/writefreely.softwareVer=$(GITREV)' -extldflags '$(LDFLAGS)'"
5,7c17,19
< GOINSTALL=$(GOCMD) install $(LDFLAGS)
< GOBUILD=$(GOCMD) build $(LDFLAGS)
< GOTEST=$(GOCMD) test $(LDFLAGS)
---
> GOINSTALL=$(GOCMD) install $(GOLDFLAGS) $(GCFLAGS) $(ASMFLAGS)
> GOBUILD=$(GOCMD) build -buildmode=pie $(GOLDFLAGS) $(GCFLAGS) $(ASMFLAGS)
> GOTEST=$(GOCMD) test $(GOLDFLAGS) $(GCFLAGS) $(ASMFLAGS)
29c41
< 	xgo --targets=linux/amd64, -dest build/ $(LDFLAGS) -tags='sqlite' -out writefreely ./cmd/writefreely
---
> 	xgo --targets=linux/amd64, -dest build/ $(GOLDFLAGS) -tags='sqlite' -out writefreely ./cmd/writefreely
35c47
< 	xgo --targets=windows/amd64, -dest build/ $(LDFLAGS) -tags='sqlite' -out writefreely ./cmd/writefreely
---
> 	xgo --targets=windows/amd64, -dest build/ $(GOLDFLAGS) -tags='sqlite' -out writefreely ./cmd/writefreely
41c53
< 	xgo --targets=darwin/amd64, -dest build/ $(LDFLAGS) -tags='sqlite' -out writefreely ./cmd/writefreely
---
> 	xgo --targets=darwin/amd64, -dest build/ $(GOLDFLAGS) -tags='sqlite' -out writefreely ./cmd/writefreely