[v2,12/12] trace-cruncher: Improve Makefile Provide more robust and better looking build process.
diff mbox series

Message ID 20200107170312.27116-13-y.karadz@gmail.com
State New, archived
Headers show
Series
  • Build trace-cruncher as Python pakage
Related show

Commit Message

Yordan Karadzhov (VMware) Jan. 7, 2020, 5:03 p.m. UTC
Signed-off-by: Yordan Karadzhov (VMware) <y.karadz@gmail.com>
---
 Makefile | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

Patch
diff mbox series

diff --git a/Makefile b/Makefile
index 9f49184..0acd655 100644
--- a/Makefile
+++ b/Makefile
@@ -4,8 +4,17 @@ 
 # Copyright 2019 VMware Inc, Yordan Karadzhov (VMware) <y.karadz@gmail.com>
 #
 
+UID := $(shell id -u)
+
+CYAN	:= '\e[36m'
+PURPLE	:= '\e[35m'
+NC	:= '\e[0m'
+
 all:
+	@ echo ${CYAN}Installing third party:${NC};
 	./install_third_party.sh
+	@ echo
+	@ echo ${CYAN}Buildinging trace-cruncher:${NC};
 	python3 setup.py build
 
 clean:
@@ -13,7 +22,15 @@  clean:
 	rm -f src/datawrapper.c
 
 install:
+	@ echo ${CYAN}Installing trace-cruncher:${NC};
 	python3 setup.py install --record install_manifest.txt
 
 uninstall:
-	xargs rm -v < install_manifest.txt
+	@ if [ $(UID) -ne 0 ]; then \
+	echo ${PURPLE}Permission denied${NC} 1>&2; \
+	else \
+	echo ${CYAN}Uninstalling trace-cruncher:${NC}; \
+	xargs rm -v < install_manifest.txt; \
+	rm -rfv dist tracecruncher.egg-info; \
+	rm -fv install_manifest.txt; \
+	fi