Skip to content

Commit

Permalink
Makefile: If go-bindata is available, warn if bindata.go is out of date
Browse files Browse the repository at this point in the history
  ERROR: bindata.go is out of date. Run 'make go-bindata' in daemon/

Makefile:20: recipe for target 'check-bindata' failed

Signed-off-by: Thomas Graf <thomas@cilium.io>
  • Loading branch information
tgraf committed Mar 22, 2017
1 parent 2f6a41c commit 06151ae
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions daemon/Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
include ../Makefile.defs

all:

TARGET=cilium-agent
SOURCES := $(shell find ../api ../common ../daemon ../pkg . -name '*.go')
$(TARGET): $(SOURCES)
$(TARGET): $(SOURCES) check-bindata
go build $(GOBUILD) -ldflags "-X "github.com/cilium/cilium/common".Version=$(VERSION)" -o $(TARGET)

all: $(TARGET)
Expand All @@ -18,6 +16,18 @@ install: all
$(INSTALL) -m 0755 -d $(DESTDIR)$(BINDIR)
$(INSTALL) -m 0755 $(TARGET) $(DESTDIR)$(BINDIR)

.PHONY: check-bindata
check-bindata:
@which go-bindata > /dev/null 2> /dev/null || exit 0 && \
(go-bindata -prefix ../ -ignore Makefile -ignore '.+\.o$$' -o bindata.tmp ../bpf/...; \
diff -Nru bindata.go bindata.tmp; FAIL=$$?; rm bindata.tmp; test $$FAIL -eq 1 && (\
echo "##################################################################"; \
echo ""; \
echo " ERROR: bindata.go is out of date. Run 'make go-bindata' in daemon/"; \
echo ""; \
echo "##################################################################" ); \
exit $$FAIL)

go-bindata: $(shell find ../bpf)
go-bindata -prefix ../ \
-ignore Makefile \
Expand Down

0 comments on commit 06151ae

Please sign in to comment.