-
Notifications
You must be signed in to change notification settings - Fork 103
/
Makefile
43 lines (34 loc) · 975 Bytes
/
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
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.mjs
UMD_FILE := $(BUILD_DIR)/quantities.js
DIST_FILES := $(ESM_FILE) $(UMD_FILE)
BANNER := $(shell cat LICENSE)
ROLLUP := npx rollup
JASMINE := npx jasmine
ESLINT := npx 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 \
--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