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

     1  .PHONY: help
     2  help:
     3  	@echo "Available make commands:"
     4  	@cat Makefile | grep '^[a-z][^:]*:' | grep -v 'install_' | 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  # NOTE: these are not very useful in this makefile, but they serve as
    14  # documentation for sub-makefiles.
    15  
    16  # disable cgo by default. cgo requires some additional dependencies in some
    17  # cases, and is not strictly required by any tm2 code.
    18  CGO_ENABLED ?= 0
    19  export CGO_ENABLED
    20  # flags for `make fmt`. -w will write the result to the destination files.
    21  GOFMT_FLAGS ?= -w
    22  # flags for `make imports`.
    23  GOIMPORTS_FLAGS ?= $(GOFMT_FLAGS)
    24  # test suite flags.
    25  GOTEST_FLAGS ?= -v -p 1 -timeout=30m
    26  # when running `make tidy`, use it to check that the go.mods are up-to-date.
    27  VERIFY_MOD_SUMS ?= false
    28  
    29  ########################################
    30  # Dev tools
    31  .PHONY: install
    32  install: install.gnokey install.gno install.gnodev
    33  
    34  # shortcuts to frequently used commands from sub-components.
    35  .PHONY: install.gnokey
    36  install.gnokey:
    37  	$(MAKE) --no-print-directory -C ./gno.land	install.gnokey
    38  	# \033[0;32m ... \033[0m is ansi for green text.
    39  	@echo "\033[0;32m[+] 'gnokey' has been installed. Read more in ./gno.land/\033[0m"
    40  .PHONY: install.gno
    41  install.gno:
    42  	$(MAKE) --no-print-directory -C ./gnovm	install
    43  	@echo "\033[0;32m[+] 'gno' has been installed. Read more in ./gnovm/\033[0m"
    44  .PHONY: install.gnodev
    45  install.gnodev:
    46  	$(MAKE) --no-print-directory -C ./contribs install.gnodev
    47  	@echo "\033[0;32m[+] 'gnodev' has been installed. Read more in ./contribs/gnodev/\033[0m"
    48  
    49  # old aliases
    50  .PHONY: install_gnokey
    51  install_gnokey: install.gnokey
    52  .PHONY: install_gno
    53  install_gno: install.gno
    54  
    55  .PHONY: test
    56  test: test.components test.docker
    57  
    58  .PHONY: test.components
    59  test.components:
    60  	$(MAKE) --no-print-directory -C tm2      test
    61  	$(MAKE) --no-print-directory -C gnovm    test
    62  	$(MAKE) --no-print-directory -C gno.land test
    63  	$(MAKE) --no-print-directory -C examples test
    64  	$(MAKE) --no-print-directory -C misc     test
    65  
    66  .PHONY: test.docker
    67  test.docker:
    68  	@if hash docker 2>/dev/null; then \
    69  		go test --tags=docker -count=1 -v ./misc/docker-integration; \
    70  	else \
    71  		echo "[-] 'docker' is missing, skipping ./misc/docker-integration tests."; \
    72  	fi
    73  
    74  .PHONY: fmt
    75  fmt:
    76  	$(MAKE) --no-print-directory -C tm2      fmt imports
    77  	$(MAKE) --no-print-directory -C gnovm    fmt imports
    78  	$(MAKE) --no-print-directory -C gno.land fmt imports
    79  	$(MAKE) --no-print-directory -C examples fmt
    80  
    81  .PHONY: lint
    82  lint:
    83  	$(rundep) github.com/golangci/golangci-lint/cmd/golangci-lint run --config .github/golangci.yml
    84  
    85  .PHONY: tidy
    86  tidy:
    87  	$(MAKE) --no-print-directory -C misc     tidy