Skip to content
This repository was archived by the owner on Jan 15, 2026. It is now read-only.

Commit 2fa43fe

Browse files
committed
Add make install support
Add `install` support to make, for installing image tools binaries into $PATH. Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
1 parent f24d27b commit 2fa43fe

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ before_install:
1313
- go get -u github.com/alecthomas/gometalinter
1414
- gometalinter --install --update
1515
- go get -t -d ./...
16+
- mkdir -p /tmp/image-tools
1617

1718
install: true
1819

@@ -22,3 +23,4 @@ script:
2223
- make check-license
2324
- make test
2425
- make tools
26+
- make install DESTDIR=/tmp/image-tools

Makefile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ TOOLS := \
88
oci-create-runtime-bundle \
99
oci-image-validate \
1010
oci-unpack
11+
DESTDIR ?= /usr/bin/
1112

1213
default: help
1314

@@ -19,6 +20,7 @@ help:
1920
@echo " * 'lint' - Execute the source code linter"
2021
@echo " * 'test' - Execute the unit tests"
2122
@echo " * 'update-deps' - Update vendored dependencies"
23+
@echo " * 'install' - Install the binaries into system path"
2224

2325
check-license:
2426
@echo "checking license headers"
@@ -44,6 +46,9 @@ update-deps:
4446
# see http://sed.sourceforge.net/sed1line.txt
4547
find vendor -type f -exec sed -i -e :a -e '/^\n*$$/{$$d;N;ba' -e '}' "{}" \;
4648

49+
install:
50+
install -D -m 755 -t ${DESTDIR} ${TOOLS}
51+
4752
.PHONY: .gitvalidation
4853

4954
# When this is running in travis, it will only check the travis commit range
@@ -81,4 +86,5 @@ clean:
8186
check-license \
8287
clean \
8388
lint \
84-
test
89+
test \
90+
install

0 commit comments

Comments
 (0)