## Licensed under the Apache License, Version 2.0 (the "License"); you may not
## use this file except in compliance with the License. You may obtain a copy of
## the License at
##
##   http://www.apache.org/licenses/LICENSE-2.0
##
## Unless required by applicable law or agreed to in writing, software
## distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
## WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
## License for the specific language governing permissions and limitations under
## the License.

SUBDIRS = doc

JS_FILE = server/main.js

JS_FILE_COMPONENTS = \
    server/json2.js \
    server/filter.js \
    server/mimeparse.js \
    server/render.js \
    server/state.js \
    server/util.js \
    server/validate.js \
    server/views.js

JS_FILE_COMPONENTS_LAST = server/loop.js

$(JS_FILE): $(JS_FILE_COMPONENTS) $(JS_FILE_COMPONENTS_LAST)
	mkdir -p `dirname $(JS_FILE)`
	echo "// DO NOT EDIT THIS FILE BY HAND" > $@
	echo >> $@
	cat $^ >> $@

COFFEE_FILE = server/main-coffee.js

COFFEE_FILE_COMPONENTS_LAST = server/coffee-script.js server/loop.js

$(COFFEE_FILE): $(JS_FILE_COMPONENTS) $(COFFEE_FILE_COMPONENTS_LAST)
	mkdir -p `dirname $(COFFEE_FILE)`
	echo "// DO NOT EDIT THIS FILE BY HAND" > $@
	echo >> $@
	cat $^ >> $@

CLEANFILES = $(JS_FILE) $(COFFEE_FILE)

EXTRA_DIST = $(JS_FILE_COMPONENTS) $(JS_FILE_COMPONENTS_LAST) $(COFFEE_FILE_COMPONENTS_LAST)

nobase_localdata_SCRIPTS = \
    $(JS_FILE) \
    $(COFFEE_FILE)

