RIC:1060: Change in PTL
[ric-plt/lib/rmr.git] / doc / src / rtd / Makefile
index 7e49946..6ef1743 100644 (file)
 # This is a stand-alone make file as the RTD documentation is NOT built and packaged
 # with the normal CMake process and thus isn't covered in the CMake files.
 
-# {X}fm is required to compile the source. 
+# {X}fm is required to compile the source.
 
 
 %.rst:: %.xfm
-       OUTPUT_TYPE=rst tfm $< | sed 's/^ //' >$@
+       OUTPUT_TYPE=rst tfm $< | sed 's/^ //;  s/ *$$//' >$@
 
 %.ps:: %.xfm
        OUTPUT_TYPE=ps pfm $< $@
 %.md:: %.xfm
        OUTPUT_TYPE=markdown tfm $<  | sed 's/^ //' >$@
 
-docs = config-deploy developer-guide user-guide rel-notes overview
+%.html:: %.xfm
+       OUTPUT_TYPE=html hfm $< $@
 
-all:: $(docs:%=%.rst) $(docs:%=%.txt) $(docs:%=%.md) 
-       echo ">>> rm rel-notes.xfm"
+docs = config-deploy developer-guide rel-notes
 
-rel-notes.xfm:
+all:: $(docs:%=%.rst) $(docs:%=%.txt) $(docs:%=%.md)
+
+rel-notes.xfm:: always
        ksh fmt_changes.ksh >rel-notes.xfm
 
+
+# we force the docs to always be out of date so that we don't have to
+# manage the list of man pages and other files that are read to generate the
+# output needed for RTD.
+#
+$(docs:%=%.rst): always
+$(docs:%=%.txt): always
+$(docs:%=%.md): always
+$(docs:%=%.html): always
+
+
 # copy the .rst files which have changed into the docs (plural) directory at the root of the repo
 publish : $(docs:%=%.rst)
+       bash publish_man.sh;\
+       bash publish_lib.sh;\
+       bash scrape_types.sh;\
        for f in *.rst;\
        do\
                if ! diff -N -q $$f ../../../docs/$$f >/dev/null 2>&1;\
                then\
-                       cp -p $$f ../../../docs/;\
+                       sed 's/ *$$//' $$f >../../../docs/$${f##*/};\
                fi;\
        done
 
+# just list what would be published
+verify : $(docs:%=%.rst)
+       for f in *.rst;\
+       do\
+               if ! diff -N -q $$f ../../../docs/$$f >/dev/null 2>&1;\
+               then\
+                       echo "$$f would be published";\
+               fi;\
+       done
+
+test:
+       bash publish_lib.sh;
+
 # ditch any intermediate files
 clean:
        rm -f rel-notes.xfm *.sp *.ca
 
 # ditch anything that can be rebuilt
 nuke: clean
-       rm -f *.ps *.pdf *.rst *.md
+       rm -f *.ps *.pdf *.rst *.md *.txt
 
+# make hack to force a rule to always be out of date
+always: