github.com/gnolang/gno@v0.0.0-20240520182011-228e9d0192ce/contribs/Makefile (about)

     1  .PHONY: help
     2  help:
     3  	@echo "Available make commands:"
     4  	@cat Makefile | grep '^[a-z][^:]*:' | cut -d: -f1 | sort | sed 's/^/  /'
     5  
     6  # command to run dependency utilities, like goimports.
     7  rundep=go run -modfile ../misc/devdeps/go.mod
     8  
     9  ########################################
    10  # Environment variables
    11  # You can overwrite any of the following by passing a different value on the
    12  # command line, ie. `CGO_ENABLED=1 make test`.
    13  
    14  # disable cgo by default. cgo requires some additional dependencies in some
    15  # cases, and is not strictly required by any tm2 code.
    16  CGO_ENABLED ?= 0
    17  export CGO_ENABLED
    18  # flags for `make fmt`. -w will write the result to the destination files.
    19  GOFMT_FLAGS ?= -w
    20  # flags for `make imports`.
    21  GOIMPORTS_FLAGS ?= $(GOFMT_FLAGS)
    22  # test suite flags.
    23  GOTEST_FLAGS ?= -v -p 1 -timeout=30m
    24  
    25  ########################################
    26  # Dev tools
    27  .PHONY: install
    28  install: install.gnomd install.gnodev install.gnofaucet
    29  
    30  install.gnomd:;  cd gnomd && go install .
    31  install.gnodev:; $(MAKE) -C ./gnodev install
    32  install.gnofaucet:; $(MAKE) -C ./gnofaucet install
    33  
    34  .PHONY: clean
    35  clean:
    36  	rm -rf build
    37  
    38  ########################################
    39  # Dev tools
    40  rundep=go run -modfile ../misc/devdeps/go.mod
    41  
    42  .PHONY: fmt
    43  fmt:
    44  	$(rundep) mvdan.cc/gofumpt $(GOFMT_FLAGS) .
    45  
    46  .PHONY: tidy
    47  tidy:
    48  	@for gomod in `find . -name go.mod`; do ( \
    49      dir=`dirname $$gomod`; \
    50  	  set -xe; \
    51  	  cd $$dir; \
    52  	  go mod tidy -v; \
    53  	); done
    54  
    55  ########################################
    56  # Test suite
    57  .PHONY: test
    58  test: test.gnodev
    59  test.gnodev:
    60  	$(MAKE) -C ./gnodev test
    61  
    62  ########################################
    63  # Lint
    64  .PHONY: test
    65  lint: lint.gnodev
    66  lint.gnodev:
    67  	$(MAKE) -C ./gnodev test