github.com/maenmax/kairep@v0.0.0-20210218001208-55bf3df36788/Makefile (about)

     1  GOPATH:=$(shell pwd)
     2  GO:=go
     3  GOFLAGS:=-v -p 1
     4  
     5  default:  autoendpoint remover test injector
     6  
     7  all: clean default
     8  
     9  autoendpoint: bin/autoendpoint
    10  
    11  test: bin/test_sanitize_header
    12  
    13  remover: bin/sub_remover
    14  
    15  injector: bin/sub_injector
    16  
    17  
    18  bin/autoendpoint: src/empowerthings.com/autoendpoint/autoendpoint.go
    19  	@echo "========== Compiling $@ =========="
    20  	sh -c 'export GOPATH=${GOPATH}; $(GO) install $(GOFLAGS) empowerthings.com/autoendpoint/ '
    21  
    22  bin/test_sanitize_header: src/empowerthings.com/autoendpoint/test/test_sanitize_header/test_sanitize_header.go
    23  	@echo "========== Compiling $@ =========="
    24  	sh -c 'export GOPATH=${GOPATH}; $(GO) install $(GOFLAGS) empowerthings.com/autoendpoint/test/test_sanitize_header'
    25  
    26  bin/sub_remover: src/empowerthings.com/sub_remover/sub_remover.go
    27  	@echo "========== Compiling $@ =========="
    28  	sh -c 'export GOPATH=${GOPATH}; $(GO) install $(GOFLAGS) empowerthings.com/sub_remover/'
    29  
    30  
    31  bin/sub_injector: src/empowerthings.com/sub_injector/sub_injector.go
    32  	@echo "========== Compiling $@ =========="
    33  	sh -c 'export GOPATH=${GOPATH}; $(GO) install $(GOFLAGS) empowerthings.com/sub_injector/'
    34  
    35  deploy:
    36  	tar -cvjf "rep-autopush-`git describe --tags --abbrev=0`.tar.bz2" bin
    37  
    38  VERSION_DOCKER=$(shell echo `git describe`.`date +"%Y%m%d%H%M%S"` > .version)
    39  docker: ${VERSION_DOCKER}
    40  	docker build . -t rep-autopush-$$(git describe --abbrev=0)
    41  
    42  clean:
    43  	@echo "Deleting generated binary files ..."; sh -c 'if [ -d bin ]; then  find bin/ -type f -exec rm {} \; -print ; fi; rm -Rf bin'
    44  	@echo "Deleting generated archive files ..."; sh -c 'if [ -d pkg ]; then  find pkg -type f -name \*.a -exec rm {} \; -print ; fi;  rm -Rf pkg'
    45  	@echo "Deleting emacs backup files ..."; find . -type f -name \*~ -exec rm {} \; -print
    46  	@echo "Deleting log files ..."; find . -maxdepth 1 -type f \( -name \*.log.\* -o -name \*.log \) -exec rm {} \; -print