doc: clean up the latex directory if empty
authorFerry Huberts <ferry.huberts@pelagic.nl>
Tue, 11 Dec 2012 14:05:17 +0000 (15:05 +0100)
committerFerry Huberts <ferry.huberts@pelagic.nl>
Tue, 11 Dec 2012 14:06:55 +0000 (15:06 +0100)
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
doc/Makefile

index 1ad40ed..c6dec19 100644 (file)
@@ -72,10 +72,11 @@ doc: $(DOX_FILE)
          "$(DOX_FILE)" > "$(TMP_DOX_FILE)"
        @echo "  Running doxygen to create HTML..."
        @doxygen "$(TMP_DOX_FILE)"
-       @rm "$(TMP_DOX_FILE)"
+       @rm -f "$(TMP_DOX_FILE)"
        @echo "  Running latex to create a PDF..."
        @$(MAKE) -s -C $(LATEX_OUTPUT) all > /dev/null 2>&1
        @mkdir -p "$(PDF_DIR)"
        @mv "$(LATEX_OUTPUT)/refman.pdf" "$(PDF_OUTPUT)"
        @rm -fr "$(LATEX_OUTPUT)"
+       @rmdir --ignore-fail-on-non-empty "$(LATEX_DIR)"
        @echo "  Done"