Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

54 lines (37 sloc) 1.028 kb
# XXX this is kind of awful, but hey, it keeps the version info in the right place.
VERSION = $(shell node -e 'console.log(JSON.parse(require("fs").readFileSync(__dirname + "/package.json")).version)')
SRC_DIR = ./src
TNETS_SRC = $(SRC_DIR)/tnetstrings.coffee
LIB_DIR ?= ./lib
TNETS_LIB = $(LIB_DIR)/tnetstrings.js
CLEAN += $(TNETS_LIB)
UGLIFY_OPTS += --lift-vars --unsafe
TNETS_MIN = $(LIB_DIR)/tnetstrings.min.js
CLEAN += $(TNETS_MIN)
PACKAGE = tnetstrings-$(VERSION).tgz
CLEAN += $(PACKAGE)
# binaries
COFFEE ?= coffee
EXPRESSO ?= expresso
UGLIFYJS ?= uglifyjs
.PHONY: all
all: $(TNETS_LIB)
.PHONY: test
test: $(TNETS_LIB)
$(EXPRESSO) test/*.test.coffee
$(TNETS_LIB): $(TNETS_SRC)
$(COFFEE) --bare -o $(LIB_DIR) $(TNETS_SRC)
$(TNETS_MIN): $(TNETS_LIB)
$(UGLIFYJS) $(UGLIFY_OPTS) -o $(TNETS_MIN) $(TNETS_LIB)
$(PACKAGE): test
npm pack .
.PHONY: package
package: $(PACKAGE)
.PHONY: minify
minify: $(TNETS_MIN)
.PHONY: publish
publish: $(PACKAGE)
npm publish $(PACKAGE)
.PHONY: clean
clean:
rm -f $(CLEAN)
Jump to Line
Something went wrong with that request. Please try again.