2013-12-21 01:03:59 -05:00
|
|
|
## ease.js Makefile.am
|
2013-12-22 22:44:41 -05:00
|
|
|
#
|
2014-04-09 18:59:22 -04:00
|
|
|
# Copyright (C) 2013, 2014 Free Software Foundation, Inc.
|
2013-12-22 22:44:41 -05:00
|
|
|
#
|
|
|
|
# This file is part of GNU ease.js.
|
|
|
|
#
|
|
|
|
# This program is free software: you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU 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 General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
##
|
2013-12-21 01:03:59 -05:00
|
|
|
|
|
|
|
path_build = $(top_builddir)/build
|
|
|
|
path_tools = $(top_builddir)/tools
|
|
|
|
path_lib = $(top_builddir)/lib
|
|
|
|
path_test = $(top_builddir)/test
|
|
|
|
path_doc = $(top_builddir)/doc
|
|
|
|
|
|
|
|
path_combine_output = $(path_build)/ease.js
|
|
|
|
path_combine_output_full = $(path_build)/ease-full.js
|
|
|
|
path_browser_test = $(path_tools)/browser-test.html
|
|
|
|
|
2014-01-06 21:31:49 -05:00
|
|
|
path_combine_output_min = $(path_combine_output:.js=.min.js)
|
|
|
|
path_combine_output_full_min = $(path_combine_output_full:.js=.min.js)
|
|
|
|
|
2013-12-21 01:03:59 -05:00
|
|
|
src_js = @SRC_JS@
|
|
|
|
path_externs_internal = $(path_build)/externs-internal.js
|
|
|
|
|
2014-02-14 00:41:49 -05:00
|
|
|
test_cases=$(shell cd test/ && find . -name '*Test.*' | tr '\n' ' ' )
|
2014-01-06 22:34:09 -05:00
|
|
|
src_tests=$(shell find test/ -name test-* | tr '\n' ' ' )
|
|
|
|
|
2013-12-21 01:03:59 -05:00
|
|
|
combine = $(path_tools)/combine
|
2013-12-21 23:31:45 -05:00
|
|
|
compiler = @CCJAR@
|
|
|
|
MKDIR_P = @MKDIR_P@
|
2013-12-21 01:03:59 -05:00
|
|
|
|
2014-01-06 21:31:49 -05:00
|
|
|
# see README
|
|
|
|
SUBDIRS = doc
|
2014-03-16 00:09:34 -04:00
|
|
|
EXTRA_DIST = AUTHORS NEWS ChangeLog README.md README.hacking README.traits \
|
2014-06-08 01:57:25 -04:00
|
|
|
lib test index.js package.json version \
|
2014-01-06 21:31:49 -05:00
|
|
|
$(path_combine_output) $(path_combine_output_full) \
|
|
|
|
$(path_browser_test) $(path_combine_output_min) \
|
|
|
|
$(path_combine_output_full_min) \
|
|
|
|
tools/combine tools/mkexterns tools/rmtrail \
|
|
|
|
tools/signchk tools/browser-test.html tools/combine-order.js \
|
|
|
|
tools/combine-test.tpl tools/combine.tpl tools/externs-global.js \
|
|
|
|
tools/externs.js tools/license-min.tpl tools/license.tpl \
|
2014-06-08 01:57:25 -04:00
|
|
|
tools/linechk-ignores tools/vergen
|
2014-01-06 21:31:49 -05:00
|
|
|
|
2013-12-22 22:44:41 -05:00
|
|
|
.PHONY: mkbuild combine min doc check test test-suite perf FORCE
|
2013-12-21 01:03:59 -05:00
|
|
|
|
2013-12-22 22:44:41 -05:00
|
|
|
default: combine
|
2013-12-21 01:03:59 -05:00
|
|
|
|
|
|
|
mkbuild: $(path_build)
|
|
|
|
|
|
|
|
# create build dir
|
|
|
|
$(path_build):
|
2013-12-21 23:31:45 -05:00
|
|
|
$(MKDIR_P) "$(path_build)"
|
2013-12-21 01:03:59 -05:00
|
|
|
|
|
|
|
|
2014-06-11 22:19:53 -04:00
|
|
|
combine: reconf $(path_combine_output) $(path_build)/browser-test.html
|
|
|
|
|
|
|
|
# will force a reconfigure (for version data) if in the git repo
|
|
|
|
reconf:
|
|
|
|
test -d .git && autoconf && ./configure
|
2013-12-21 01:03:59 -05:00
|
|
|
|
|
|
|
# combine all modules into easily redistributable ease.js file (intended for
|
|
|
|
# browser)
|
|
|
|
$(path_combine_output): $(src_js) | mkbuild
|
|
|
|
$(combine) > "$(path_combine_output)"
|
|
|
|
$(path_combine_output_full): $(src_js) $(src_tests) | mkbuild
|
|
|
|
INC_TEST=1 "$(combine)" > "${path_combine_output_full}"
|
|
|
|
$(path_build)/browser-test.html: $(path_browser_test) | $(path_combine_output_full)
|
|
|
|
cp -f "$(path_browser_test)" $@
|
|
|
|
$(path_build)/browser-test-min.html: $(path_browser_test) | $(path_combine_output_full)
|
|
|
|
cat "$(path_browser_test)" | sed 's/ease-full\.js/ease-full\.min\.js/' > $@
|
|
|
|
|
|
|
|
# minification process uses Google Closure compiler
|
|
|
|
min: $(path_build)/ease.min.js $(path_build)/ease-full.min.js \
|
|
|
|
$(path_build)/browser-test-min.html | combine
|
|
|
|
build/%.min.js: build/%.js $(path_tools)/externs-global.js $(path_externs_internal)
|
|
|
|
if HAS_JAVA
|
|
|
|
if HAS_CCJAR
|
|
|
|
cat $(path_tools)/license-min.tpl > $@
|
|
|
|
$(JAVA) -jar $(compiler) \
|
|
|
|
--externs $(path_tools)/externs-global.js \
|
|
|
|
--externs $(path_build)/externs-internal.js \
|
2014-06-08 23:22:31 -04:00
|
|
|
--language_in=ECMASCRIPT5_STRICT \
|
2013-12-21 01:03:59 -05:00
|
|
|
--js $< >> $@ || rm $@
|
|
|
|
else
|
|
|
|
@echo "cannot create $@:"
|
|
|
|
@echo " please download closure-compiler.jar and re-run ./configure"
|
|
|
|
@exit 1
|
|
|
|
endif
|
|
|
|
else
|
|
|
|
@echo "Please install a Java virtual machine (e.g. openjdk)"
|
|
|
|
@exit 1
|
|
|
|
endif
|
|
|
|
|
|
|
|
# externs for compilation process
|
|
|
|
$(path_externs_internal): | mkbuild
|
|
|
|
$(path_tools)/mkexterns > $@
|
|
|
|
|
|
|
|
doc:
|
|
|
|
$(MAKE) -C "$(path_doc)"
|
2013-12-25 00:12:16 -05:00
|
|
|
html-single:
|
|
|
|
$(MAKE) -C "$(path_doc)" html-single
|
2013-12-21 01:03:59 -05:00
|
|
|
|
|
|
|
test: check
|
2014-01-06 22:34:09 -05:00
|
|
|
check: $(src_tests) test-suite
|
2013-12-21 01:03:59 -05:00
|
|
|
|
2014-03-30 00:12:19 -04:00
|
|
|
# performance tests (order matters here)
|
|
|
|
perf-html: perf.log.html
|
|
|
|
perf.%.html: perf.%
|
|
|
|
sort "$<" | $(path_tools)/perf2html -F\| > "$@"
|
2014-03-29 20:13:26 -04:00
|
|
|
perf: perf.log
|
|
|
|
perf.%: FORCE
|
2013-12-21 01:03:59 -05:00
|
|
|
if HAS_NODE
|
2014-03-29 20:13:26 -04:00
|
|
|
@$(path_test)/perf/runner @PERF_TESTS@ > "$@"
|
2013-12-21 01:03:59 -05:00
|
|
|
else
|
|
|
|
@echo "Node.js must be installed in order to run performance tests"
|
|
|
|
@exit 1
|
|
|
|
endif
|
|
|
|
|
2014-01-20 02:21:17 -05:00
|
|
|
# non-JS test cases
|
2013-12-22 22:44:41 -05:00
|
|
|
test/test-%: FORCE
|
|
|
|
./"$@"
|
|
|
|
|
2014-01-20 02:21:17 -05:00
|
|
|
# JS test cases
|
2014-01-21 22:58:29 -05:00
|
|
|
test-suite:
|
2013-12-22 22:44:41 -05:00
|
|
|
if HAS_NODE
|
2014-01-06 22:54:31 -05:00
|
|
|
@echo "GNU ease.js Test Suite"
|
2013-12-22 22:44:41 -05:00
|
|
|
@echo
|
2014-02-14 00:41:49 -05:00
|
|
|
@(cd $(path_test) && ./runner $(test_cases))
|
2013-12-22 22:44:41 -05:00
|
|
|
else
|
|
|
|
@echo "Node.js must be installed in order to run the test suite"
|
|
|
|
@exit 1
|
|
|
|
endif
|
|
|
|
|
2013-12-21 01:03:59 -05:00
|
|
|
# generate the familiar files that automake normally checks for
|
2014-06-08 01:57:25 -04:00
|
|
|
dist-hook: AUTHORS NEWS ChangeLog version
|
2013-12-22 00:57:06 -05:00
|
|
|
cp $? $(distdir)
|
2013-12-22 22:50:57 -05:00
|
|
|
AUTHORS: FORCE
|
2014-06-08 01:57:25 -04:00
|
|
|
$(path_tools)/gitlog-to-authors > $@
|
2013-12-22 22:50:57 -05:00
|
|
|
NEWS: FORCE
|
2014-06-08 01:57:25 -04:00
|
|
|
$(path_tools)/gitlog-to-news $(path_tools)/news-ignore > $@
|
2013-12-22 22:50:57 -05:00
|
|
|
ChangeLog: FORCE
|
2013-12-21 01:03:59 -05:00
|
|
|
$(path_tools)/gitlog-to-changelog \
|
|
|
|
--strip-cherry-pick \
|
|
|
|
--format=%s \
|
|
|
|
-- \
|
|
|
|
--no-merges \
|
2014-06-08 01:57:25 -04:00
|
|
|
> $@
|
|
|
|
# we *only* want this in a distribution, otherwise the version number will
|
|
|
|
# never change!
|
2014-06-11 22:19:53 -04:00
|
|
|
version: FORCE
|
2014-06-08 01:57:25 -04:00
|
|
|
$(path_tools)/vergen > $@
|
2013-12-21 01:03:59 -05:00
|
|
|
|
|
|
|
clean-local:
|
|
|
|
-rm -rf "$(path_build)"
|
2014-01-06 20:53:18 -05:00
|
|
|
-rm -rf doc-cp # created by website branch build
|
2014-07-28 00:08:06 -04:00
|
|
|
-rm -f AUTHORS NEWS ChangeLog version
|
2013-12-22 01:10:31 -05:00
|
|
|
|
|
|
|
distclean-local:
|
|
|
|
-rm -f package.json
|
2013-12-21 01:03:59 -05:00
|
|
|
|
|
|
|
maintainer-clean-local:
|
|
|
|
-rm -f "$(compiler)"
|