Add check_env
diff --git a/cargo/Makefile b/cargo/Makefile
index 9e9b17e..ed461d6 100644
--- a/cargo/Makefile
+++ b/cargo/Makefile
@@ -27,3 +27,10 @@
 clean_top:
 	cd $(TOP_TEST_PATH); make clean; cd -;
 	
+check-env:
+ifndef PDK_ROOT
+	$(error PDK_ROOT is undefined, please export it before running make)
+endif
+ifndef RISCV32
+	$(error RISCV32 is undefined, please export it before running make)
+endif