Skip to content

Commit

Permalink
chore: Using Windows, add exe extension to tools (influxdata#11608)
Browse files Browse the repository at this point in the history
  • Loading branch information
sspaink authored Aug 3, 2022
1 parent f001c99 commit fa811ed
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
/telegraf.exe
/telegraf.gz
/tools/package_lxd_test/package_lxd_test
/tools/license_checker/license_checker
/tools/readme_config_includer/generator
/tools/license_checker/license_checker*
/tools/readme_config_includer/generator*
/vendor
.DS_Store
process.yml
Expand Down
15 changes: 7 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
ifeq ($(OS),Windows_NT)
next_version := $(shell type build_version.txt)
tag := $(shell git describe --exact-match --tags 2> nul)
else
next_version := $(shell cat build_version.txt)
tag := $(shell git describe --exact-match --tags 2>/dev/null)
ifneq (,$(filter $(OS),Windows_NT Windows))
EXEEXT=.exe
endif

next_version := $(shell cat build_version.txt)
tag := $(shell git describe --exact-match --tags 2>/dev/null)

branch := $(shell git rev-parse --abbrev-ref HEAD)
commit := $(shell git rev-parse --short=8 HEAD)
glibc_version := 2.17
Expand Down Expand Up @@ -115,8 +114,8 @@ versioninfo:
go generate cmd/telegraf/telegraf_windows.go; \

build_tools:
$(HOSTGO) build -o ./tools/license_checker/license_checker ./tools/license_checker
$(HOSTGO) build -o ./tools/readme_config_includer/generator ./tools/readme_config_includer/generator.go
$(HOSTGO) build -o ./tools/license_checker/license_checker$(EXEEXT) ./tools/license_checker
$(HOSTGO) build -o ./tools/readme_config_includer/generator$(EXEEXT) ./tools/readme_config_includer/generator.go

embed_readme_%:
go generate -run="readme_config_includer/generator$$" ./plugins/$*/...
Expand Down
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,18 +73,21 @@ sudo yum install telegraf

Telegraf requires Go version 1.18 or newer, the Makefile requires GNU make.

On Windows, the makefile requires the use of a bash terminal to support all makefile targets.
An easy option to get bash for windows is using the version that comes with [git for windows](https://gitforwindows.org/).

1. [Install Go](https://golang.org/doc/install) >=1.18 (1.18.0 recommended)
2. Clone the Telegraf repository:

```shell
git clone https://github.com/influxdata/telegraf.git
```

3. Run `make` from the source directory
3. Run `make build` from the source directory

```shell
cd telegraf
make
make build
```

### Nightly Builds
Expand Down

0 comments on commit fa811ed

Please sign in to comment.