-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
58 lines (44 loc) · 1.24 KB
/
Makefile
File metadata and controls
58 lines (44 loc) · 1.24 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
#!/bin/bash
DIST_DIR = ./build
#JS_LIB = lib/*.js
JS_SRC = ${JS_LIB} src/*.js
JS_FILE_BASE = htmlTT
JS_FILE = ${JS_FILE_BASE}.dev.js
JS_FILE_MIN = ${JS_FILE_BASE}.js
JS_DIST_FILE = ${DIST_DIR}/${JS_FILE}
JS_DIST_FILE_MIN = ${DIST_DIR}/${JS_FILE_MIN}
#CSS_LIB = lib/*.css
CSS_SRC = ${CSS_LIB} src/*.css
CSS_FILE = htmlTT.css
CSS_DIST_FILE = ${DIST_DIR}/${CSS_FILE}
#TEST_DIR = ./test
#add more test files
#TEST_FILES = ${TEST_DIR}/test-main.js
#target: all - clean, build/minify and lint
all: clean min lint
#target: dist - build
dist: ${JS_SRC}
@cat ${JS_SRC} > ${JS_DIST_FILE}
@cat ${CSS_SRC} > ${CSS_DIST_FILE};
@echo 'target:' $@', building from:' ${JS_SRC}
#target: min - minify built file
min: dist
@uglifyjs ${JS_DIST_FILE} > ${JS_DIST_FILE_MIN}
@echo 'target:' $@', using uglifyjs'
#target: lint - run eslint tests
lint: dist
@eslint --config .eslintrc ${JS_DIST_FILE}
@echo 'target:' $@', using eslint'
##target: dist - build from src
#test: dist
# @node ${TEST_FILES}
# @echo 'target:' $@', using node and buster.js'
#target: clean - remove built files
clean:
@rm -f ${DIST_DIR}/*.js
@rm -f ${DIST_DIR}/*.css
@echo 'target:' $@
#target: help - show available targets
help:
@echo 'Available targets:'
@egrep "^#target:" [Mm]akefile