From 09e4321f08db77247f10c0e03e0c8e4f5b0fb6cd Mon Sep 17 00:00:00 2001 From: Maxim Panfilov Date: Tue, 24 Sep 2024 12:07:54 +0300 Subject: [PATCH] fix Makefile --- .gitignore | 1 + Makefile | 26 ++++++++++---------------- 2 files changed, 11 insertions(+), 16 deletions(-) diff --git a/.gitignore b/.gitignore index 4a29c72..b591f30 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ *.tokens cover.html cover.out +.build \ No newline at end of file diff --git a/Makefile b/Makefile index d6fed4e..c5af77d 100644 --- a/Makefile +++ b/Makefile @@ -1,18 +1,6 @@ # Directory containing the Makefile. -PROJECT_ROOT = $(dir $(abspath $(lastword $(MAKEFILE_LIST)))) - export PATH := $(GOBIN):$(PATH) -BENCH_FLAGS ?= -cpuprofile=cpu.pprof -memprofile=mem.pprof -benchmem - -# Directories that we want to test and track coverage for. -TEST_DIRS = . - -# Directories containing independent Go modules. -MODULE_DIRS = . - -GO_INSTALLABLE_DIRS = cli - .PHONY: all all: lint cover @@ -29,12 +17,18 @@ cover: @go test -coverprofile=cover.out -coverpkg=./... ./... \ && go tool cover -html=cover.out -o cover.html +.PHONY: build +build: go-build + +.PHONY: go-build +go-build: + @cd cmd/raml && go build -o ../../.build/raml + .PHONY: install install: go-install .PHONY: go-install go-install: - @$(foreach dir,$(GO_INSTALLABLE_DIRS), ( \ - cd $(dir) && \ - go install -v ./... \ - && echo `go list -f '{{.Module.Path}}'` has been installed to `go list -f '{{.Target}}'`) &&) true + @cd cmd/raml && \ + go install -v ./... \ + && echo `go list -f '{{.Module.Path}}'` has been installed to `go list -f '{{.Target}}'` && true