Created
October 18, 2012 12:33
-
-
Save andremedeiros/3911507 to your computer and use it in GitHub Desktop.
Makefile for a Typescript project
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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