Source

bookmaak / Makefile

Full commit
#
#  Copyright (C) 2011
#    Mario Gastegger <mario DOT gastegger AT gmx DOT net>, uniqx
#    Metalab, 1010 Vienna, Austria
#
#  This program is free software: you can redistribute it and/or modify
#  it under the terms of the GNU Affero General Public License as published
#  by the Free Software Foundation, either version 3 of the License, or
#  (at your option) any later version.
#
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU Affero General Public License for more details.
#
#  You should have received a copy of the GNU Affero General Public License
#  along with this program.  If not, see <http://www.gnu.org/licenses/>.
#

SHELL = /bin/sh

NODE = node
NDOC = node_modules/.bin/ndoc
UGLIFY = node_modules/uglify-js/bin/uglifyjs
JADE = node_modules/jade/bin/jade

JADE_OPTIONS = "{ pretty: true, filename: 'src/main/client/ui/index.jade'}"
JADE_PACKAGE_OPTIONS = "{ pretty: false, filename: 'src/main/client/ui/index.jade'}"


JS = util/js-build

all: html

package: html-package

html-package: js-package
	$(JADE) -o $(JADE_PACKAGE_OPTIONS) < src/main/client/ui/index.jade > build/bookmaak.html

js-package: js
	$(UGLIFY) < build/javascript/bookmaak.js > build/javascript/ugly.bookmaak.js


html: js
	$(JADE) -o $(JADE_OPTIONS) < src/main/client/ui/index.jade > build/bookmaak.html

js:
	$(JS)

docs: clean-docs install-dependencies
	$(NDOC) src -o docs

install-dependencies:
	util/install-dependencies -d

run: all
	$(NODE) ./src/main/server/srv.js

.PHONY: clean clean-docs clean-dependencies

clean: clean-docs clean-dependencies

clean-docs:
	rm -rf docs

clean-dependencies:
	rm -rf node_modules