utils

small programs, scripts and utils
git clone https://git.e1e0.net/utils.git
Log | Files | Refs

Makefile (476B)


      1 BINARY=port-showvictims
      2 
      3 VERSION =	v0.1.0
      4 PREFIX ?=	/usr/local
      5 OS =		`uname | tr "[:upper:]" "[:lower:]"`
      6 ARCH =		"amd64"
      7 
      8 LDFLAGS =	-ldflags "-X main.Version=${VERSION} -w"
      9 
     10 .DEFAULT: ${BINARY}
     11 
     12 ${BINARY}: main.go
     13 	@echo "Build for ${OS}(${ARCH})"
     14 	GOOS=${OS} GOARCH=${ARCH} \
     15 	     go build ${LDFLAGS} -o ${BINARY}
     16 
     17 .PHONY: clean install
     18 clean:
     19 	rm -rf ${BINARY}
     20 
     21 install: ${BINARY}
     22 	install -m 0755 ${BINARY} ${PREFIX}/bin/
     23 	install -m 0644 ${BINARY}.1 ${PREFIX}/man/man1/