diff --git a/docs/Makefile b/docs/Makefile
index f6caa826030da721a568ac5efef0eed87b18cabe..cdaf09c1e04ffdb09afb9d38d6f477c1ab1e3377 100644
--- a/docs/Makefile
+++ b/docs/Makefile
@@ -17,6 +17,7 @@ compile:
 	$(NO_TRACE_MAKE) cleanup
 
 $(TMP_DIR)/.prereq-docs:
+	mkdir -p $(TMP_DIR)
 	$(NO_TRACE_MAKE) prereq
 	touch $@
 
@@ -25,7 +26,7 @@ openwrt.html: $(DEPS)
 
 openwrt.pdf: $(DEPS)
 	pdflatex $(MAIN)
-	
+
 clean: cleanup
 	rm -f openwrt.pdf openwrt.html openwrt.css