Permalink
Browse files

make and travis: cross platform compile check

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
  • Loading branch information...
vbatts committed Jun 6, 2018
1 parent ca5b302 commit d615269b5adc0135d9862f902f8a5854fab3b603
Showing with 19 additions and 5 deletions.
  1. +1 −1 .travis.yml
  2. +18 −4 Makefile
@@ -24,4 +24,4 @@ script: >
-e GOPATH=/gopath -e TRASH_CACHE=/gopath/.trashcache
-v /etc/passwd:/etc/passwd -v /etc/sudoers:/etc/sudoers -v /etc/sudoers.d:/etc/sudoers.d
-v /var/run:/var/run:z -v $HOME/gopath:/gopath:Z
-w /gopath/src/github.com/containers/image image-test bash -c "PATH=$PATH:/gopath/bin make tools .gitvalidation validate test test-skopeo SUDO=sudo BUILDTAGS=\"$BUILDTAGS\""
-w /gopath/src/github.com/containers/image image-test bash -c "PATH=$PATH:/gopath/bin make cross tools .gitvalidation validate test test-skopeo SUDO=sudo BUILDTAGS=\"$BUILDTAGS\""
@@ -6,10 +6,18 @@ SKOPEO_BRANCH = master
# Set SUDO=sudo to run container integration tests using sudo.
SUDO =
# when cross compiling _for_ a Darwin or windows host, then we must use openpgp
BUILD_TAGS_WINDOWS_CROSS = containers_image_ostree_stub containers_image_openpgp
BUILD_TAGS_DARWIN_CROSS = containers_image_ostree_stub containers_image_openpgp
# when compiling _on_ a Darwin host, then we can link against gpgme
BUILD_TAGS_DARWIN_NATIVE = containers_image_ostree_stub
ifeq ($(shell uname),Darwin)
DARWIN_BUILD_TAG = containers_image_ostree_stub
PLATFORM_BUILD_TAG = $(BUILD_TAGS_DARWIN_NATIVE)
endif
BUILDTAGS = btrfs_noversion libdm_no_deferred_remove $(DARWIN_BUILD_TAG)
BUILDTAGS = btrfs_noversion libdm_no_deferred_remove $(PLATFORM_BUILD_TAG)
BUILDFLAGS := -tags "$(BUILDTAGS)"
PACKAGES := $(shell go list $(BUILDFLAGS) ./... | grep -v github.com/containers/image/vendor)
@@ -25,8 +33,14 @@ GPGME_ENV = CGO_CFLAGS="$(shell gpgme-config --cflags 2>/dev/null)" CGO_LDFLAGS=
all: tools test validate .gitvalidation
build: vendor
@$(GPGME_ENV) go build $(BUILDFLAGS) $(PACKAGES)
build: vendor build-internal
build-internal:
$(GPGME_ENV) go build $(BUILDFLAGS) $(PACKAGES)
cross: vendor
GOOS=windows $(MAKE) build-internal BUILDTAGS="$(BUILDTAGS) $(BUILD_TAGS_WINDOWS_CROSS)"
GOOS=darwin $(MAKE) build-internal BUILDTAGS="$(BUILDTAGS) $(BUILD_TAGS_DARWIN_CROSS)"
tools: tools.timestamp

0 comments on commit d615269

Please sign in to comment.