subdirs = dir1 dir2

all:
        set -e; \
        for dir in $(subdirs); do \
          $(MAKE) -C $$dir; \
        done

clean:
        set -e; \
        for dir in $(subdirs); do \
          (cd $$dir && rm -f *.d); \
        done
        for dir in $(subdirs); do \
          $(MAKE) -C $$dir clean; \
        done

cleanall:
        set -e; \
        for dir in $(subdirs); do \
          (cd $$dir && rm -f *.d); \
        done
        for dir in $(subdirs); do \
          $(MAKE) -C $$dir cleanall; \
        done

check:
        find -name '*.log' | xargs grep -H full || true
        find -name '*.log' | xargs grep -H 'too large' || true
        find -name '*.tex' | xargs grep -Hi fixme || true