Skip to content

Commit 94d54c7

Browse files
committed
Fix extension module build
1 parent 1194fa0 commit 94d54c7

File tree

1 file changed

+21
-29
lines changed

1 file changed

+21
-29
lines changed

Makefile

Lines changed: 21 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,33 @@ ifeq ($(shell which $(BROWSERIFY) >/dev/null 2>&1; echo $$?), 1)
66
$(error The 'browserify' command was not found. Please ensure you have run 'npm install' before running make.)
77
endif
88

9-
# These are the plugins which are built separately and included in the
10-
# annotator-full build. Not all of the plugins in src/plugin are suited for this
11-
# at the moment.
12-
PLUGINS := \
9+
# These are the annotator.ext modules which are built from this repository.
10+
EXT := \
1311
document \
14-
filter \
1512
unsupported
16-
PLUGINS_PKG := $(patsubst %,pkg/annotator.%.js,$(PLUGINS))
1713

1814
SRC := $(shell find src -type f -name '*.js')
1915

20-
all: annotator plugins annotator-full
16+
all: annotator exts
2117

2218
annotator: pkg/annotator.min.js
23-
plugins: $(patsubst %.js,%.min.js,$(PLUGINS_PKG))
24-
annotator-full: pkg/annotator-full.min.js
19+
exts: $(patsubst %,pkg/annotator.%.min.js,$(EXT))
20+
21+
pkg/%.min.js: pkg/%.js
22+
@echo Writing $@
23+
@$(UGLIFYJS) --preamble "$$(tools/preamble)" $< >$@
24+
25+
pkg/annotator.js: browser.js
26+
@mkdir -p pkg/ .deps/
27+
@$(BROWSERIFY) -s annotator $< >$@
28+
@$(BROWSERIFY) --list $< | \
29+
sed 's#^#$@: #' >.deps/annotator.d
30+
31+
pkg/annotator.%.js: src/ext/%.js
32+
@mkdir -p pkg/ .deps/
33+
@$(BROWSERIFY) $< >$@
34+
@$(BROWSERIFY) --list $< | \
35+
sed 's#^#$@: #' >.deps/annotator.$*.d
2536

2637
clean:
2738
rm -rf .deps pkg
@@ -41,25 +52,6 @@ doc/api/%.rst: src/%.js
4152
@mkdir -p $(@D)
4253
tools/apidoc $< $@
4354

44-
pkg/%.min.js: pkg/%.js
45-
@echo Writing $@
46-
@$(UGLIFYJS) --preamble "$$(tools/preamble)" $< >$@
47-
48-
pkg/annotator.js: browser.js
49-
@mkdir -p pkg/ .deps/
50-
@$(BROWSERIFY) -s annotator $< >$@
51-
@$(BROWSERIFY) --list $< | \
52-
sed 's#^#$@: #' >.deps/annotator.d
53-
54-
pkg/annotator.%.js: src/plugin/%.js
55-
@mkdir -p pkg/ .deps/
56-
@$(BROWSERIFY) $< >$@
57-
@$(BROWSERIFY) --list $< | \
58-
sed 's#^#$@: #' >.deps/annotator.$*.d
59-
60-
pkg/annotator-full.js: pkg/annotator.js $(PLUGINS_PKG)
61-
@cat $^ > $@
62-
6355
-include .deps/*.d
6456

65-
.PHONY: all annotator plugins annotator-full clean test develop doc
57+
.PHONY: all annotator exts clean test develop doc

0 commit comments

Comments
 (0)