File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -90,6 +90,25 @@ You can move them in your global path, `/usr/local/bin` with:
9090sudo make install
9191```
9292
93+ The install prefix can be changed by passing the ` PREFIX ` variable (defaults
94+ to ` /usr/local ` ).
95+
96+ Note: if you set one of these vars, set them to the same values on all make stages
97+ (build as well as install).
98+
99+ If you want to prepend an additional prefix on actual installation (eg. packaging or chroot install),
100+ you can pass it via ` DESTDIR ` variable:
101+
102+ ``` sudo
103+ sudo make install DESTDIR=/tmp/install-x973234/
104+ ```
105+
106+ The above command installs the ` containerd ` binary to ` /tmp/install-x973234/usr/local/bin/containerd `
107+
108+ The current ` DESTDIR ` convention is supported since containerd v1.6.
109+ Older releases was using ` DESTDIR ` for a different purpose that is similar to ` PREFIX ` .
110+
111+
93112When making any changes to the gRPC API, you can use the installed ` protoc `
94113compiler to regenerate the API generated code packages with:
95114
Original file line number Diff line number Diff line change @@ -21,7 +21,10 @@ INSTALL ?= install
2121ROOTDIR =$(dir $(abspath $(lastword $(MAKEFILE_LIST ) ) ) )
2222
2323# Base path used to install.
24- DESTDIR ?= /usr/local
24+ # The files will be installed under `$(DESTDIR)/$(PREFIX)`.
25+ # The convention of `DESTDIR` was changed in containerd v1.6.
26+ PREFIX ?= /usr/local
27+
2528TEST_IMAGE_LIST ?=
2629
2730# Used to populate variables in version package.
@@ -250,8 +253,8 @@ man/%: docs/man/%.md FORCE
250253 go-md2man -in " $<" -out " $@ "
251254
252255define installmanpage
253- $(INSTALL ) -d $(DESTDIR ) /man/man$(2 ) ;
254- gzip -c $(1 ) >$(DESTDIR ) /man/man$(2 ) /$(3 ) .gz;
256+ $(INSTALL ) -d $(DESTDIR ) /$( PREFIX ) / man/man$(2 ) ;
257+ gzip -c $(1 ) >$(DESTDIR ) /$( PREFIX ) / man/man$(2 ) /$(3 ) .gz;
255258endef
256259
257260install-man : man
@@ -346,12 +349,12 @@ clean-test: ## clean up debris from previously failed tests
346349
347350install : # # install binaries
348351 @echo " $( WHALE) $@ $( BINARIES) "
349- @$(INSTALL ) -d $(DESTDIR ) /bin
350- @$(INSTALL ) $(BINARIES ) $(DESTDIR ) /bin
352+ @$(INSTALL ) -d $(DESTDIR ) /$( PREFIX ) / bin
353+ @$(INSTALL ) $(BINARIES ) $(DESTDIR ) /$( PREFIX ) / bin
351354
352355uninstall :
353356 @echo " $( WHALE) $@ "
354- @rm -f $(addprefix $(DESTDIR ) /bin/,$(notdir $(BINARIES ) ) )
357+ @rm -f $(addprefix $(DESTDIR ) /$( PREFIX ) / bin/,$(notdir $(BINARIES ) ) )
355358
356359ifeq ($(GOOS ) ,windows)
357360install-deps :
You can’t perform that action at this time.
0 commit comments