Skip to content

Instantly share code, notes, and snippets.

@fluffels
Last active August 29, 2015 14:03
Show Gist options
  • Save fluffels/f749fee4a72ebad57c4d to your computer and use it in GitHub Desktop.
Save fluffels/f749fee4a72ebad57c4d to your computer and use it in GitHub Desktop.
Dumb make system that recompiles updated LESS files.
SOURCE_FILES=main.less
SOURCE_PATH=src/less/
TARGET_PATH=css/
SOURCES=$(addprefix ${SOURCE_PATH}, ${SOURCE_FILES})
SOURCES_AND_LIBS=$(shell find ${SOURCE_PATH} -name '*.less')
TARGETS=$(addprefix ${TARGET_PATH}, $(addsuffix .css, $(basename ${SOURCE_FILES})))
all: ${TARGETS}
${TARGET_PATH}%.css: ${SOURCE_PATH}%.less ${SOURCES_AND_LIBS}
lessc $< > $@
#!/usr/bin/env sh
while true
do
inotifywait -q -e modify `find src/less/ -name '*.less'`
make
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment