소스 검색

Fix to build/release windows binaries from Linux

Madhan Raj Mookkandy 7 년 전
부모
커밋
247d3c16aa
10개의 변경된 파일25개의 추가작업 그리고 0개의 파일을 삭제
  1. 7 0
      Makefile
  2. 2 0
      backend/hostgw/hostgw.go
  3. 2 0
      backend/hostgw/hostgw_windows.go
  4. 2 0
      backend/ipip/ipip.go
  5. 2 0
      backend/route_network.go
  6. 2 0
      backend/udp/udp_network_amd64.go
  7. 2 0
      backend/vxlan/device.go
  8. 2 0
      pkg/ip/iface.go
  9. 2 0
      pkg/ip/iface_test.go
  10. 2 0
      pkg/ns/ns.go

+ 7 - 0
Makefile

@@ -38,6 +38,10 @@ dist/flanneld: $(shell find . -type f  -name '*.go')
 	go build -o dist/flanneld \
 	  -ldflags '-s -w -X github.com/coreos/flannel/version.Version=$(TAG) -extldflags "-static"'
 
+dist/flanneld.exe: $(shell find . -type f  -name '*.go')
+	GOOS=windows go build -o dist/flanneld.exe \
+	  -ldflags '-s -w -X github.com/coreos/flannel/version.Version=$(TAG) -extldflags "-static"'
+
 # This will build flannel natively using golang image
 dist/flanneld-$(ARCH):
 	# valid values for ARCH are [amd64 arm arm64 ppc64le s390x]
@@ -136,6 +140,9 @@ tar.gz:
 	ARCH=amd64 make dist/flanneld-amd64
 	tar --transform='flags=r;s|-amd64||' -zcvf dist/flannel-$(TAG)-linux-amd64.tar.gz -C dist flanneld-amd64 mk-docker-opts.sh ../README.md
 	tar -tvf dist/flannel-$(TAG)-linux-amd64.tar.gz
+	ARCH=amd64 make dist/flanneld.exe
+	tar --transform='flags=r;s|-amd64||' -zcvf dist/flannel-$(TAG)-windows-amd64.tar.gz -C dist flanneld.exe mk-docker-opts.sh ../README.md
+	tar -tvf dist/flannel-$(TAG)-windows-amd64.tar.gz
 	ARCH=ppc64le make dist/flanneld-ppc64le
 	tar --transform='flags=r;s|-ppc64le||' -zcvf dist/flannel-$(TAG)-linux-ppc64le.tar.gz -C dist flanneld-ppc64le mk-docker-opts.sh ../README.md
 	tar -tvf dist/flannel-$(TAG)-linux-ppc64le.tar.gz

+ 2 - 0
backend/hostgw/hostgw.go

@@ -1,3 +1,5 @@
+// +build !windows
+
 // Copyright 2015 flannel authors
 //
 // Licensed under the Apache License, Version 2.0 (the "License");

+ 2 - 0
backend/hostgw/hostgw_windows.go

@@ -1,3 +1,5 @@
+// +build windows
+
 // Copyright 2015 flannel authors
 //
 // Licensed under the Apache License, Version 2.0 (the "License");

+ 2 - 0
backend/ipip/ipip.go

@@ -1,3 +1,5 @@
+// +build !windows
+
 // Copyright 2017 flannel authors
 //
 // Licensed under the Apache License, Version 2.0 (the "License");

+ 2 - 0
backend/route_network.go

@@ -1,3 +1,5 @@
+// +build !windows
+
 // Copyright 2017 flannel authors
 //
 // Licensed under the Apache License, Version 2.0 (the "License");

+ 2 - 0
backend/udp/udp_network_amd64.go

@@ -1,3 +1,5 @@
+// +build !windows
+
 // Copyright 2015 flannel authors
 //
 // Licensed under the Apache License, Version 2.0 (the "License");

+ 2 - 0
backend/vxlan/device.go

@@ -1,3 +1,5 @@
+// +build !windows
+
 // Copyright 2015 flannel authors
 //
 // Licensed under the Apache License, Version 2.0 (the "License");

+ 2 - 0
pkg/ip/iface.go

@@ -1,3 +1,5 @@
+// +build !windows
+
 // Copyright 2015 flannel authors
 //
 // Licensed under the Apache License, Version 2.0 (the "License");

+ 2 - 0
pkg/ip/iface_test.go

@@ -1,3 +1,5 @@
+// +build !windows
+
 // Copyright 2017 flannel authors
 //
 // Licensed under the Apache License, Version 2.0 (the "License");

+ 2 - 0
pkg/ns/ns.go

@@ -1,3 +1,5 @@
+// +build !windows
+
 // Copyright 2017 flannel authors
 //
 // Licensed under the Apache License, Version 2.0 (the "License");