github.com/gnolang/gno@v0.0.0-20240520182011-228e9d0192ce/examples/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  # Official packages (non-overridable): more reliable and tested modules, distinct from the experimentation area.
    26  OFFICIAL_PACKAGES = ./gno.land/p
    27  OFFICIAL_PACKAGES += ./gno.land/r/demo
    28  OFFICIAL_PACKAGES += ./gno.land/r/gnoland
    29  OFFICIAL_PACKAGES += ./gno.land/r/sys
    30  
    31  ########################################
    32  # Dev tools
    33  .PHONY: transpile
    34  transpile:
    35  	go run ../gnovm/cmd/gno transpile -v .
    36  
    37  .PHONY: build
    38  build:
    39  	go run ../gnovm/cmd/gno transpile -v --gobuild .
    40  
    41  .PHONY: test
    42  test:
    43  	go run ../gnovm/cmd/gno test -v ./...
    44  
    45  .PHONY: lint
    46  lint:
    47  	go run ../gnovm/cmd/gno lint $(OFFICIAL_PACKAGES)
    48  
    49  .PHONY: test.sync
    50  test.sync:
    51  	go run ../gnovm/cmd/gno test -v --update-golden-tests ./...
    52  
    53  .PHONY: clean
    54  clean:
    55  	find . \( -name "*.gno.gen.go" -or -name ".*.gno.gen_test.go" \) -delete
    56  
    57  .PHONY: fmt
    58  GOFMT_FLAGS ?= -w
    59  fmt:
    60  	go run -modfile ../misc/devdeps/go.mod mvdan.cc/gofumpt $(GOFMT_FLAGS) `find . -name "*.gno"`
    61  
    62  .PHONY: imports
    63  GOIMPORTS_FLAGS ?= -w
    64  imports:
    65  	$(rundep) golang.org/x/tools/cmd/goimports $(GOIMPORTS_FLAGS) .
    66  
    67  .PHONY: tidy
    68  tidy:
    69  	find . -name "gno.mod" -execdir go run github.com/gnolang/gno/gnovm/cmd/gno mod tidy \;