build: Attempt to enable windows compilation

master
Harshavardhana 9 years ago
parent 152c73e1ce
commit c67a8cb6e5
  1. 9
      Makefile
  2. 7
      appveyor.yml

@ -1,5 +1,6 @@
LDFLAGS := $(shell go run buildscripts/gen-ldflags.go) LDFLAGS := $(shell go run buildscripts/gen-ldflags.go)
DOCKER_LDFLAGS := $(LDFLAGS) -extldflags "-static" DOCKER_LDFLAGS := '$(LDFLAGS) -extldflags "-static"'
BUILD_LDFLAGS := '$(LDFLAGS)'
TAG := latest TAG := latest
all: install all: install
@ -11,7 +12,7 @@ checkdeps:
checkgopath: checkgopath:
@echo "Checking if project is at ${GOPATH}" @echo "Checking if project is at ${GOPATH}"
@for miniopath in $(echo ${GOPATH} | sed 's/:/\n/g'); do if [ ! -d ${miniopath}/src/github.com/minio/minio ]; then echo "Project not found in ${miniopath}, please follow instructions provided at https://github.com/minio/minio/blob/master/CONTRIBUTING.md#setup-your-minio-github-repository" && exit 1; fi done @for miniopath in $(echo ${GOPATH} | sed 's/:/\n/g'); do if [ ! -d ${miniopath}/src/github.com/minio/minio ]; then echo "Project not found in ${miniopath}, please follow instructions provided at https://github.com/minio/minio/blob/master/CONTRIBUTING.md#setup-your-minio-github-repository" && exit 1; fi done
@echo "Setting LDFLAGS: ${LDFLAGS}" @echo "Setting BUILD_LDFLAGS: ${BUILD_LDFLAGS}"
getdeps: checkdeps checkgopath getdeps: checkdeps checkgopath
@go get -u github.com/golang/lint/golint && echo "Installed golint:" @go get -u github.com/golang/lint/golint && echo "Installed golint:"
@ -55,7 +56,7 @@ test: build
@GO15VENDOREXPERIMENT=1 go test $(GOFLAGS) github.com/minio/minio/pkg... @GO15VENDOREXPERIMENT=1 go test $(GOFLAGS) github.com/minio/minio/pkg...
gomake-all: build gomake-all: build
@GO15VENDOREXPERIMENT=1 go build --ldflags '$(LDFLAGS)' -o $(GOPATH)/bin/minio @GO15VENDOREXPERIMENT=1 go build --ldflags $(BUILD_LDFLAGS) -o $(GOPATH)/bin/minio
pkg-add: pkg-add:
@GO15VENDOREXPERIMENT=1 govendor add $(PKG) @GO15VENDOREXPERIMENT=1 govendor add $(PKG)
@ -70,7 +71,7 @@ install: gomake-all
dockerimage: install dockerimage: install
@echo "Building docker image:" minio:$(TAG) @echo "Building docker image:" minio:$(TAG)
@GO15VENDOREXPERIMENT=1 go build --ldflags '$(DOCKER_LDFLAGS)' -o minio.dockerimage @GO15VENDOREXPERIMENT=1 go build --ldflags $(DOCKER_LDFLAGS) -o minio.dockerimage
@mkdir -p export @mkdir -p export
@docker build --rm --tag=minio:$(TAG) . @docker build --rm --tag=minio:$(TAG) .
@rmdir export @rmdir export

@ -26,10 +26,9 @@ build_script:
- go test -race . - go test -race .
- go test github.com/minio/minio/pkg... - go test github.com/minio/minio/pkg...
- go test -race github.com/minio/minio/pkg... - go test -race github.com/minio/minio/pkg...
# FIXME: appveyor build has errors related to LDFLAGS - go run buildscripts/gen-ldflags.go > temp.txt
# - go run buildscripts/gen-ldflags.go > temp.txt - set /p BUILD_LDFLAGS=<temp.txt
# - set /p LDFLAGS=<temp.txt - go build -ldflags="%BUILD_LDFLAGS%" -o %GOPATH%\bin\minio.exe
# - go build --ldflags %LDFLAGS% -o %GOPATH%\bin\minio.exe
# to disable automatic tests # to disable automatic tests
test: off test: off

Loading…
Cancel
Save