makefilelatexaspell

makefile for latex aspell with multiple files


I neeed to run aspell on all tex files within a directory using a makefile

spellcheck:
    @aspell --lang=en -t -c sections/*tex

does not work as aspell cannot handle multiple files. How can I run multiple runs of aspell one after another?


Solution

  • Make a rule to run each file

    TEX_FILES = $(wildcard sections/*.tex)
    .PHONY: spellcheck
    spellcheck: $(addsuffix .spchk,$(basename $(TEX_FILES)))
    
    %.spchk: %.tex
        @aspell --lang=en -t -c $<