[SEBA-692] xos protobuf Makefile has hardcoded paths

Change-Id: I22c87141b513ec4e75d6f33953f832e585d25faf
diff --git a/VERSION b/VERSION
index 4d54dad..c4e41f9 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-4.0.2
+4.0.3
diff --git a/xos/coreapi/protos/Makefile b/xos/coreapi/protos/Makefile
index a30f841..ede161d 100644
--- a/xos/coreapi/protos/Makefile
+++ b/xos/coreapi/protos/Makefile
@@ -15,6 +15,9 @@
 
 # Makefile to build all protobuf and gRPC related artifacts
 
+THIS_MAKEFILE = $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))
+MAKEFILE_PATH := $(dir $(realpath $(THIS_MAKEFILE)))
+
 default: build
 
 PROTO_FILES := $(wildcard *.proto)
@@ -41,8 +44,7 @@
 	rm -f $(PROTO_PB2_FILES) $(PROTO_DESC_FILES)
 
 # xproto related targets
-
-XOS_DIR=/opt/xos
+XOS_DIR=$(shell dirname $(shell dirname $(MAKEFILE_PATH)))
 XOSGEN_PATH := $(XOS_DIR)/lib/xos-genx/xosgenx
 
 # Note: If you want to generate a new file, you need to do two things: Add a