Skip to content

Instantly share code, notes, and snippets.

@andremedeiros
Created October 18, 2012 12:33
Show Gist options
  • Save andremedeiros/3911507 to your computer and use it in GitHub Desktop.
Save andremedeiros/3911507 to your computer and use it in GitHub Desktop.
Makefile for a Typescript project
all: compile test
deps:
if ! test -d node_modules; then npm install; fi
clean:
rm -rf lib/*
TMP_FILE := $(shell mktemp -t project_name)
compile: deps clean
cd src && \
find . -name "*.ts" >> $(TMP_FILE) && \
tsc @$(TMP_FILE) && \
find . -name "*.js" | cpio -pmud ../lib 2> /dev/null && \
find . -name "*.js" | xargs rm
TEST_REPORTER ?= dot
test: deps clean compile
mocha --recursive --reporter $(TEST_REPORTER) test
test-tap: deps clean compile
mocha --recursive --reporter tap test
.PHONY: test deps compile
.SILENT:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment