Files
linuxkit/Makefile
Ian Campbell acd29e6106 Bump rtf to f2409214ca3b719567aa15bb7b363f24876a4d98
Pulls in a bumper crop of updates from last year and some recent improvements:

    $ git log --oneline 3e8ed35ca934..f2409214ca3b | cat
    f240921 Merge pull request #38 from ijc/timestamp-precision
    f626ffe Preserve full precision in nanoseconds part of log timestamp
    29c89e8 Merge pull request #37 from rn/ps1
    600ea59 Update documentation with new powershell features
    9fed685 Add powershell test and group templates and a stub library
    3ada6bd Don't use '#!/bin/sh' in tests or group initialisers
    dd187b4 Add test cases for powershell scripts
    4892754 Add support for writing tests in powershell (on Windows)
    00cdd1f Add the ability to execute powershell scripts
    00906da Add TestFilePath to the Test struct
    e6fdcb7 Add GroupFilePath to the Group struct
    c590dbc Make group member names for Pre/Post test scripts clearer
    5ca3d4f Add setEnv test
    d178af2 Improve environment variable setting in executeScript
    9c7cc94 Merge pull request #35 from rn/circle
    d464092 Use container builds on CircleCI and stash artefacts
    9a09cd5 Move CircleCI config file to .circleci
    9429279 Merge pull request #33 from rn/poule
    4de1f2c Add poule config
    88dcc27 Merge pull request #32 from mor1/extra-extra
    bfabb8a flags: update README for `-x` now as a local flag
    3f574c7 flags: make `-x` work
    ba442d6 Merge pull request #31 from dave-tucker/fix-panic
    6c7f09b local: Fix panic when no pattern is supplied
    617e977 Merge pull request #30 from dnephin/add-latest-link
    5829b2b Merge pull request #29 from dnephin/fix-command-descriptions
    d09a317 Add a link to the latest directory within results.
    c9a9a2a Remove some duplication between commands.
    7904cc7 Remove unused flags, and move run flags to run command.
    94e56a7 Update command descriptions
    faedeef Merge pull request #28 from dave-tucker/prepost
    a5f92ae local: Fix panic in PostTest
    23fbbea Merge pull request #26 from dave-tucker/fix-osx-vers
    156281e sysinfo: Fix OSX version parsing

Signed-off-by: Ian Campbell <ijc@docker.com>
2018-02-14 13:45:02 +00:00

123 lines
4.1 KiB
Makefile

