-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: Cleanup Makefiles of Go components
- ensure the copyright header is present - improve variable naming in `Makefile.defs` - standardise go invocations with `GO_BUILD`, `GO_TEST`, etc - remove dependency declaration as `go build` manages build cache much more intelligently now and makefile maintenance overhead is unnecessary - ensure all of the common rules are defined consistently, so these can be sourced into a common file in the future - remove trailing and doubly blank lines Signed-off-by: Ilya Dmitrichenko <errordeveloper@gmail.com>
- Loading branch information
1 parent
38bb91e
commit 156bd37
Showing
22 changed files
with
349 additions
and
157 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,7 +38,7 @@ coverage-all.html | |
.idea/ | ||
*.plist | ||
|
||
cilium/bash_autocomplete | ||
*_bash_completion | ||
*.swo | ||
outgoing | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,7 +40,7 @@ coverage-all.html | |
.idea/ | ||
*.plist | ||
|
||
cilium/bash_autocomplete | ||
*_bash_completion | ||
*.swo | ||
outgoing | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,7 +45,7 @@ coverage-all.html | |
.idea/ | ||
*.plist | ||
|
||
cilium/bash_autocomplete | ||
*_bash_completion | ||
*.swo | ||
outgoing | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,44 @@ | ||
# Copyright 2017-2020 Authors of Cilium | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
include ../Makefile.defs | ||
|
||
SUBDIRS = responder | ||
TARGET = cilium-health | ||
TARGET := cilium-health | ||
SUBDIRS := responder | ||
|
||
.PHONY: all $(SUBDIRS) install clean | ||
.PHONY: all $(TARGET) $(SUBDIRS) clean install | ||
|
||
all: $(TARGET) $(SUBDIRS) | ||
|
||
SOURCES := $(shell find ../api/v1/health ../pkg/health cmd . \ | ||
\( -name '*.go' ! -name '*_test.go' $(foreach dir,$(SUBDIRS),! -path './$(dir)/*') \) ) | ||
$(TARGET): $(SOURCES) | ||
$(TARGET): | ||
@$(ECHO_GO) | ||
$(QUIET)$(GO) build $(GOBUILD) -o $(TARGET) | ||
|
||
$(SUBDIRS): force | ||
@ $(MAKE) $(SUBMAKEOPTS) -C $@ all | ||
$(QUIET)$(GO_BUILD) -o $@ | ||
|
||
clean: | ||
@$(ECHO_CLEAN) | ||
$(QUIET)for i in $(SUBDIRS); do $(MAKE) $(SUBMAKEOPTS) -C $$i clean; done | ||
-$(QUIET)rm -f $(TARGET) | ||
$(QUIET)$(GO) clean $(GOCLEAN) | ||
$(QUIET)$(GO_CLEAN) | ||
|
||
install: | ||
$(QUIET)for i in $(SUBDIRS); do $(MAKE) $(SUBMAKEOPTS) -C $$i install; done | ||
$(QUIET)$(INSTALL) -m 0755 -d $(DESTDIR)$(BINDIR) | ||
$(QUIET)$(INSTALL) -m 0755 $(TARGET) $(DESTDIR)$(BINDIR) | ||
|
||
|
||
$(SUBDIRS): force | ||
@ $(MAKE) $(SUBMAKEOPTS) -C $@ all | ||
|
||
.PHONY: force | ||
force :; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
cilium | ||
bash_autocomplete |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,37 @@ | ||
include ../Makefile.quiet | ||
# Copyright 2017-2020 Authors of Cilium | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
include ../Makefile.defs | ||
|
||
TARGET=cilium | ||
SOURCES := $(shell find ../api ../daemon ../common ../pkg cmd . \( -name '*.go' ! -name '*_test.go' \)) | ||
TARGET := cilium | ||
|
||
$(TARGET): $(SOURCES) | ||
@$(ECHO_GO) | ||
$(QUIET)$(GO) build $(GOBUILD) -o $(TARGET) | ||
.PHONY: all $(TARGET) clean install | ||
|
||
all: $(TARGET) | ||
|
||
$(TARGET): | ||
@$(ECHO_GO) | ||
$(QUIET)$(GO_BUILD) -o $@ | ||
|
||
clean: | ||
@$(ECHO_CLEAN) $(notdir $(shell pwd)) | ||
@$(ECHO_CLEAN) | ||
-$(QUIET)rm -f $(TARGET) | ||
$(QUIET)$(GO) clean $(GOCLEAN) | ||
$(QUIET)$(GO_CLEAN) | ||
|
||
install: | ||
$(QUIET)$(INSTALL) -m 0755 -d $(DESTDIR)$(BINDIR) | ||
$(QUIET)$(INSTALL) -m 0755 $(TARGET) $(DESTDIR)$(BINDIR) | ||
$(QUIET)$(INSTALL) -m 0755 -d $(DESTDIR)$(CONFDIR)/bash_completion.d | ||
./$(TARGET) completion bash > bash_autocomplete | ||
$(QUIET)$(INSTALL) -m 0644 -T bash_autocomplete $(DESTDIR)$(CONFDIR)/bash_completion.d/cilium | ||
./$(TARGET) completion bash > $(TARGET)_bash_completion | ||
$(QUIET)$(INSTALL) -m 0644 -T $(TARGET)_bash_completion $(DESTDIR)$(CONFDIR)/bash_completion.d/$(TARGET) |
Oops, something went wrong.