Skip to content

Commit

Permalink
Makefile: checking golang version
Browse files Browse the repository at this point in the history
Since we don't yet support golang 1.8 we need to check it if the
developer wants to build the project.

$ make
if [[ "go1.8" == "go1.8" ]]; then \
        echo "golang 1.8 is currently not supported, please downgrade to a lower version"; \
        exit 1; \
fi
golang 1.8 is currently not supported, please downgrade to a lower version
Makefile:10: recipe for target 'check-golang' failed
make: *** [check-golang] Error 1

Signed-off-by: André Martins <andre@cilium.io>
  • Loading branch information
aanm authored and tgraf committed Mar 21, 2017
1 parent 60d1c9b commit eb2b8a1
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,15 @@ include Makefile.defs

SUBDIRS = plugins bpf cilium daemon
GOFILES = $(shell go list ./... | grep -v /vendor/)
GOLANGVERSION = $(shell go version 2>/dev/null | grep -Eo '(go[0-9].[0-9](.[0-9])?)')

all: $(SUBDIRS)
all: check-golang $(SUBDIRS)

check-golang:
if [ "${GOLANGVERSION}" = "go1.8" ]; then \
echo "golang 1.8 is currently not supported, please downgrade to a lower version"; \
exit 1; \
fi

$(SUBDIRS): force
@ $(MAKE) -C $@ all
Expand Down

0 comments on commit eb2b8a1

Please sign in to comment.