nobase_dist_localdata_DATA = \
    www/config.html \
    www/couch_tests.html \
    www/custom_test.html \
    www/database.html \
    www/session.html \
    www/dialog/_admin_party.html \
    www/dialog/_change_password.html \
    www/dialog/_compact_cleanup.html \
    www/dialog/_create_admin.html \
    www/dialog/_login.html \
    www/dialog/_signup.html \
    www/dialog/_create_database.html \
    www/dialog/_create_config.html \
    www/dialog/_delete_database.html \
    www/dialog/_delete_document.html \
    www/dialog/_database_security.html \
    www/dialog/_share_test_reports.html \
    www/dialog/_save_view_as.html \
    www/dialog/_upload_attachment.html \
    www/document.html \
    www/fauxton/css/index.css \
    www/fauxton/img/couchdb-site.png \
    www/fauxton/img/couchdblogo.png \
    www/fauxton/img/fontawesome-webfont.eot \
    www/fauxton/img/fontawesome-webfont.svg \
    www/fauxton/img/fontawesome-webfont.ttf \
    www/fauxton/img/fontawesome-webfont.woff \
    www/fauxton/img/FontAwesome.otf \
    www/fauxton/img/fontcustom_fauxton.eot \
    www/fauxton/img/fontcustom_fauxton.svg \
    www/fauxton/img/fontcustom_fauxton.ttf \
    www/fauxton/img/fontcustom_fauxton.woff \
    www/fauxton/img/glyphicons-halflings-white.png \
    www/fauxton/img/glyphicons-halflings.png \
    www/fauxton/img/linen.png \
    www/fauxton/img/loader.gif \
    www/fauxton/img/minilogo.png \
    www/fauxton/index.html \
    www/fauxton/js/require.js \
    www/fauxton/js/ace/mode-javascript.js \
    www/fauxton/js/ace/mode-json.js \
    www/fauxton/js/ace/theme-crimson_editor.js \
    www/fauxton/js/ace/worker-javascript.js \
    www/fauxton/js/ace/worker-json.js \
    www/favicon.ico \
    www/image/add.png \
    www/image/apply.gif \
    www/image/bg.png \
    www/image/cancel.gif \
    www/image/compact.png \
    www/image/delete-mini.png \
    www/image/delete.png \
    www/image/grippie.gif \
    www/image/hgrad.gif \
    www/image/key.png \
    www/image/load.png \
    www/image/logo.png \
    www/image/order-asc.gif \
    www/image/order-desc.gif \
    www/image/path.gif \
    www/image/progress.gif \
    www/image/rarrow.png \
    www/image/run-mini.png \
    www/image/run.png \
    www/image/running.png \
    www/image/save.png \
    www/image/sidebar-toggle.png \
    www/image/spinner.gif \
    www/image/spinner_33.gif \
    www/image/spinner_6b.gif \
    www/image/test_failure.gif \
    www/image/test_success.gif \
    www/image/thead-key.gif \
    www/image/thead.gif \
    www/image/toggle-collapse.gif \
    www/image/toggle-expand.gif \
    www/image/twisty.gif \
    www/index.html \
    www/plugins.html \
    www/replicator.html \
    www/script/couch.js \
    www/script/couch_tests.js \
    www/script/couch_test_runner.js \
    www/script/futon.browse.js \
    www/script/futon.format.js \
    www/script/futon.js \
    www/script/jquery.couch.js \
    www/script/jquery.dialog.js \
    www/script/jquery.editinline.js \
    www/script/jquery.form.js \
    www/script/jquery.js \
    www/script/jquery-ui-1.8.11.custom.min.js \
    www/script/jquery.resizer.js \
    www/script/jquery.suggest.js \
    www/script/json2.js \
    www/script/jspec/jspec.css \
    www/script/jspec/jspec.jquery.js \
    www/script/jspec/jspec.js \
    www/script/jspec/jspec.xhr.js \
    www/script/oauth.js \
    www/script/sha1.js \
    www/script/base64.js \
    www/script/test/all_docs.js \
    www/script/test/attachments.js \
    www/script/test/attachments_multipart.js \
    www/script/test/attachment_names.js \
    www/script/test/attachment_paths.js \
    www/script/test/attachment_ranges.js \
    www/script/test/attachment_views.js \
    www/script/test/auth_cache.js \
    www/script/test/basics.js \
    www/script/test/batch_save.js \
    www/script/test/bulk_docs.js \
    www/script/test/changes.js \
    www/script/test/coffee.js \
    www/script/test/compact.js \
    www/script/test/config.js \
    www/script/test/conflicts.js \
    www/script/test/content_negotiation.js \
    www/script/test/cookie_auth.js \
    www/script/test/copy_doc.js \
    www/script/test/delayed_commits.js \
    www/script/test/design_docs.js \
    www/script/test/design_options.js \
    www/script/test/design_paths.js \
    www/script/test/erlang_views.js \
    www/script/test/etags_head.js \
    www/script/test/etags_views.js \
    www/script/test/form_submit.js \
    www/script/test/http.js \
    www/script/test/invalid_docids.js \
    www/script/test/jsonp.js \
    www/script/test/large_docs.js \
    www/script/test/list_views.js \
    www/script/test/lorem.txt \
    www/script/test/lorem_b64.txt \
    www/script/test/lots_of_docs.js \
    www/script/test/method_override.js \
    www/script/test/multiple_rows.js \
    www/script/test/oauth.js \
    www/script/test/oauth_users_db.js \
    www/script/test/proxyauth.js \
    www/script/test/purge.js \
    www/script/test/reader_acl.js \
    www/script/test/recreate_doc.js \
    www/script/test/reduce.js \
    www/script/test/reduce_builtin.js \
    www/script/test/reduce_false.js \
    www/script/test/reduce_false_temp.js \
    www/script/test/replication.js \
    www/script/replicator_db_inc.js \
    www/script/test/replicator_db_bad_rep_id.js \
    www/script/test/replicator_db_by_doc_id.js \
    www/script/test/replicator_db_compact_rep_db.js \
    www/script/test/replicator_db_continuous.js \
    www/script/test/replicator_db_credential_delegation.js \
    www/script/test/replicator_db_field_validation.js \
    www/script/test/replicator_db_filtered.js \
    www/script/test/replicator_db_identical.js \
    www/script/test/replicator_db_identical_continuous.js \
    www/script/test/replicator_db_invalid_filter.js \
    www/script/test/replicator_db_security.js \
    www/script/test/replicator_db_simple.js \
    www/script/test/replicator_db_successive.js \
    www/script/test/replicator_db_survives.js \
    www/script/test/replicator_db_swap_rep_db.js \
    www/script/test/replicator_db_update_security.js \
    www/script/test/replicator_db_user_ctx.js \
    www/script/test/replicator_db_write_auth.js \
    www/script/test/rev_stemming.js \
    www/script/test/rewrite.js \
    www/script/test/security_validation.js \
    www/script/test/show_documents.js \
    www/script/test/stats.js \
    www/script/test/update_documents.js \
    www/script/test/users_db.js \
    www/script/test/users_db_security.js \
    www/script/test/utf8.js \
    www/script/test/uuids.js \
    www/script/test/view_collation.js \
    www/script/test/view_collation_raw.js \
    www/script/test/view_conflicts.js \
    www/script/test/view_compaction.js \
    www/script/test/view_errors.js \
    www/script/test/view_include_docs.js \
    www/script/test/view_multi_key_all_docs.js \
    www/script/test/view_multi_key_design.js \
    www/script/test/view_multi_key_temp.js \
    www/script/test/view_offsets.js \
    www/script/test/view_update_seq.js \
    www/script/test/view_pagination.js \
    www/script/test/view_sandboxing.js \
    www/spec/couch_js_class_methods_spec.js \
    www/spec/couch_js_instance_methods_1_spec.js \
    www/spec/couch_js_instance_methods_2_spec.js \
    www/spec/couch_js_instance_methods_3_spec.js \
    www/spec/custom_helpers.js \
    www/spec/jquery_couch_js_class_methods_spec.js \
    www/spec/jquery_couch_js_instance_methods_1_spec.js \
    www/spec/jquery_couch_js_instance_methods_2_spec.js \
    www/spec/jquery_couch_js_instance_methods_3_spec.js \
    www/spec/run.html \
    www/status.html \
    www/style/jquery-ui-1.8.11.custom.css \
    www/style/layout.css \
    www/verify_install.html \
    www/_sidebar.html
