-
Notifications
You must be signed in to change notification settings - Fork 472
Expand file tree
/
Copy pathMakefile
More file actions
42 lines (30 loc) · 1.05 KB
/
Makefile
File metadata and controls
42 lines (30 loc) · 1.05 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
RABBITMQ_SRC_VERSION=v3.12.13
JSON=amqp-rabbitmq-0.9.1.json
AMQP_JSON=https://raw.githubusercontent.com/rabbitmq/rabbitmq-server/$(RABBITMQ_SRC_VERSION)/deps/rabbitmq_codegen/$(JSON)
NODEJS_VERSIONS='18.1.0' '20.10.0' '22.14.0' '24.7.0'
UGLIFY=./node_modules/.bin/uglifyjs
.PHONY: test test-all-nodejs coverage lib/defs.js
error:
@echo "Please choose one of the following targets: test, test-all-nodejs, coverage, lib/defs.js"
@exit 1
test:
node --test
test-all-nodejs:
for v in $(NODEJS_VERSIONS); \
do echo "-- Node version $$v --"; \
nave use $$v node --test; \
done
coverage:
node --test --test-coverage
lib/defs.js: clean bin/generate-defs test
clean:
rm -f lib/defs.js bin/amqp-rabbitmq-0.9.1.json
bin/generate-defs: $(UGLIFY) bin/generate-defs.js bin/amqp-rabbitmq-0.9.1.json
(cd bin; node ./generate-defs.js > ../lib/defs.js)
$(UGLIFY) ./lib/defs.js -o ./lib/defs.js \
-c 'sequences=false' --comments \
-b 'indent-level=2' 2>&1 | (grep -v 'WARN' || true)
bin/amqp-rabbitmq-0.9.1.json:
curl -L $(AMQP_JSON) > $@
$(UGLIFY):
npm install