Files
KaTeX/Makefile
Emily Eisenberg f5197ae0a7 Make the Makefile non-mac friendly
Summary:
Add checks in the makefile to not run mac-only things when not on a
mac. (I've only tested on linux, I haven't ensured that this runs mac-only
things on a mac)

Test Plan:
- Run `make`
- Have it not break

Reviewers: alpert

Reviewed By: alpert

Differential Revision: http://phabricator.khanacademy.org/D7260
2014-03-11 16:32:08 -06:00

41 lines
897 B
Makefile

UNAME=$(shell uname)
.PHONY: build setup copy serve clean
build: setup build/katex.js build/katex.less.css
ifeq ($(UNAME),Darwin)
build: pdiff
endif
setup:
npm install
ifeq ($(UNAME),Darwin)
brew install webkit2png
brew install graphicsmagick
endif
compress: build/katex.min.js
@printf "Minified, gzipped size: "
@gzip -c $^ | wc -c
build/katex.js: katex.js $(wildcard *.js)
./node_modules/.bin/browserify $< --standalone katex > $@
build/katex.min.js: build/katex.js
uglifyjs --mangle < $< > $@
build/katex.less.css: static/katex.less
./node_modules/.bin/lessc $< > $@
serve:
node server.js
pdiff:
@printf "Creating new pdiff image...\n"
@webkit2png http://localhost:7936/test/pdiff.html -F --transparent -D build -o pdiff >/dev/null 2>&1
@mv build/pdiff-full.png build/pdiff.png
@printf "Comparing to reference pdiff image...\n"
@node test/pdiff.js
clean:
rm -rf build/*