mirror of https://github.com/mpolden/echoip
build: Add cross-compile target
This commit is contained in:
parent
fe68795a50
commit
11ad75c2d2
13
Makefile
13
Makefile
|
@ -4,6 +4,9 @@ OS := $(shell uname)
|
||||||
ifeq ($(OS),Linux)
|
ifeq ($(OS),Linux)
|
||||||
TAR_OPTS := --wildcards
|
TAR_OPTS := --wildcards
|
||||||
endif
|
endif
|
||||||
|
XGOARCH := amd64
|
||||||
|
XGOOS := linux
|
||||||
|
XBIN := $(XGOOS)_$(XGOARCH)/echoip
|
||||||
|
|
||||||
all: lint test install
|
all: lint test install
|
||||||
|
|
||||||
|
@ -62,3 +65,13 @@ ifndef PORT
|
||||||
$(error PORT must be set)
|
$(error PORT must be set)
|
||||||
endif
|
endif
|
||||||
echoip -C 1000000 -f data/country.mmdb -c data/city.mmdb -a data/asn.mmdb -p -r -H CF-Connecting-IP -H X-Forwarded-For -l :$(PORT)
|
echoip -C 1000000 -f data/country.mmdb -c data/city.mmdb -a data/asn.mmdb -p -r -H CF-Connecting-IP -H X-Forwarded-For -l :$(PORT)
|
||||||
|
|
||||||
|
xinstall:
|
||||||
|
env GOOS=$(XGOOS) GOARCH=$(XGOARCH) go install ./...
|
||||||
|
|
||||||
|
publish:
|
||||||
|
ifndef DEST_PATH
|
||||||
|
$(error DEST_PATH must be set when publishing)
|
||||||
|
endif
|
||||||
|
rsync -a $(GOPATH)/bin/$(XBIN) $(DEST_PATH)/$(XBIN)
|
||||||
|
@sha256sum $(GOPATH)/bin/$(XBIN)
|
||||||
|
|
Loading…
Reference in New Issue