Use DIST_DIR as the OUT_DIR when set

The CI system (pKVM/Busytown) provides a DIST_DIR for each build
to store its compilation artifacts. Use that as the OUT_DIR when
set.

https://critique-ng.corp.google.com/cl/326740710

Bug: 157107453

Signed-off-by: Fuad Tabba <tabba@google.com>
Change-Id: I7f1ca1a324f9368cd9fa89fde45870e8c86a6b25
diff --git a/Makefile b/Makefile
index 8c71dd1..9b6507a 100644
--- a/Makefile
+++ b/Makefile
@@ -18,7 +18,14 @@
 ## Folders
 ##
 ROOT_DIR := $(CURDIR)
+
+# DIST_DIR might be defined by the CI build (pKVM Busytown)
+ifdef DIST_DIR
+OUT_DIR := $(DIST_DIR)
+else
 OUT_DIR := $(ROOT_DIR)/out
+endif
+
 LINUX_OUT := $(OUT_DIR)/linux
 CCACHE_DIR := $(OUT_DIR)/.ccache
 SCRIPTS_DIR := $(ROOT_DIR)/build