|
86 | 86 | version:
|
87 | 87 | @echo $(VERSION)
|
88 | 88 |
|
| 89 | +WINDOWS_AMD64_BINARIES = bin/windows_amd64/node-problem-detector.exe bin/windows_amd64/health-checker.exe |
| 90 | +WINDOWS_AMD64_TEST_BINARIES = test/bin/windows_amd64/problem-maker.exe |
| 91 | +LINUX_AMD64_BINARIES = bin/linux_amd64/node-problem-detector bin/linux_amd64/health-checker |
| 92 | +LINUX_AMD64_TEST_BINARIES = test/bin/linux_amd64/problem-maker |
| 93 | +ifeq ($(ENABLE_JOURNALD), 1) |
| 94 | + LINUX_AMD64_BINARIES += bin/linux_amd64/log-counter |
| 95 | +endif |
| 96 | + |
| 97 | +windows-binaries: $(WINDOWS_AMD64_BINARIES) $(WINDOWS_AMD64_TEST_BINARIES) |
| 98 | + |
| 99 | +bin/windows_amd64/%.exe: $(PKG_SOURCES) |
| 100 | +ifeq ($(ENABLE_JOURNALD), 1) |
| 101 | + echo "Journald on Windows is not supported, use make ENABLE_JOURNALD=0 [TARGET]" |
| 102 | +endif |
| 103 | + GOOS=windows GOARCH=amd64 CGO_ENABLED=$(CGO_ENABLED) GO111MODULE=on go build \ |
| 104 | + -mod vendor \ |
| 105 | + -o $@ \ |
| 106 | + -ldflags '-X $(PKG)/pkg/version.version=$(VERSION)' \ |
| 107 | + -tags "$(BUILD_TAGS)" \ |
| 108 | + ./cmd/$(subst -,,$*)/$(subst -,_,$*).go |
| 109 | + touch $@ |
| 110 | + |
| 111 | +./test/bin/windows_amd64/%.exe: $(PKG_SOURCES) |
| 112 | +ifeq ($(ENABLE_JOURNALD), 1) |
| 113 | + echo "Journald on Windows is not supported, use make ENABLE_JOURNALD=0 [TARGET]" |
| 114 | +endif |
| 115 | + GOOS=windows GOARCH=amd64 CGO_ENABLED=$(CGO_ENABLED) GO111MODULE=on go build \ |
| 116 | + -mod vendor \ |
| 117 | + -o $@ \ |
| 118 | + -tags "$(BUILD_TAGS)" \ |
| 119 | + ./test/e2e/$(subst -,,$*)/$(subst -,_,$*).go |
| 120 | + |
| 121 | +bin/linux_amd64/%: $(PKG_SOURCES) |
| 122 | + GOOS=linux GOARCH=amd64 CGO_ENABLED=$(CGO_ENABLED) GO111MODULE=on go build \ |
| 123 | + -mod vendor \ |
| 124 | + -o $@ \ |
| 125 | + -ldflags '-X $(PKG)/pkg/version.version=$(VERSION)' \ |
| 126 | + -tags "$(BUILD_TAGS)" \ |
| 127 | + ./cmd/$(subst -,,$*)/$(subst -,_,$*).go |
| 128 | + touch $@ |
| 129 | + |
| 130 | +./test/bin/linux_amd64/%: $(PKG_SOURCES) |
| 131 | + GOOS=linux GOARCH=amd64 CGO_ENABLED=$(CGO_ENABLED) GO111MODULE=on go build \ |
| 132 | + -mod vendor \ |
| 133 | + -o $@ \ |
| 134 | + -tags "$(BUILD_TAGS)" \ |
| 135 | + ./test/e2e/$(subst -,,$*)/$(subst -,_,$*).go |
| 136 | + |
| 137 | +ifneq ($(ENABLE_JOURNALD), 1) |
| 138 | +bin/linux_amd64/log-counter: |
| 139 | + echo "Warning: log-counter requires journald, skipping." |
| 140 | +endif |
| 141 | + |
| 142 | +# In the future these targets should be deprecated. |
89 | 143 | ./bin/log-counter: $(PKG_SOURCES)
|
90 | 144 | ifeq ($(ENABLE_JOURNALD), 1)
|
91 | 145 | CGO_ENABLED=$(CGO_ENABLED) GOOS=linux GO111MODULE=on go build \
|
@@ -175,5 +229,6 @@ clean:
|
175 | 229 | rm -f bin/health-checker
|
176 | 230 | rm -f bin/log-counter
|
177 | 231 | rm -f bin/node-problem-detector
|
| 232 | + rm -f $(WINDOWS_AMD64_BINARIES) $(LINUX_AMD64_BINARIES) |
178 | 233 | rm -f test/bin/problem-maker
|
179 | 234 | rm -f node-problem-detector-*.tar.gz
|
0 commit comments