From b8b6e5266f91cab4934ee56f307c6e474c5e9027 Mon Sep 17 00:00:00 2001 From: James Shubin Date: Wed, 14 Feb 2018 18:20:52 -0500 Subject: [PATCH] build: Improve speed of make Generating a huge amount of unnecessary targets caused "noop" make runs to take seven seconds on my machine. This limits the list of these drastically and now "noop" make's are now < 1s on my machine. Issue discussed in: https://github.com/purpleidea/mgmt/issues/331 --- Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 6dd9f584..a35b5d58 100644 --- a/Makefile +++ b/Makefile @@ -19,7 +19,9 @@ SHELL = /usr/bin/env bash .PHONY: all art cleanart version program lang path deps run race bindata generate build build-debug crossbuild clean test gofmt yamlfmt format docs rpmbuild mkdirs rpm srpm spec tar upload upload-sources upload-srpms upload-rpms copr .SILENT: clean bindata -GO_FILES := $(shell find . -name '*.go') +# a large amount of output from this `find`, can cause `make` to be much slower! +GO_FILES := $(shell find * -name '*.go' -not -path 'old/*' -not -path 'tmp/*') + SVERSION := $(or $(SVERSION),$(shell git describe --match '[0-9]*\.[0-9]*\.[0-9]*' --tags --dirty --always)) VERSION := $(or $(VERSION),$(shell git describe --match '[0-9]*\.[0-9]*\.[0-9]*' --tags --abbrev=0)) PROGRAM := $(shell echo $(notdir $(CURDIR)) | cut -f1 -d"-")