endif
endif
+# for backward compatibility
+DESTDIR := $(INSTALL_DIR)
# Configurable variables for installation (default /usr/local/...)
-ifeq ($(origin INSTALL_DIR), undefined)
- INSTALL_DIR := /usr/local/bin
+ifeq ($(origin DESTDIR), undefined)
+ DESTDIR := /usr/local/bin
endif
HOST_GOOS=$(shell go env GOOS)
.PHONY: install
install: all
- mkdir -p $(INSTALL_DIR) && cp $(LOCAL_BINDIR)/* $(INSTALL_DIR)
+ mkdir -p $(DESTDIR) && cp $(LOCAL_BINDIR)/* $(DESTDIR)
vendor: tools/glide glide.yaml
./tools/glide install --strip-vendor
make all
```
-And to install xds-agent in /usr/local/bin:
+And to install xds-agent (by default in `/usr/local/bin`):
```bash
make install
```
-> **NOTE**: To cross build for example for Windows, just execute:
+>**NOTE:** Used `DESTDIR` to specify another install directory
+>```bash
+>make install DESTDIR=$HOME/opt/xds-agent
+>```
+
+
+#### Cross build
+For example on a Linux machine to cross-build for Windows, just execute:
```bash
export GOOS=windows
export GOARCH=amd64