#! /usr/bin/make -f # # debian/rules # Part of Debian ‘jquery-at.js’ package. # # This is free software, and you are welcome to redistribute it under # certain conditions; see the end of this file for copyright # information, grant of license, and disclaimer of warranty. JAVASCRIPT_MODULES = \ default \ app \ controller \ textareaController \ editableController \ model \ view \ api JAVASCRIPT_LIBRARY = \ jquery.atwho SOURCE_DIR = $(CURDIR)/src BUILD_DIR = $(CURDIR)/build BUILD_JS_DIR = ${BUILD_DIR}/js COFFEESCRIPT_SUFFIX = .coffee coffeescript_module_files = $(addsuffix ${COFFEESCRIPT_SUFFIX},${JAVASCRIPT_MODULES}) coffeescript_module_paths = $(addprefix ${SOURCE_DIR}/,${coffeescript_module_files}) JAVASCRIPT_SUFFIX = .js javascript_module_files = $(addsuffix ${JAVASCRIPT_SUFFIX},${JAVASCRIPT_MODULES}) javascript_module_paths = $(addprefix ${BUILD_JS_DIR}/,${javascript_module_files}) GENERATED_FILES += ${javascript_module_paths} javascript_library_file = $(addsuffix ${JAVASCRIPT_SUFFIX},${JAVASCRIPT_LIBRARY}) javascript_library_path = $(addprefix ${BUILD_DIR}/,${javascript_library_file}) GENERATED_FILES += ${javascript_library_path} COMPILED_JAVASCRIPT_SUFFIX = .min${JAVASCRIPT_SUFFIX} compiled_javascript_files = $(addsuffix ${COMPILED_JAVASCRIPT_SUFFIX},\ ${JAVASCRIPT_LIBRARY}) compiled_javascript_paths = $(addprefix ${BUILD_DIR}/,\ ${compiled_javascript_files}) GENERATED_FILES += ${compiled_javascript_paths} COFFEE = gulp coffee COFFEE_OPTS = CONCAT = gulp concat CONCAT_OPTS = JAVASCRIPT_MINIFY = uglifyjs JAVASCRIPT_MINIFY_OPTS = %: dh $@ .PHONY: override_dh_auto_build override_dh_auto_build: minify-javascript .PHONY: minify-javascript minify-javascript: ${compiled_javascript_paths} .PRECIOUS: ${javascript_library_path} ${javascript_library_path}: ${javascript_module_paths} $(CONCAT) ${CONCAT_OPTS} ${javascript_module_paths}: ${coffeescript_module_paths} $(COFFEE) ${COFFEE_OPTS} %${COMPILED_JAVASCRIPT_SUFFIX}: %${JAVASCRIPT_SUFFIX} $(JAVASCRIPT_MINIFY) ${JAVASCRIPT_MINIFY_OPTS} $< > $@ ${javascript_module_paths}: ${BUILD_JS_DIR} ${BUILD_JS_DIR}: mkdir --parents $@ .PHONY: override_dh_clean override_dh_clean: dh_clean $(RM) -r ${GENERATED_FILES} # Copyright © 2008–2022 Ben Finney # # This is free software: you may copy, modify, and/or distribute this work # under the terms of the GNU General Public License as published by the # Free Software Foundation; version 3 of that license or any later version. # No warranty expressed or implied. # See the file '/usr/share/common-licenses/GPL-3' for details. # Local variables: # coding: utf-8 # mode: makefile # End: # vim: fileencoding=utf-8 filetype=make :