REPO = git@github.com:andreasgal/pdf.js.git
BUILD_DIR := build
-PDFJS_TARGET := $(BUILD_DIR)/pdf.js
+BUILD_TARGET := $(BUILD_DIR)/pdf.js
DEFAULT_BROWSERS := resources/browser_manifests/browser_manifest.json
DEFAULT_TESTS := test_manifest.json
EXTENSION_SRC := ./extensions/firefox
EXTENSION_NAME := pdf.js.xpi
+all: bundle
+
# Let folks define custom rules for their clones.
-include local.mk
# Create production output (pdf.js, and corresponding changes to web files)
#
production: | bundle
- @echo "Preparing viewer-production.html..."; \
+ @echo "Preparing web/viewer-production.html"; \
cd web; \
sed '/PDFJSSCRIPT_REMOVE/d' viewer.html > viewer-1.tmp; \
sed '/PDFJSSCRIPT_INCLUDE_BUILD/ r viewer-snippet.html' viewer-1.tmp > viewer-production.html; \
#
# Bundle pdf.js
#
-bundle:
- @echo "Bundling source files into pdf.js..."
- @mkdir -p $(BUILD_DIR)
+bundle: | $(BUILD_DIR)
+ @echo "Bundling source files into $(BUILD_TARGET)"
@cd src; \
cat $(PDF_JS_FILES) > all_files.tmp; \
- sed '/PDFJSSCRIPT_INCLUDE_ALL/ r all_files.tmp' pdf.js > ../$(PDFJS_TARGET); \
+ sed '/PDFJSSCRIPT_INCLUDE_ALL/ r all_files.tmp' pdf.js > ../$(BUILD_TARGET); \
rm -f *.tmp; \
cd ..
#
GH_PAGES = $(BUILD_DIR)/gh-pages
web: | production extension compiler pages-repo \
- $(addprefix $(GH_PAGES)/, $(PDFJS_TARGET)) \
+ $(addprefix $(GH_PAGES)/, $(BUILD_TARGET)) \
$(addprefix $(GH_PAGES)/, $(wildcard web/*.*)) \
$(addprefix $(GH_PAGES)/, $(wildcard web/images/*.*)) \
$(addprefix $(GH_PAGES)/, $(wildcard $(EXTENSION_SRC)/*.xpi))
@rm -Rf $(EXTENSION_SRC)/$(CONTENT_DIR)/
@mkdir -p $(EXTENSION_SRC)/$(CONTENT_DIR)/$(BUILD_DIR)
@mkdir -p $(EXTENSION_SRC)/$(CONTENT_DIR)/web
- @cp $(PDFJS_TARGET) $(EXTENSION_SRC)/$(CONTENT_DIR)/$(BUILD_DIR)
+ @cp $(BUILD_TARGET) $(EXTENSION_SRC)/$(CONTENT_DIR)/$(BUILD_DIR)
@cp -r $(PDF_WEB_FILES) $(EXTENSION_SRC)/$(CONTENT_DIR)/web/
@mv -f $(EXTENSION_SRC)/$(CONTENT_DIR)/web/viewer-production.html $(EXTENSION_SRC)/$(CONTENT_DIR)/web/viewer.html
help:
@echo "Read the comments in the Makefile for guidance.";
-.PHONY:: production watch test browser-test font-test shell-test \
+.PHONY:: production test browser-test font-test shell-test \
shell-msg lint clean web compiler help server
In order to bundle all `src/` files into a final `pdf.js`, issue:
- $ make bundle
+ $ make
This will generate the file `build/pdf.js` that can be included in your final project. (WARNING: That's a large file! Consider minifying it).
+
## Learning
Here are some initial pointers to help contributors get off the ground.
Additional resources are available in a separate section below.
-#### Introductory video
-
-Check out the presentation by our contributor Julian Viereck on the inner
-workings of PDF and pdf.js:
-
-+ http://www.youtube.com/watch?v=Iv15UY-4Fg8
-
#### Hello world
For a "hello world" example, take a look at:
This example illustrates the bare minimum ingredients for integrating pdf.js
in a custom project.
+#### Introductory video
+
+Check out the presentation by our contributor Julian Viereck on the inner
+workings of PDF and pdf.js:
+
++ http://www.youtube.com/watch?v=Iv15UY-4Fg8
+
+
## Contributing