diff --git a/src/doc/Makefile b/src/doc/Makefile
index b7a593260447d3a62fcd6a6090e76e7781720335..cb97bc992169a2b9f38d802b0587b3a630cdef1b 100644
--- a/src/doc/Makefile
+++ b/src/doc/Makefile
@@ -28,6 +28,7 @@
 SPHINXOPTS    ?=
 SPHINXBUILD   ?= sphinx-build
 SPHINXAPIDOC   ?= sphinx-apidoc
+PY_BASEDIR    = ../caosdb
 SOURCEDIR     = .
 BUILDDIR      = ../../build/doc
 
@@ -43,4 +44,4 @@ doc-help:
 	@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
 
 apidoc:
-	@$(SPHINXAPIDOC) -o _apidoc ../caosdb
+	@$(SPHINXAPIDOC) -o _apidoc $(PY_BASEDIR)