forked from gentooboontoo/js-quantities
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
45 lines (36 loc) · 1.03 KB
/
Makefile
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
SPEC_DIR := spec
SPECFILES := $(shell find $(SPEC_DIR) -iname '*.js')
SOURCE_DIR := src
SOURCES := $(shell find $(SOURCE_DIR) -iname '*.js')
LINTEDFILES := $(SOURCES) $(SPECFILES)
BUILD_DIR := build
ESM_FILE := $(BUILD_DIR)/quantities.esm.js
UMD_FILE := $(BUILD_DIR)/quantities.js
DIST_FILES := $(ESM_FILE) $(UMD_FILE)
BANNER := $(shell cat LICENSE)
NPM_BIN := $(shell npm bin)
ROLLUP := $(NPM_BIN)/rollup
JASMINE := $(NPM_BIN)/jasmine
ESLINT := $(NPM_BIN)/eslint
build: $(DIST_FILES)
$(UMD_FILE): $(SOURCES)
$(ROLLUP) --file=$(UMD_FILE) \
--format=umd \
--name=Qty \
--banner="`echo '/*'; cat LICENSE; echo '*/'`" \
src/quantities.js
$(ESM_FILE): $(SOURCES)
$(ROLLUP) --file=$(ESM_FILE) \
--format=es \
--name=Qty \
--banner="`echo '/*'; cat LICENSE; echo '*/'`" \
src/quantities.js
test: lint build
$(JASMINE)
lint: $(LINTEDFILES)
$(ESLINT) $(LINTEDFILES)
bench:
bin/bench.rb
clean:
rm -f $(DIST_FILES)
.PHONY: bench build clean lint test