Skip to content

Commit ca13b76

Browse files
michi-covalenttklauser
authored andcommitted
cilium-cli: Specify TARGET for building release binaries
Some downstream projects [^1] override TARGET, expecting the output file to go to the location specified by it. Although TARGET is marked phony, I think it's best to keep the previous behavior of using TARGET as the output file location to avoid impacting downstream projects. This commit changes the local-release target to specify TARGET instead of introducing BUILDDIR and EXT that modify the location of the output file of TARGET. [^1]: https://github.com/cilium/cilium-cli/blob/649a1df5bcfcc6c87bc30e1fe70610a7806d04a7/action.yaml#L85 Fixes: 0532a11 ("cilium-cli: Use the default Make target to build release binaries") Reported-by: Viktor Kurchenko <viktor.kurchenko@isovalent.com> Signed-off-by: Michi Mutsuzaki <michi@isovalent.com>
1 parent f5946af commit ca13b76

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

cilium-cli/Makefile

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,9 @@ GO_TAGS_FLAGS += $(GO_TAGS)
2020

2121
TEST_TIMEOUT ?= 5s
2222

23-
BUILDDIR ?= .
24-
EXT ?=
25-
2623
$(TARGET):
2724
$(GO_BUILD) \
28-
-o $(BUILDDIR)/$(@)$(EXT) \
25+
-o $(@) \
2926
$(CLI_MAIN_DIR)
3027

3128
local-release: clean
@@ -48,7 +45,7 @@ local-release: clean
4845
for ARCH in $$ARCHS; do \
4946
echo Building release binary for $$OS/$$ARCH...; \
5047
test -d release/$$OS/$$ARCH|| mkdir -p release/$$OS/$$ARCH; \
51-
$(MAKE) GOOS=$$OS GOARCH=$$ARCH BUILDDIR=release/$$OS/$$ARCH EXT=$$EXT; \
48+
$(MAKE) GOOS=$$OS GOARCH=$$ARCH TARGET=release/$$OS/$$ARCH/$(TARGET)$$EXT; \
5249
if [ $$OS = "windows" ]; \
5350
then \
5451
zip -j release/$(TARGET)-$$OS-$$ARCH.zip release/$$OS/$$ARCH/$(TARGET)$$EXT; \
@@ -63,7 +60,7 @@ local-release: clean
6360

6461
install: $(TARGET)
6562
$(INSTALL) -m 0755 -d $(DESTDIR)$(BINDIR)
66-
$(INSTALL) -m 0755 $(BUILDDIR)/$(TARGET)$(EXT) $(DESTDIR)$(BINDIR)
63+
$(INSTALL) -m 0755 $(TARGET) $(DESTDIR)$(BINDIR)
6764

6865
clean:
6966
rm -f $(TARGET)

0 commit comments

Comments
 (0)