Skip to content

Instantly share code, notes, and snippets.

@qpfiffer
Created November 10, 2015 21:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save qpfiffer/d9dd07117f9058b153d2 to your computer and use it in GitHub Desktop.
Save qpfiffer/d9dd07117f9058b153d2 to your computer and use it in GitHub Desktop.
Makefile to compile coffeescript to javascript.
COFFEEC=coffee
BUILDDIR=lib
SOURCEDIR=src
SOURCES=$(shell find $(SOURCEDIR) -name '*.coffee')
OBJECTS=$(subst $(SOURCEDIR),$(BUILDDIR),$(SOURCES:%.coffee=%.js))
all: $(OBJECTS)
clean:
rm -rf $(BUILDDIR)
$(BUILDDIR)/%.js: $(SOURCEDIR)/%.coffee
@mkdir -p $(@D)
$(COFFEEC) -bcs < $^ > $@
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment