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
|
2016-02-27 16:57:30 +01:00
|
|
|
BOWER ?= node_modules\.bin\bower.cmd
|
|
|
|
PHANTOMJS ?= node_modules\.bin\phantomjs.cmd
|
|
|
|
RJS ?= ./node_modules/.bin/r.js.cmd
|
2015-01-05 05:42:11 +01:00
|
|
|
SASS ?= sass
|
2015-02-05 15:57:39 +01:00
|
|
|
RMRF ?= rmdir /q /s
|
|
|
|
RMF ?= del /q
|
2015-05-14 20:45:37 +02:00
|
|
|
HTTPSERVE ?= ./node_modules/.bin/http-server.cmd
|
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
|
2015-07-03 13:25:50 +02:00
|
|
|
$(GRUNT) touch:npm
|
2015-01-05 05:42:11 +01:00
|
|
|
|
|
|
|
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
|
2015-07-03 13:25:50 +02:00
|
|
|
bundler install --path=.
|
2015-01-05 05:42:11 +01:00
|
|
|
|
|
|
|
########################################################################
|
|
|
|
## Builds
|
|
|
|
|
|
|
|
css::
|
|
|
|
$(SASS) sass/converse.scss > css/converse.css
|
|
|
|
|
2016-02-27 16:57:30 +01:00
|
|
|
.PHONY: build
|
|
|
|
build:: stamp-npm
|
2015-01-05 05:42:11 +01:00
|
|
|
$(GRUNT) jst
|
2016-02-27 16:57:30 +01:00
|
|
|
$(GRUNT) cssmin
|
|
|
|
$(RJS) -o src/build.js
|
|
|
|
$(RJS) -o src/build.js optimize=none out=builds/converse.js
|
|
|
|
$(RJS) -o src/build-no-jquery.js
|
|
|
|
$(RJS) -o src/build-no-jquery.js optimize=none out=builds/converse.nojquery.js
|
|
|
|
$(RJS) -o src/build-no-dependencies.js
|
|
|
|
$(RJS) -o src/build-no-dependencies.js optimize=none out=builds/converse-no-dependencies.js
|
2015-01-05 05:42:11 +01:00
|
|
|
|
|
|
|
########################################################################
|
|
|
|
## Tests
|
|
|
|
|
|
|
|
check:: stamp-npm
|
|
|
|
$(PHANTOMJS) node_modules/phantom-jasmine/lib/run_jasmine_test.coffee tests.html
|
|
|
|
|