File: rules

package info (click to toggle)
jquery-at.js 1.5.4%2Bdfsg.1-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 312 kB
  • sloc: makefile: 72
file content (125 lines) | stat: -rwxr-xr-x 3,635 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
#! /usr/bin/make -f
#
# debian/rules
# Part of Debian ‘jquery-at.js’ package.
#
# Copyright © 2008–2018 Ben Finney <bignose@debian.org>
#
# 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 later.
# No warranty expressed or implied.
# See the file '/usr/share/common-licenses/GPL-3' for details.

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: get-packaged-orig-source
get-packaged-orig-source:
	$(uscan-download-source) --download-current-version

# Policy §4.9 strongly recommends the ‘get-orig-source’ target:
# “This target is optional, but providing it if possible is a good idea.”
#
# This target is an anomaly: per Policy §4.9, it fetches the *latest*
# upstream source, regardless of this package's version. To fetch the
# upstream source corresponding to this package's *declared* version
# in ‘debian/changelog’, use ‘get-packaged-orig-source’ instead.
.PHONY: get-orig-source
get-orig-source:
	$(uscan-download-source)

get-orig-source get-packaged-orig-source: http_proxy =
get-orig-source get-packaged-orig-source: makefile_dir = $(abspath $(dir $(firstword ${MAKEFILE_LIST})))
get-orig-source get-packaged-orig-source: package_dir = $(abspath $(dir ${makefile_dir}))

define uscan-download-source
	uscan --noconf --verbose \
	    --force-download \
	    --rename \
	    --destdir=$(CURDIR) \
	    --check-dirname-level=0 ${package_dir}
endef # uscan-download-source


.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}


# Local variables:
# coding: utf-8
# mode: makefile
# End:
# vim: fileencoding=utf-8 filetype=make :