Commit cf2098d9 authored by Sam Ravnborg's avatar Sam Ravnborg

docbook: Makefile cleanup

o Removed special rules for JBD, covered by the general mechanishm
o Use $(obj)/ instead of Documentation/DocBook
o Introduced usage of Distributed clean
o No longer delete *~ files in top-level directory during clean
parent 57733624
...@@ -13,14 +13,6 @@ DOCBOOKS := wanbook.sgml z8530book.sgml mcabook.sgml videobook.sgml \ ...@@ -13,14 +13,6 @@ DOCBOOKS := wanbook.sgml z8530book.sgml mcabook.sgml videobook.sgml \
writing_usb_driver.sgml scsidrivers.sgml sis900.sgml \ writing_usb_driver.sgml scsidrivers.sgml sis900.sgml \
kernel-api.sgml journal-api.sgml lsm.sgml kernel-api.sgml journal-api.sgml lsm.sgml
JBDSOURCES := $(TOPDIR)/include/linux/jbd.h \
$(TOPDIR)/fs/jbd/journal.c \
$(TOPDIR)/fs/jbd/recovery.c \
$(TOPDIR)/fs/jbd/transaction.c
journal-api.sgml: journal-api.tmpl $(JBDSOURCES)
$(TOPDIR)/scripts/docgen $(JBDSOURCES) \
<journal-api.tmpl >journal-api.sgml
### ###
# The build process is as follows (targets): # The build process is as follows (targets):
# (sgmldocs) # (sgmldocs)
...@@ -32,7 +24,7 @@ journal-api.sgml: journal-api.tmpl $(JBDSOURCES) ...@@ -32,7 +24,7 @@ journal-api.sgml: journal-api.tmpl $(JBDSOURCES)
# The targets that may be used. # The targets that may be used.
.PHONY: sgmldocs psdocs pdfdocs htmldocs clean mrproper .PHONY: sgmldocs psdocs pdfdocs htmldocs clean mrproper
BOOKS := $(addprefix Documentation/DocBook/,$(DOCBOOKS)) BOOKS := $(addprefix $(obj)/,$(DOCBOOKS))
sgmldocs: $(BOOKS) sgmldocs: $(BOOKS)
PS := $(patsubst %.sgml, %.ps, $(BOOKS)) PS := $(patsubst %.sgml, %.ps, $(BOOKS))
...@@ -86,19 +78,19 @@ $(BOOKS): $(KERNELDOC) ...@@ -86,19 +78,19 @@ $(BOOKS): $(KERNELDOC)
### ###
# procfs guide uses a .c file as example code. # procfs guide uses a .c file as example code.
# This requires an explicit dependency # This requires an explicit dependency
C-procfs-example = Documentation/DocBook/procfs_example.sgml C-procfs-example = procfs_example.sgml
Documentation/DocBook/procfs-guide.sgml: $(C-procfs-example) C-procfs-example2 = $(addprefix $(obj)/,$(C-procfs-example))
$(obj)/procfs-guide.sgml: $(C-procfs-example2)
### ###
# The parportbook includes a few images. # The parportbook includes a few images.
# Force them to be build before the books # Force them to be build before the books
IMG-parportbook := parport-share.fig parport-multi.fig parport-structure.fig IMG-parportbook := parport-share.fig parport-multi.fig parport-structure.fig
IMG-parportbook2 := $(addprefix Documentation/DocBook/,$(IMG-parportbook)) IMG-parportbook2 := $(addprefix $(obj)/,$(IMG-parportbook))
EPS-parportbook := $(patsubst %.fig,%.eps, $(IMG-parportbook2)) EPS-parportbook := $(patsubst %.fig,%.eps, $(IMG-parportbook2))
PNG-parportbook := $(patsubst %.fig,%.png, $(IMG-parportbook2)) PNG-parportbook := $(patsubst %.fig,%.png, $(IMG-parportbook2))
Documentation/DocBook/parportbook.html: $(PNG-parportbook) $(obj)/parportbook.html: $(PNG-parportbook)
Documentation/DocBook/parportbook.ps Documentation/DocBook/parportbook.pdf:\ $(obj)/parportbook.ps $(obj)/parportbook.pdf: $(EPS-parportbook)
$(EPS-parportbook)
### ###
# Rules to generate postscript, PDF and HTML # Rules to generate postscript, PDF and HTML
...@@ -155,22 +147,20 @@ dochelp: ...@@ -155,22 +147,20 @@ dochelp:
### ###
# clean and mrproper as used by the top-level makefile # clean and mrproper as used by the top-level makefile
# Temporary files left by various tools # Temporary files left by various tools
DVI := $(patsubst %.sgml, %.dvi, $(BOOKS)) clean-files := $(DOCBOOKS) \
AUX := $(patsubst %.sgml, %.aux, $(BOOKS)) $(patsubst %.sgml, %.dvi, $(DOCBOOKS)) \
TEX := $(patsubst %.sgml, %.tex, $(BOOKS)) $(patsubst %.sgml, %.aux, $(DOCBOOKS)) \
LOG := $(patsubst %.sgml, %.log, $(BOOKS)) $(patsubst %.sgml, %.tex, $(DOCBOOKS)) \
OUT := $(patsubst %.sgml, %.out, $(BOOKS)) $(patsubst %.sgml, %.log, $(DOCBOOKS)) \
$(patsubst %.sgml, %.out, $(DOCBOOKS)) \
clean: $(patsubst %.sgml, %.ps, $(DOCBOOKS)) \
@rm -f core *~ $(patsubst %.sgml, %.pdf, $(DOCBOOKS)) \
@rm -f $(BOOKS) $(patsubst %.sgml, %.html, $(DOCBOOKS)) \
@rm -f $(DVI) $(AUX) $(TEX) $(LOG) $(OUT) $(patsubst %.fig,%.eps, $(IMG-parportbook)) \
@rm -f $(PNG-parportbook) $(EPS-parportbook) $(patsubst %.fig,%.png, $(IMG-parportbook)) \
@rm -f $(C-procfs-example) $(C-procfs-example)
mrproper: clean-rule := rm -rf $(patsubst %.html,%,$(HTML))
@rm -f $(PS) $(PDF)
@rm -f -r $(HTML) $(patsubst %.html,%,$(HTML))
include $(TOPDIR)/Rules.make include $(TOPDIR)/Rules.make
...@@ -713,7 +713,6 @@ mrproper: clean archmrproper ...@@ -713,7 +713,6 @@ mrproper: clean archmrproper
-type f -print | xargs rm -f -type f -print | xargs rm -f
$(call cmd,mrproper) $(call cmd,mrproper)
+@$(call descend,scripts,mrproper) +@$(call descend,scripts,mrproper)
+@$(call descend,Documentation/DocBook,mrproper)
# distclean - remove all temporaries left behind by patch, vi, emacs etc. # distclean - remove all temporaries left behind by patch, vi, emacs etc.
# #
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment