Skip to content

Instantly share code, notes, and snippets.

@jdp
Last active September 24, 2015 13:22
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jdp/2115525997853f35b91a to your computer and use it in GitHub Desktop.
Save jdp/2115525997853f35b91a to your computer and use it in GitHub Desktop.
makefile/procfile ultimate front end combo
JS = $(wildcard scripts/*.js)
all: game.js game.js.map game.css rules.html
game.js: $(JS)
game.js.map: $(JS)
%.js %.js.map:
closure-compiler --js $(JS) --js_output_file $*.js --create_source_map $*.js.map --source_map_format V3
echo "//# sourceMappingURL=$*.js.map" >> $*.js
game.css: styles/*.css
cat $^ > $@
rules.html: rules.md
pandoc -o $@ $<
clean:
-rm game.js game.js.map game.css rules.html
REMOTEUSER = www-data
REMOTEHOST = justinpoliey.com
REMOTEDIR = /var/www/justinpoliey.com/ld29/
deploy: index.html game.js game.css rules.html
rsync -avz --cvs-exclude --exclude=.git $^ $(REMOTEUSER)@$(REMOTEHOST):$(REMOTEDIR)
.PHONY: all clean deploy
web: python -m SimpleHTTPServer
watch: ls scripts/*.js styles/*.css rules.md | entr make
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment