Makefile: add docs target [1/1]

PD#SWPL-66582

Problem:
add docs target

Solution:
add docs target

Verify:
ad409_a113l

Signed-off-by: Kelvin Zhang <kelvin.zhang@amlogic.com>
Change-Id: Ic97487fe1a01b2c1856f0c6327d2f9c65c261ec2
diff --git a/Makefile b/Makefile
index bf0daf9..7ccf3c4 100755
--- a/Makefile
+++ b/Makefile
@@ -226,8 +226,10 @@
 
 .PHONY: docs
 docs:
-	@ cmake $($(1)_DIR)
-	@ cmake --build ./
+	@ if [ ! -d $($@_BUILD_DIR) ]; then mkdir -p $($@_BUILD_DIR); fi
+	(cd $($@_BUILD_DIR); \
+	cmake $($@_DIR); \
+	make)
 
 ################################################################
 # Respective Targets