2015-01-05 05:42:11 +01:00
|
|
|
# You can set these variables from the command line.
|
2015-02-05 15:57:39 +01:00
|
|
|
GRUNT ?= node_modules\.bin\grunt.cmd
|
2015-01-05 05:42:11 +01:00
|
|
|
BOWER ?= node_modules\.bin\bower
|
|
|
|
PHANTOMJS ?= node_modules\.bin\phantomjs
|
|
|
|
SASS ?= sass
|
2015-02-05 15:57:39 +01:00
|
|
|
RMRF ?= rmdir /q /s
|
|
|
|
RMF ?= del /q
|
|
|
|
HTTPSERVE ?= ./node_modules/.bin/http-server
|
2015-01-05 05:42:11 +01:00
|
|
|
|
|
|
|
.PHONY: all help clean css minjs build
|
|
|
|
|
|
|
|
all: dev
|
|
|
|
|
|
|
|
help:
|
2015-02-05 15:57:39 +01:00
|
|
|
@echo "Please use \`make <target>' where <target> is one of the following"
|
2015-01-05 05:42:11 +01:00
|
|
|
@echo " dev to set up the development environment"
|
|
|
|
@echo " build create minified builds containing converse.js and all its dependencies"
|
2015-02-05 15:57:39 +01:00
|
|
|
@echo " serve to serve this directory via a webserver on port 8000"
|
|
|
|
|
|
|
|
########################################################################
|
|
|
|
## Miscellaneous
|
|
|
|
|
|
|
|
serve:
|
|
|
|
$(HTTPSERVE) -p 8000
|
2015-01-05 05:42:11 +01:00
|
|
|
|
|
|
|
########################################################################
|
|
|
|
## Install dependencies
|
|
|
|
|
|
|
|
stamp-npm: package.json
|
|
|
|
npm install
|
|
|
|
$(GRUNT) touch:npm
|
|
|
|
|
|
|
|
stamp-bower: stamp-npm bower.json
|
|
|
|
$(BOWER) install
|
|
|
|
$(GRUNT) touch:bower
|
|
|
|
|
|
|
|
clean::
|
|
|
|
@if EXIST stamp-npm $(RMF) stamp-npm
|
|
|
|
@if EXIST stamp-bower $(RMF) stamp-bower
|
|
|
|
@if EXIST node_modules\. $(RMRF) node_modules
|
|
|
|
@if EXIST components\. $(RMRF) components
|
|
|
|
|
|
|
|
dev: clean
|
|
|
|
npm install
|
|
|
|
$(BOWER) update
|
|
|
|
bundler install --path=.
|
|
|
|
|
|
|
|
########################################################################
|
|
|
|
## Builds
|
|
|
|
|
|
|
|
css::
|
|
|
|
$(SASS) sass/converse.scss > css/converse.css
|
|
|
|
|
|
|
|
build::
|
|
|
|
$(GRUNT) jst
|
|
|
|
$(GRUNT) minify
|
|
|
|
|
|
|
|
########################################################################
|
|
|
|
## Tests
|
|
|
|
|
|
|
|
check:: stamp-npm
|
|
|
|
$(PHANTOMJS) node_modules/phantom-jasmine/lib/run_jasmine_test.coffee tests.html
|
|
|
|
|