This repository has been archived by the owner on Oct 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
go 1.13 by default enables go modules feature, where we use 'dep' tool for module/package dependency. Till we move to go modules disable(GO111MODULE=off) this.
- Loading branch information
Showing
2 changed files
with
13 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,7 @@ | |
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
GO=GOOS=linux GO111MODULE=off go | ||
IMPORT_PATH=github.com/intel/pmem-csi | ||
CMDS=pmem-csi-driver pmem-vgm pmem-ns-init | ||
TEST_CMDS=$(addsuffix -test,$(CMDS)) | ||
|
@@ -58,21 +59,21 @@ all: build | |
# Build all binaries, including tests. | ||
# Must use the workaround from https://github.com/golang/go/issues/15513 | ||
build: $(CMDS) $(TEST_CMDS) | ||
go test -run none ./pkg/... ./test/e2e | ||
$(GO) test -run none ./pkg/... ./test/e2e | ||
|
||
# "make test" runs a variety of fast tests, including building all source code. | ||
# More tests are added elsewhere in this Makefile and test/test.make. | ||
test: build | ||
|
||
# Build production binaries. | ||
$(CMDS): | ||
GOOS=linux go build -ldflags '-X github.com/intel/pmem-csi/pkg/[email protected]=${VERSION}' -a -o ${OUTPUT_DIR}/$@ ./cmd/$@ | ||
$(GO) build -ldflags '-X github.com/intel/pmem-csi/pkg/[email protected]=${VERSION}' -a -o ${OUTPUT_DIR}/$@ ./cmd/$@ | ||
|
||
# Build a test binary that can be used instead of the normal one with | ||
# additional "-run" parameters. In contrast to the normal it then also | ||
# supports -test.coverprofile. | ||
$(TEST_CMDS): %-test: | ||
GOOS=linux go test --cover -covermode=atomic -c -coverpkg=./pkg/... -ldflags '-X github.com/intel/pmem-csi/pkg/$*.version=${VERSION}' -o ${OUTPUT_DIR}/$@ ./cmd/$* | ||
$(GO) test --cover -covermode=atomic -c -coverpkg=./pkg/... -ldflags '-X github.com/intel/pmem-csi/pkg/$*.version=${VERSION}' -o ${OUTPUT_DIR}/$@ ./cmd/$* | ||
|
||
# The default is to refresh the base image once a day when building repeatedly. | ||
# This is achieved by passing a fake variable that changes its value once per day. | ||
|
@@ -111,7 +112,7 @@ print-image-version: | |
@ echo "$(IMAGE_VERSION)" | ||
|
||
clean: | ||
go clean -r -x | ||
$(GO) clean -r -x | ||
-rm -rf $(OUTPUT_DIR) | ||
|
||
.PHONY: all build test clean $(CMDS) $(TEST_CMDS) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters