LATEX_FILES ?= $(wildcard *.tex)

all: $(LATEX_FILES:.tex=.pdf)

clean:
	@for f in $(LATEX_FILES); do latexmk -C $$f; done

open: all
	@open `ls -rt $(LATEX_FILES)|tail -1|sed 's/\.tex$$/.pdf/'`

.SUFFIXES: .tex .pdf

%.pdf: %.tex
	latexmk -pdf $<

LATEX_FILES ?= $(wildcard *.tex)
LATEST_TEX = $(shell ls -rt *.tex|tail -1)

all: $(LATEX_FILES:.tex=.pdf)

clean:
	@for f in $(LATEX_FILES); do latexmk -C $$f; done

open: $(LATEST_TEX:.tex=.pdf)
	@open $<

.SUFFIXES: .tex .pdf

%.pdf: %.tex
	latexmk -pdf $<

Change 'make open' to only build the latest tex file
Change 'make open' to only build the latest tex file
