duckdnsrefresh

Utility to refresh dyn hostnames from duckdns.org
git clone https://git.e1e0.net/duckdnsrefresh.git
Log | Files | Refs | README | LICENSE

Makefile (899B)


      1 #
      2 # Makefile
      3 # Paco Esteban, 2017-06-01 18:03
      4 #
      5 
      6 BINARY=duckdnsrefresh
      7 
      8 VERSION=$(shell cat VERSION)
      9 BUILD=`git rev-parse --short HEAD`
     10 
     11 LDFLAGS=-ldflags "-X main.Version=${VERSION} -X main.Build=${BUILD}"
     12 
     13 .DEFAULT: build
     14 
     15 build:
     16 	mkdir -p ./build
     17 	go build ${LDFLAGS} -o ./build/${BINARY}
     18 
     19 xc_%:
     20 	mkdir -p ./build
     21 	$(eval SUFFIX=$(suffix $@))
     22 	@echo "Cros compiling for: $(basename $*) $(SUFFIX:.%=%)"
     23 	GOOS=$(basename $*) GOARCH=$(SUFFIX:.%=%) CGO_ENABLE=0 \
     24 	     go build ${LDFLAGS} -o \
     25 	     ./build/${BINARY}-${VERSION}-$(basename $*)-$(SUFFIX:.%=%)
     26 
     27 buildall: xc_linux.386 xc_linux.amd64 xc_linux.arm\
     28 	xc_openbsd.386 xc_openbsd.amd64 \
     29 	xc_freebsd.386 xc_freebsd.amd64 \
     30 	xc_darwin.amd64 \
     31 	sign
     32 sign:
     33 	@echo "singing in the rain"
     34 	cd ./build && \
     35 		sha256sum * > SHA256 && \
     36 		gpg --armor --detach-sign SHA256
     37 
     38 clean:
     39 	rm -rf ./build/*
     40 
     41 .PHONY: clean build buildall sign
     42 
     43 # vim:ft=make
     44 #