.DELETE_ON_ERROR:
.PHONY: default all
default: bin/linuxkit bin/rtf
all: default
VERSION="v0.2+"
GIT_COMMIT=$(shell git rev-list -1 HEAD)
GO_COMPILE=linuxkit/go-compile:8235f703735672509a16fb626d25c6ffb0d1c21d
LINUXKIT?=bin/linuxkit
GOOS?=$(shell uname -s | tr '[:upper:]' '[:lower:]')
GOARCH?=amd64
ifneq ($(GOOS),linux)
CROSS+=-e GOOS=$(GOOS)
endif
ifneq ($(GOARCH),amd64)
CROSS+=-e GOARCH=$(GOARCH)
endif
PREFIX?=/usr/local/
RTF_COMMIT=f2409214ca3b719567aa15bb7b363f24876a4d98
RTF_CMD=github.com/linuxkit/rtf/cmd
RTF_VERSION=0.0
bin/rtf: tmp_rtf_bin.tar | bin
tar xf $<
rm $<
touch $@
tmp_rtf_bin.tar: Makefile
docker run --rm --log-driver=none -e http_proxy=$(http_proxy) -e https_proxy=$(https_proxy) $(CROSS) $(GO_COMPILE) --clone-path github.com/linuxkit/rtf --clone https://github.com/linuxkit/rtf.git --commit $(RTF_COMMIT) --package github.com/linuxkit/rtf --ldflags "-X $(RTF_CMD).GitCommit=$(RTF_COMMIT) -X $(RTF_CMD).Version=$(RTF_VERSION)" -o bin/rtf > $@
# Manifest tool for multi-arch images
MT_COMMIT=bfbd11963b8e0eb5f6e400afaebeaf39820b4e90
MT_REPO=https://github.com/estesp/manifest-tool
bin/manifest-tool: tmp_mt_bin.tar | bin
tar xf $<
rm $<
touch $@
tmp_mt_bin.tar: Makefile
docker run --rm --log-driver=none -e http_proxy=$(http_proxy) -e https_proxy=$(https_proxy) $(CROSS) $(GO_COMPILE) --clone-path github.com/estesp/manifest-tool --clone $(MT_REPO) --commit $(MT_COMMIT) --package github.com/estesp/manifest-tool --ldflags "-X main.gitCommit=$(MT_COMMIT)" -o bin/manifest-tool > $@
LINUXKIT_DEPS=$(wildcard src/cmd/linuxkit/*.go) $(wildcard src/cmd/linuxkit/*/*.go) Makefile src/cmd/linuxkit/vendor.conf
bin/linuxkit: tmp_linuxkit_bin.tar
tar xf $<
rm $<
touch $@
tmp_linuxkit_bin.tar: $(LINUXKIT_DEPS)
tar cf - -C src/cmd/linuxkit . | docker run --rm --net=none --log-driver=none -i $(CROSS) $(GO_COMPILE) --package github.com/linuxkit/linuxkit/src/cmd/linuxkit --ldflags "-X github.com/linuxkit/linuxkit/src/cmd/linuxkit/version.GitCommit=$(GIT_COMMIT) -X github.com/linuxkit/linuxkit/src/cmd/linuxkit/version.Version=$(VERSION)" -o bin/linuxkit > $@
.PHONY: test-cross
test-cross:
$(MAKE) clean
$(MAKE) -j 3 GOOS=darwin tmp_rtf_bin.tar tmp_mt_bin.tar tmp_linuxkit_bin.tar
$(MAKE) clean
$(MAKE) -j 3 GOOS=windows tmp_rtf_bin.tar tmp_mt_bin.tar tmp_linuxkit_bin.tar
$(MAKE) clean
$(MAKE) -j 3 GOOS=linux tmp_rtf_bin.tar tmp_mt_bin.tar tmp_linuxkit_bin.tar
$(MAKE) clean
ifeq ($(GOARCH)-$(GOOS),amd64-linux)
LOCAL_BUILDMODE?=pie
endif
LOCAL_BUILDMODE?=default
LOCAL_LDFLAGS += -s -w -extldflags \"-static\" -X github.com/linuxkit/linuxkit/src/cmd/linuxkit/version.GitCommit=$(GIT_COMMIT) -X github.com/linuxkit/linuxkit/src/cmd/linuxkit/version.Version=$(VERSION)
LOCAL_TARGET ?= bin/linuxkit
.PHONY: local-check local-build local-test local
local-check: $(LINUXKIT_DEPS)
@echo gofmt... && o=$$(gofmt -s -l $(filter %.go,$(LINUXKIT_DEPS))) && if [ -n "$$o" ] ; then echo $$o ; exit 1 ; fi
@echo govet... && go tool vet -printf=false $(filter %.go,$(LINUXKIT_DEPS))
@echo golint... && set -e ; for i in $(filter %.go,$(LINUXKIT_DEPS)); do golint $$i ; done
@echo ineffassign... && ineffassign $(filter %.go,$(LINUXKIT_DEPS))
local-build: $(LINUXKIT_DEPS) | bin
go build -o $(LOCAL_TARGET) --buildmode $(LOCAL_BUILDMODE) --ldflags "$(LOCAL_LDFLAGS)" github.com/linuxkit/linuxkit/src/cmd/linuxkit
local-test: $(LINUXKIT_DEPS)
go test $(shell go list github.com/linuxkit/linuxkit/src/cmd/linuxkit/... | grep -v ^github.com/linuxkit/linuxkit/src/cmd/linuxkit/vendor/)
local: local-check local-build local-test
bin:
mkdir -p $@
install:
cp -R ./bin/* $(PREFIX)/bin
.PHONY: test
test:
$(MAKE) -C test
.PHONY: collect-artifacts
collect-artifacts: artifacts/test.img.tar.gz artifacts/test-ltp.img.tar.gz
.PHONY: ci ci-tag ci-pr
ci: test-cross
$(MAKE)
$(MAKE) install
$(MAKE) -C test all
$(MAKE) -C pkg build
ci-tag: test-cross
$(MAKE)
$(MAKE) install
$(MAKE) -C test all
$(MAKE) -C pkg build
ci-pr: test-cross
$(MAKE)
$(MAKE) install
$(MAKE) -C test pr
$(MAKE) -C pkg build
.PHONY: clean
clean:
rm -rf bin *.log *-kernel *-cmdline *-state *.img *.iso *.gz *.qcow2 *.vhd *.vmx *.vmdk *.tar *.raw