Next / Previous / Contents / Shipman's homepage

2.1. Sample Makefile rules

We assume that you are using the sample Makefile described in the local DocBook documentation. This includes a rule for converting .fo files to .pdf:

.fo.pdf:
	xep $(XEP_OPT) $< $@ 
all: web pdf code index
  1. Add two new defines somewhere at the top of the file:

    INDEX_FO        =  toc.fo
    INDEX_TARGET    =  toc.pdf
    
  2. To the all: target, add a new target named index:

    all: web pdf code index
    
  3. Add the definition of the new target like this:

    index: $(INDEX_TARGET)
    
    $(INDEX_TARGET): $(INDEX_FO)
    
    $(INDEX_FO): $(SOURCE)
    	rm -f $(INDEX_FO); \
    	docbookindex $(SOURCE)