| 1 |
#! /usr/bin/make -f |
| 2 |
# |
| 3 |
# debian/rules |
| 4 |
# Part of Debian ‘jquery-at.js’ package. |
| 5 |
# |
| 6 |
# This is free software, and you are welcome to redistribute it under |
| 7 |
# certain conditions; see the end of this file for copyright |
| 8 |
# information, grant of license, and disclaimer of warranty. |
| 9 |
|
| 10 |
JAVASCRIPT_MODULES = \ |
| 11 |
default \ |
| 12 |
app \ |
| 13 |
controller \ |
| 14 |
textareaController \ |
| 15 |
editableController \ |
| 16 |
model \ |
| 17 |
view \ |
| 18 |
api |
| 19 |
|
| 20 |
JAVASCRIPT_LIBRARY = \ |
| 21 |
jquery.atwho |
| 22 |
|
| 23 |
SOURCE_DIR = $(CURDIR)/src |
| 24 |
BUILD_DIR = $(CURDIR)/build |
| 25 |
BUILD_JS_DIR = ${BUILD_DIR}/js |
| 26 |
|
| 27 |
COFFEESCRIPT_SUFFIX = .coffee |
| 28 |
coffeescript_module_files = $(addsuffix ${COFFEESCRIPT_SUFFIX},${JAVASCRIPT_MODULES}) |
| 29 |
coffeescript_module_paths = $(addprefix ${SOURCE_DIR}/,${coffeescript_module_files}) |
| 30 |
|
| 31 |
JAVASCRIPT_SUFFIX = .js |
| 32 |
javascript_module_files = $(addsuffix ${JAVASCRIPT_SUFFIX},${JAVASCRIPT_MODULES}) |
| 33 |
javascript_module_paths = $(addprefix ${BUILD_JS_DIR}/,${javascript_module_files}) |
| 34 |
GENERATED_FILES += ${javascript_module_paths} |
| 35 |
|
| 36 |
javascript_library_file = $(addsuffix ${JAVASCRIPT_SUFFIX},${JAVASCRIPT_LIBRARY}) |
| 37 |
javascript_library_path = $(addprefix ${BUILD_DIR}/,${javascript_library_file}) |
| 38 |
GENERATED_FILES += ${javascript_library_path} |
| 39 |
|
| 40 |
COMPILED_JAVASCRIPT_SUFFIX = .min${JAVASCRIPT_SUFFIX} |
| 41 |
compiled_javascript_files = $(addsuffix ${COMPILED_JAVASCRIPT_SUFFIX},\ |
| 42 |
${JAVASCRIPT_LIBRARY}) |
| 43 |
compiled_javascript_paths = $(addprefix ${BUILD_DIR}/,\ |
| 44 |
${compiled_javascript_files}) |
| 45 |
GENERATED_FILES += ${compiled_javascript_paths} |
| 46 |
|
| 47 |
COFFEE = gulp coffee |
| 48 |
COFFEE_OPTS = |
| 49 |
|
| 50 |
CONCAT = gulp concat |
| 51 |
CONCAT_OPTS = |
| 52 |
|
| 53 |
JAVASCRIPT_MINIFY = uglifyjs |
| 54 |
JAVASCRIPT_MINIFY_OPTS = |
| 55 |
|
| 56 |
|
| 57 |
%: |
| 58 |
dh $@ |
| 59 |
|
| 60 |
|
| 61 |
.PHONY: override_dh_auto_build |
| 62 |
override_dh_auto_build: minify-javascript |
| 63 |
|
| 64 |
.PHONY: minify-javascript |
| 65 |
minify-javascript: ${compiled_javascript_paths} |
| 66 |
|
| 67 |
.PRECIOUS: ${javascript_library_path} |
| 68 |
|
| 69 |
${javascript_library_path}: ${javascript_module_paths} |
| 70 |
$(CONCAT) ${CONCAT_OPTS} |
| 71 |
|
| 72 |
${javascript_module_paths}: ${coffeescript_module_paths} |
| 73 |
$(COFFEE) ${COFFEE_OPTS} |
| 74 |
|
| 75 |
%${COMPILED_JAVASCRIPT_SUFFIX}: %${JAVASCRIPT_SUFFIX} |
| 76 |
$(JAVASCRIPT_MINIFY) ${JAVASCRIPT_MINIFY_OPTS} $< > $@ |
| 77 |
|
| 78 |
${javascript_module_paths}: ${BUILD_JS_DIR} |
| 79 |
|
| 80 |
${BUILD_JS_DIR}: |
| 81 |
mkdir --parents $@ |
| 82 |
|
| 83 |
.PHONY: override_dh_clean |
| 84 |
override_dh_clean: |
| 85 |
dh_clean |
| 86 |
$(RM) -r ${GENERATED_FILES} |
| 87 |
|
| 88 |
|
| 89 |
# Copyright © 2008–2022 Ben Finney <[email protected]> |
| 90 |
# |
| 91 |
# This is free software: you may copy, modify, and/or distribute this work |
| 92 |
# under the terms of the GNU General Public License as published by the |
| 93 |
# Free Software Foundation; version 3 of that license or any later version. |
| 94 |
# No warranty expressed or implied. |
| 95 |
# See the file '/usr/share/common-licenses/GPL-3' for details. |
| 96 |
|
| 97 |
|
| 98 |
# Local variables: |
| 99 |
# coding: utf-8 |
| 100 |
# mode: makefile |
| 101 |
# End: |
| 102 |
# vim: fileencoding=utf-8 filetype=make : |