-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
72 lines (53 loc) · 1.58 KB
/
Makefile
File metadata and controls
72 lines (53 loc) · 1.58 KB
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
# customization
PACKAGE_NAME = icybee/module-nodes
PACKAGE_VERSION = 3.0
COMPOSER_ENV = COMPOSER_ROOT_VERSION=$(PACKAGE_VERSION)
# assets
JS_FILES = \
lib/AdjustNode.js \
lib/PopNode.js \
lib/TitleSlugCombo.js
CSS_FILES = $(shell find ./lib -name *.scss)
JS_COMPRESSOR = `which uglifyjs` $^ \
--compress \
--mangle \
--screw-ie8 \
--source-map $@.map
#JS_COMPRESSOR = cat $^ # uncomment to produce uncompressed files
JS_COMPRESSED = public/module.js
JS_UNCOMPRESSED = public/module-uncompressed.js
CSS_COMPILER = `which sass`
CSS_COMPILER_OPTIONS = --style compressed # comment to disable compression
CSS_COMPRESSED = public/module.css
all: $(JS_COMPRESSED) $(JS_UNCOMPRESSED) $(CSS_COMPRESSED) $(CSS_UNCOMPRESSED)
$(JS_COMPRESSED): $(JS_UNCOMPRESSED)
$(JS_COMPRESSOR) >$@
$(JS_UNCOMPRESSED): $(JS_FILES)
cat $^ >$@
$(CSS_COMPRESSED): $(CSS_FILES)
$(CSS_COMPILER) $(CSS_COMPILER_OPTIONS) lib/module.scss:$@
# do not edit the following lines
usage:
@echo "test: Runs the test suite.\ndoc: Creates the documentation.\nclean: Removes the documentation, the dependencies and the Composer files."
vendor:
@$(COMPOSER_ENV) composer install
update:
@$(COMPOSER_ENV) composer update
autoload: vendor
@$(COMPOSER_ENV) composer dump-autoload
test: vendor
@phpunit
test-coverage: vendor
@mkdir -p build/coverage
@phpunit --coverage-html build/coverage
doc: vendor
@mkdir -p build/docs
@apigen generate \
--source lib \
--destination build/docs/ \
--title "$(PACKAGE_NAME) v$(PACKAGE_VERSION)" \
--template-theme "bootstrap"
clean:
@rm -fR build
@rm -fR vendor
@rm -f composer.lock