tnetstrings
Version:
A fully-featured tnetstrings library, isomorphic to JSON
54 lines (37 loc) • 1.03 kB
Plain Text
# 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
all: $(TNETS_LIB)
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 .
package: $(PACKAGE)
minify: $(TNETS_MIN)
publish: $(PACKAGE)
npm publish $(PACKAGE)
clean:
rm -f $(CLEAN)