######################################################################### # Makefile.common # # This file, to be included from every document's local Makefile, provides # the basic targets used by the Fedora Docs Project: # all -- Default target, builds HTML document only # ${DOCNAME}/index.html -- Builds HTML version of document # html -- See "${DOCNAME}/index.html" # html-nochunks -- See "${DOCNAME}.html"; single HTML file # ${DOCNAME}.tar.gz -- Packages HTML document into a tar archive # tarball -- See "${DOCNAME}.tar.gz" # clean -- Deletes all generated files and directories # distclean -- See "clean" # ${DOCNAME}.pdf -- Builds PDF version of document # pdf -- See "${DOCNAME}.pdf" ######################################################################### # PDF generation is still fragile and probably won't work on your document ######################################################################### # Note: all targets within this Makefile.common must be defined as # double-colon (::) targets so that additional steps can be added by # providing additional rules, also marked with double-colons, in the # document Makefile. ######################################################################### # PUT NO TARGETS BEFORE THIS ONE, not even in your base Makefile # In a properly-constructed Makefile, this will be the default target .PHONY: all tarball pdf html html-nochunks clean distclean all:: ${DOCNAME}/index.html # The "tarball" or "${DOCNAME}.tar.gz" target will bind the HTML formatted # document into a compressed tar archive. tarball ${DOCNAME}.tar.gz:: ${DOCNAME}/index.html tar -zc --exclude '*.eps' -f ${DOCNAME}.tar.gz ${DOCNAME} # The "pdf" or "${DOCNAME}.pdf" target produces an Adobe Portable Document # Format (PDF) file as output. pdf ${DOCNAME}.pdf:: ${XMLFILE} ${XMLEXTRAFILES} xmlto pdf -x $(XSLPDF) $(XMLFILE) # The "html" or "${DOCNAME}. html ${DOCNAME}/index.html:: ${XMLFILE} ${XMLEXTRAFILES} xmlto html -x $(XSLHTML) -o $(DOCNAME) $(XMLFILE) mkdir -p $(DOCNAME)/stylesheet-images cp ../docs-common/stylesheet-images/*.png $(DOCNAME)/stylesheet-images cp ../docs-common/css/fedora.css $(DOCNAME) html-nochunks $(DOCNAME).html:: ${XMLFILE} ${XMLEXTRAFILES} xmlto html-nochunks -x $(XSLHTMLNOCHUNKS) $(XMLFILE) mkdir -p stylesheet-images cp ../docs-common/stylesheet-images/*.png stylesheet-images cp ../docs-common/css/fedora.css . # The "view" target ensures that the HTML version of the document is built # then displays it using the "htmlview" tool to start up the browser. It # assumes that the current working directory is immediately above the HTML # document directory. (We could change this if we wanted to futz around # with making up an absolute pathname, but why bother.) view:: ${DOCNAME}/index.html /usr/bin/htmlview file://localhost/${PWD}/${DOCNAME}/index.html # The "clean" or "distclean" target will remove all generated and temporary # files. distclean clean: ${RM} -r ${DOCNAME}.pdf $(DOCNAME) \ ${DOCNAME}.tar.gz \ ${DOCNAME}.html stylesheet-images fedora.css