Markus Mottl avatar Markus Mottl committed fccf7c2

Further improvements to generation of documentation.

Comments (0)

Files changed (3)

+2007-01-08: Further improvements to generation of documentation.
+
+            Thanks to Prashanth Mundkur <prashanth.mundkur@gmail.com>
+            for the patch!
+
 2007-01-08: Fixed a linking bug with libraries: OCAML{B,N}LDFLAGS were
             doubled during the linking stage of library creation, which
             may cause problems in certain cases.
   DOC_FILES := $(filter %.mli, $(SOURCES))
 endif
 export DOC_FILES
+FIRST_DOC_FILE := $(firstword $(DOC_FILES))
 
 export BCSUFFIX
 export NCSUFFIX
 htdoc:	$(DOC_DIR)/$(RESULT)/html/index.html
 
 # generates Latex-documentation
-ladoc:	$(DOC_DIR)/$(RESULT)/latex
+ladoc:	$(DOC_DIR)/$(RESULT)/latex/doc.tex
 
 # generates PostScript-documentation
 psdoc:	$(DOC_DIR)/$(RESULT)/latex/doc.ps
 
 $(DOC_DIR)/$(RESULT)/html/index.html: $(DOC_DIR)/$(RESULT)/html $(DOC_FILES)
 	rm -rf $</*
-	$(QUIET)pp=`sed -n -e '/^#/d' -e 's/(\*pp \([^*]*\) \*)/\1/p;q' $<`; \
+	$(QUIET)pp=`sed -n -e '/^#/d' -e 's/(\*pp \([^*]*\) \*)/\1/p;q' $(FIRST_DOC_FILE)`; \
 	if [ -z "$$pp" ]; then \
 	  echo $(REAL_OCAMLFIND) $(OCAMLDOC) $(OCAML_FIND_PACKAGES) -html -d $< $(OCAMLDOCFLAGS) $(INCFLAGS) $(DOC_FILES); \
 	  $(REAL_OCAMLFIND) $(OCAMLDOC) $(OCAML_FIND_PACKAGES) -html -d $< $(OCAMLDOCFLAGS) $(INCFLAGS) $(DOC_FILES); \
 	  	$(INCFLAGS) $(DOC_FILES); \
 	fi
 
-$(DOC_DIR)/$(RESULT)/latex: $(DOC_FILES)
-	rm -rf $@
+$(DOC_DIR)/$(RESULT)/latex:
 	mkdir -p $@
-	$(QUIET)pp=`sed -n -e '/^#/d' -e 's/(\*pp \([^*]*\) \*)/\1/p;q' $<`; \
+
+$(DOC_DIR)/$(RESULT)/latex/doc.tex: $(DOC_DIR)/$(RESULT)/latex $(DOC_FILES)
+	rm -rf $</*
+	$(QUIET)pp=`sed -n -e '/^#/d' -e 's/(\*pp \([^*]*\) \*)/\1/p;q' $(FIRST_DOC_FILE)`; \
 	if [ -z "$$pp" ]; then \
 	  echo $(REAL_OCAMLFIND) $(OCAMLDOC) $(OCAML_FIND_PACKAGES) -latex $(OCAMLDOCFLAGS) $(INCFLAGS) \
-	  	$(DOC_FILES) -o $@/doc.tex; \
+	  	$(DOC_FILES) -o $@; \
 	  $(REAL_OCAMLFIND) $(OCAMLDOC) $(OCAML_FIND_PACKAGES) -latex $(OCAMLDOCFLAGS) $(INCFLAGS) $(DOC_FILES) \
-	  	-o $@/doc.tex; \
+	  	-o $@; \
 	else \
 	  echo $(REAL_OCAMLFIND) $(OCAMLDOC) $(OCAML_FIND_PACKAGES) -pp \"$$pp $(PPFLAGS)\" -latex $(OCAMLDOCFLAGS) \
-	  	$(INCFLAGS) $(DOC_FILES) -o $@/doc.tex; \
+	  	$(INCFLAGS) $(DOC_FILES) -o $@; \
 	  $(REAL_OCAMLFIND) $(OCAMLDOC) $(OCAML_FIND_PACKAGES) -pp "$$pp $(PPFLAGS)" -latex $(OCAMLDOCFLAGS) \
-	  	$(INCFLAGS) $(DOC_FILES) -o $@/doc.tex; \
+	  	$(INCFLAGS) $(DOC_FILES) -o $@; \
 	fi
 
-$(DOC_DIR)/$(RESULT)/latex/doc.ps: $(DOC_DIR)/$(RESULT)/latex
+$(DOC_DIR)/$(RESULT)/latex/doc.ps: $(DOC_DIR)/$(RESULT)/latex/doc.tex
 	cd $(DOC_DIR)/$(RESULT)/latex && \
 	  $(LATEX) doc.tex && \
 	  $(LATEX) doc.tex && \
-release-6-24-4
+release-6-24-5
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.