-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
47 lines (38 loc) · 1.12 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
46
47
export SHELL := /bin/bash
export PATH := $(CURDIR)/node_modules/.bin:$(PATH)
SOURCES := $(wildcard src/*)
VERSION := $(shell node -pe "require('./package.json').version")
OK := \033[32;01m✓\033[0m
PACKAGE := cached-iterable
GLOBAL := CachedIterable
# The default target.
all: lint test build
lint:
@eslint --config $(CURDIR)/eslint_src.json --max-warnings 0 src/
@eslint --config $(CURDIR)/eslint_test.json --max-warnings 0 test/
@echo -e " $(OK) $@"
.PHONY: test
test:
@mocha --recursive --ui tdd \
--require mocha_config \
test/**/*_test.js
build: index.js compat.js
index.js: $(SOURCES)
@rollup $(CURDIR)/src/index.mjs \
--config $(CURDIR)/bundle_config.js \
--banner "/* $(PACKAGE)@$(VERSION) */" \
--amd.id $(PACKAGE) \
--name $(GLOBAL) \
--output.file $@
@echo -e " $(OK) $@ built"
compat.js: $(SOURCES)
@rollup $(CURDIR)/src/index.mjs \
--config $(CURDIR)/compat_config.js \
--banner "/* $(PACKAGE)@$(VERSION) */" \
--amd.id $(PACKAGE) \
--name $(GLOBAL) \
--output.file $@
@echo -e " $(OK) $@ built"
clean:
@rm -f index.js compat.js
@echo -e " $(OK) clean"