Compile LESS CSS and Markdown files with Make

Here is a simple example Makefile to automatically compile any changed LESS CSS, or Markdown files and then update a remote server using rsync:

EXCLUDE = --exclude=.* --exclude=node_modules/
EXCLUDE_MF = --exclude=Makefile

LESS = public/css/screen.less public/css/print.less
MD = public/changelog.md

CSS = $(LESS:.less=.css)
HTML = $(MD:.md=.html)

%.css: %.less
   lessc -x $< > $@

%.html: %.md
   markdown $< > $@

all: markdown less rsync

markdown: $(HTML)

less: $(CSS)

rsync:
   rsync -avLP --delete $(EXCLUDE) $(EXCLUDE_MF) ./ user@host:/target/path