github.com/nak3/source-to-image@v1.1.10-0.20180319140719-2ed55639898d/Makefile (about)

     1  # Old-skool build tools.
     2  #
     3  # Targets (see each target for more information):
     4  #   all: Build code.
     5  #   build: Build code.
     6  #   check: Run build, verify and tests.
     7  #   test: Run tests.
     8  #   clean: Clean up.
     9  #   release: Build release.
    10  
    11  OUT_DIR = _output
    12  
    13  export GOFLAGS
    14  
    15  # Build code.
    16  #
    17  # Args:
    18  #   GOFLAGS: Extra flags to pass to 'go' when building.
    19  #
    20  # Example:
    21  #   make
    22  #   make all
    23  all build:
    24  	hack/build-go.sh
    25  .PHONY: all build
    26  
    27  # Verify if code is properly organized.
    28  #
    29  # Example:
    30  #   make verify
    31  verify: build
    32  	hack/verify-gofmt.sh
    33  	hack/verify-golint.sh
    34  	hack/verify-govet.sh
    35  	hack/verify-godeps.sh || true # remove this to make godepchecker's warnings actionable
    36  	hack/verify-bash-completion.sh
    37  .PHONY: verify
    38  
    39  # Install travis dependencies
    40  #
    41  # Example:
    42  #   make install-travis
    43  install-travis:
    44  	hack/install-tools.sh
    45  .PHONY: install-travis
    46  
    47  # Build and run unit tests
    48  #
    49  # Args:
    50  #   WHAT: Directory names to test.  All *_test.go files under these
    51  #     directories will be run.  If not specified, "everything" will be tested.
    52  #   TESTS: Same as WHAT.
    53  #   GOFLAGS: Extra flags to pass to 'go' when building.
    54  #   TESTFLAGS: Extra flags that should only be passed to hack/test-go.sh
    55  #
    56  # Example:
    57  #   make check
    58  #   make test
    59  #   make check WHAT=pkg/docker TESTFLAGS=-v
    60  check: verify test	
    61  .PHONY: check
    62  
    63  # Run unit tests
    64  # Example:
    65  #   make test
    66  #   make test WHAT=pkg/docker TESTFLAGS=-v 
    67  test: 
    68  	hack/test-go.sh $(WHAT) $(TESTS) $(TESTFLAGS)
    69  .PHONY: test
    70  
    71  
    72  # Remove all build artifacts.
    73  #
    74  # Example:
    75  #   make clean
    76  clean:
    77  	rm -rf $(OUT_DIR)
    78  .PHONY: clean
    79  
    80  # Build the release.
    81  #
    82  # Example:
    83  #   make release
    84  release: clean
    85  	hack/build-release.sh
    86  	hack/extract-release.sh
    87  .PHONY: release