Skip to main content
4 of 5
added 223 characters in body
guest_7
  • 5.8k
  • 1
  • 8
  • 13

You need to include their names in the pdfs list.

But the idiomatic way to do it is to start from source (in your case the .texi files) and from them, dynamically generate the output list (in your case .pdf files)

Also, you should mark the targets as .PHONY for which no corresponding file exists.

.PHONY: all new again clean ch6 igm rf 

ch6 := $(wildcard *amcoh.texi)
igm := $(wildcard *igm.texi)
rfc := $(wildcard *rfc.texi)

tfiles := $(ch6) $(igm) $(rfc)
pdfs := $(tfiles:.texi=.pdf)

define mkRule
$(eval $1: $$(filter $$($1:.texi=.pdf),$$(pdfs)))
endef
$(call mkRule,ch6)
$(call mkRule,igm)
$(call mkRule,rfc)

all: ${pdfs}

%.pdf: %.texi
    echo texi2pdf $< -o $@ > $@

clean:
    rm -f ${pdfs}

again:
    ${MAKE} clean
    ${MAKE} all

new:
    ${MAKE} again

Now invoke make as :

make igm    #to process *igm.texi 
guest_7
  • 5.8k
  • 1
  • 8
  • 13