@@ -3,8 +3,9 @@ BUILD_DIR := build
3
3
DEFAULT_BROWSERS := resources/browser_manifests/browser_manifest.json
4
4
DEFAULT_TESTS := test_manifest.json
5
5
6
- EXTENSION_SRC := ./extensions/firefox
7
- EXTENSION_NAME := pdf.js.xpi
6
+ EXTENSION_SRC := ./extensions/
7
+ FIREFOX_EXTENSION_NAME := pdf.js.xpi
8
+ CHROME_EXTENSION_NAME := pdf.js.crx
8
9
9
10
# Let folks define custom rules for their clones.
10
11
-include local.mk
@@ -17,6 +18,7 @@ PDF_JS_FILES = \
17
18
fonts.js \
18
19
metrics.js \
19
20
charsets.js \
21
+ cidmaps.js \
20
22
glyphlist.js \
21
23
$(NULL )
22
24
@@ -92,7 +94,7 @@ browser-test:
92
94
#
93
95
# <http://code.google.com/closure/utilities/docs/linter_howto.html>
94
96
SRC_DIRS := . utils worker web test examples/helloworld extensions/firefox \
95
- extensions/firefox/components
97
+ extensions/firefox/components extensions/chrome
96
98
GJSLINT_FILES = $(foreach DIR,$(SRC_DIRS ) ,$(wildcard $(DIR ) /* .js) )
97
99
lint :
98
100
gjslint $(GJSLINT_FILES )
@@ -110,7 +112,8 @@ web: | extension compiler pages-repo \
110
112
$(addprefix $(GH_PAGES ) /, $(PDF_JS_FILES ) ) \
111
113
$(addprefix $(GH_PAGES ) /, $(wildcard web/* .* ) ) \
112
114
$(addprefix $(GH_PAGES ) /, $(wildcard web/images/* .* ) ) \
113
- $(addprefix $(GH_PAGES ) /, $(wildcard $(EXTENSION_SRC ) /* .xpi) )
115
+ $(addprefix $(GH_PAGES ) /, $(wildcard $(EXTENSION_SRC ) /firefox/* .xpi) ) \
116
+ $(addprefix $(GH_PAGES ) /, $(wildcard $(EXTENSION_SRC ) /chrome/* .crx) )
114
117
115
118
@cp $(GH_PAGES)/web/index.html.template $(GH_PAGES)/index.html;
116
119
@cd $(GH_PAGES); git add -A;
@@ -132,7 +135,8 @@ pages-repo: | $(BUILD_DIR)
132
135
fi ;
133
136
@mkdir -p $(GH_PAGES ) /web;
134
137
@mkdir -p $(GH_PAGES ) /web/images;
135
- @mkdir -p $(GH_PAGES ) /$(EXTENSION_SRC ) ;
138
+ @mkdir -p $(GH_PAGES ) /$(EXTENSION_SRC ) /firefox;
139
+ @mkdir -p $(GH_PAGES ) /$(EXTENSION_SRC ) /chrome;
136
140
137
141
$(GH_PAGES ) /% .js : % .js
138
142
@cp $< $@
@@ -143,9 +147,11 @@ $(GH_PAGES)/web/%: web/%
143
147
$(GH_PAGES ) /web/images/% : web/images/%
144
148
@cp $< $@
145
149
146
- $(GH_PAGES ) /$(EXTENSION_SRC ) /% : $(EXTENSION_SRC ) /%
150
+ $(GH_PAGES ) /$(EXTENSION_SRC ) /firefox/ % : $(EXTENSION_SRC ) /firefox /%
147
151
@cp -R $< $@
148
152
153
+ $(GH_PAGES ) /$(EXTENSION_SRC ) /chrome/% : $(EXTENSION_SRC ) /chrome/%
154
+
149
155
# # make compiler
150
156
# #
151
157
# # This target downloads the Closure compiler, and places it in the
@@ -163,7 +169,7 @@ $(GH_PAGES)/$(EXTENSION_SRC)/%: $(EXTENSION_SRC)/%
163
169
#
164
170
# This target produce a restartless firefox extension containing a
165
171
# copy of the pdf.js source.
166
- CONTENT_DIR := content
172
+ CONTENT_DIR := firefox/ content
167
173
PDF_WEB_FILES = \
168
174
web/images \
169
175
web/compatibility.js \
@@ -179,8 +185,17 @@ extension:
179
185
@cp -r $(PDF_WEB_FILES ) $(EXTENSION_SRC ) /$(CONTENT_DIR ) /web/
180
186
181
187
# Create the xpi
182
- @cd $(EXTENSION_SRC); zip -r $(EXTENSION_NAME) *
183
- @echo "extension created: " $(EXTENSION_NAME)
188
+ @cd $(EXTENSION_SRC)/firefox; zip -r $(FIREFOX_EXTENSION_NAME) *
189
+ @echo "extension created: " $(FIREFOX_EXTENSION_NAME)
190
+
191
+ # Copy a standalone version of pdf.js inside the extension directory
192
+ @cp $(PDF_JS_FILES) $(EXTENSION_SRC)/chrome/
193
+ @mkdir -p $(EXTENSION_SRC)/chrome/web
194
+ @cp -r $(PDF_WEB_FILES) $(EXTENSION_SRC)/chrome/web/
195
+
196
+ # Create the crx
197
+ # TODO
198
+
184
199
185
200
186
201
# Make sure there's a build directory.
0 commit comments