AdGuardHome/Makefile
Simon Zolin eb6c4eb132 + release.sh: add armv5 build
Close #1239

Squashed commit of the following:

commit 707e2f8e265e294c7b1328c375648f799a5ae293
Author: Simon Zolin <s.zolin@adguard.com>
Date:   Fri Jan 10 16:32:52 2020 +0300

    leave "AdGuardHome_linux_arm" by default

commit cca01fd03200e70d6ee2201540570382f2b7fdf4
Author: Simon Zolin <s.zolin@adguard.com>
Date:   Fri Jan 10 14:53:37 2020 +0300

    fix auto-update; update readme

commit f393a4f511861ef1998c68775bb8f234c5ce1838
Author: Simon Zolin <s.zolin@adguard.com>
Date:   Fri Jan 10 13:00:37 2020 +0300

    + release.sh: add armv5 build; rename armv6 build

commit 73f2d20ba6b0a94a9929882fe15175ba80b528d7
Author: Simon Zolin <s.zolin@adguard.com>
Date:   Fri Jan 10 12:59:55 2020 +0300

    * release.sh: fix indentation
2020-01-15 18:58:12 +03:00

37 lines
1.1 KiB
Makefile

GIT_VERSION := $(shell git describe --abbrev=4 --dirty --always --tags)
NATIVE_GOOS = $(shell unset GOOS; go env GOOS)
NATIVE_GOARCH = $(shell unset GOARCH; go env GOARCH)
GOPATH := $(shell go env GOPATH)
JSFILES = $(shell find client -path client/node_modules -prune -o -type f -name '*.js')
STATIC = build/static/index.html
CHANNEL ?= release
GOARM_VER :=
TARGET=AdGuardHome
.PHONY: all build clean
all: build
build: $(TARGET)
client/node_modules: client/package.json client/package-lock.json
npm --prefix client ci
touch client/node_modules
$(STATIC): $(JSFILES) client/node_modules
npm --prefix client run build-prod
$(TARGET): $(STATIC) *.go home/*.go dhcpd/*.go dnsfilter/*.go dnsforward/*.go
GOOS=$(NATIVE_GOOS) GOARCH=$(NATIVE_GOARCH) GO111MODULE=off go get -v github.com/gobuffalo/packr/...
PATH=$(GOPATH)/bin:$(PATH) packr -z
CGO_ENABLED=0 go build -ldflags="-s -w -X main.version=$(GIT_VERSION) -X main.channel=$(CHANNEL) -X main.goarm=$(GOARM_VER)" -asmflags="-trimpath=$(PWD)" -gcflags="-trimpath=$(PWD)"
PATH=$(GOPATH)/bin:$(PATH) packr clean
clean:
$(MAKE) cleanfast
rm -rf build
rm -rf client/node_modules
cleanfast:
rm -f $(TARGET)