github.com/insionng/yougam@v0.0.0-20170714101924-2bc18d833463/libraries/bluemonday/Makefile (about)

     1  # Targets:
     2  #
     3  #   all:          Builds the code locally after testing
     4  #
     5  #   fmt:          Formats the source files
     6  #   build:        Builds the code locally
     7  #   vet:          Vets the code
     8  #   lint:         Runs lint over the code (you do not need to fix everything)
     9  #   test:         Runs the tests
    10  #   cover:        Gives you the URL to a nice test coverage report
    11  #   clean:        Deletes the built file (if it exists)
    12  #
    13  #   install:      Builds, tests and installs the code locally
    14  
    15  .PHONY: all fmt build vet lint test cover clean install
    16  
    17  # The first target is always the default action if `make` is called without
    18  # args we clean, build and install into $GOPATH so that it can just be run
    19  
    20  all: clean fmt vet test install
    21  
    22  fmt:
    23  	@gofmt -w ./$*
    24  
    25  build: clean
    26  	@go build
    27  
    28  vet:
    29  	@vet *.go
    30  
    31  lint:
    32  	@golint *.go
    33  
    34  test:
    35  	@go test -v ./...
    36  
    37  cover: COVERAGE_FILE := coverage.out
    38  cover:
    39  	@go test -coverprofile=$(COVERAGE_FILE) && \
    40  	cover -html=$(COVERAGE_FILE) && rm $(COVERAGE_FILE)
    41  
    42  clean:
    43  	@find $(GOPATH)/pkg/*/github.com/microcosm-cc -name bluemonday.a -delete
    44  
    45  install: clean
    46  	@go install