2009-09-05 16:46:41 +00:00
|
|
|
NAME=svg-edit
|
2014-04-22 07:47:26 +00:00
|
|
|
VERSION=2.7.1
|
2009-09-05 16:46:41 +00:00
|
|
|
PACKAGE=$(NAME)-$(VERSION)
|
2010-03-28 13:59:52 +00:00
|
|
|
MAKEDOCS=naturaldocs/NaturalDocs
|
|
|
|
CLOSURE=build/tools/closure-compiler.jar
|
2009-09-05 16:46:41 +00:00
|
|
|
ZIP=zip
|
|
|
|
|
2011-01-17 22:11:35 +00:00
|
|
|
# All files that will be compiled by the Closure compiler.
|
2012-03-17 17:45:28 +00:00
|
|
|
|
2011-01-17 22:11:35 +00:00
|
|
|
JS_FILES=\
|
2013-02-16 15:02:26 +00:00
|
|
|
svgedit.js \
|
2013-02-20 15:34:42 +00:00
|
|
|
jquery-svg.js \
|
2012-03-17 17:45:28 +00:00
|
|
|
contextmenu/jquery.contextmenu.js \
|
2011-01-17 22:11:35 +00:00
|
|
|
browser.js \
|
|
|
|
svgtransformlist.js \
|
|
|
|
math.js \
|
|
|
|
units.js \
|
|
|
|
svgutils.js \
|
|
|
|
sanitize.js \
|
|
|
|
history.js \
|
2013-02-14 15:19:46 +00:00
|
|
|
coords.js \
|
2013-02-20 06:42:00 +00:00
|
|
|
recalculate.js \
|
2011-01-17 22:11:35 +00:00
|
|
|
select.js \
|
|
|
|
draw.js \
|
2011-02-04 16:06:25 +00:00
|
|
|
path.js \
|
2011-01-17 22:11:35 +00:00
|
|
|
svgcanvas.js \
|
|
|
|
svg-editor.js \
|
2014-04-07 04:08:52 +00:00
|
|
|
locale/locale.js \
|
|
|
|
contextmenu.js
|
2011-01-17 22:11:35 +00:00
|
|
|
|
|
|
|
JS_INPUT_FILES=$(addprefix editor/, $(JS_FILES))
|
|
|
|
JS_BUILD_FILES=$(addprefix build/$(PACKAGE)/, $(JS_FILES))
|
|
|
|
CLOSURE_JS_ARGS=$(addprefix --js , $(JS_INPUT_FILES))
|
|
|
|
COMPILED_JS=editor/svgedit.compiled.js
|
|
|
|
|
2009-09-05 16:46:41 +00:00
|
|
|
all: release firefox opera
|
|
|
|
|
2011-01-17 22:11:35 +00:00
|
|
|
# The build directory relies on the JS being compiled.
|
|
|
|
build/$(PACKAGE): $(COMPILED_JS)
|
2009-10-09 19:15:18 +00:00
|
|
|
rm -rf config
|
|
|
|
mkdir config
|
2010-03-28 13:59:52 +00:00
|
|
|
if [ -x $(MAKEDOCS) ] ; then $(MAKEDOCS) -i editor/ -o html docs/ -p config/ -oft -r ; fi
|
2011-01-17 22:11:35 +00:00
|
|
|
|
|
|
|
# Make build directory and copy all editor contents into it
|
2009-09-05 16:46:41 +00:00
|
|
|
mkdir -p build/$(PACKAGE)
|
2009-09-05 18:52:39 +00:00
|
|
|
cp -r editor/* build/$(PACKAGE)
|
2011-01-17 22:11:35 +00:00
|
|
|
|
|
|
|
# Remove all hidden .svn directories
|
|
|
|
-find build/$(PACKAGE) -name .svn -type d | xargs rm -rf {} \;
|
|
|
|
|
2011-01-18 06:13:40 +00:00
|
|
|
# Create the release version of the main HTML file.
|
|
|
|
build/tools/ship.py --i=editor/svg-editor.html --on=svg_edit_release > build/$(PACKAGE)/svg-editor.html
|
2010-10-28 16:47:39 +00:00
|
|
|
|
2011-01-18 06:46:45 +00:00
|
|
|
# NOTE: Some files are not ready for the Closure compiler: (jquery)
|
2011-02-09 06:14:47 +00:00
|
|
|
# NOTE: Our code safely compiles under SIMPLE_OPTIMIZATIONS
|
2011-01-18 06:46:45 +00:00
|
|
|
# NOTE: Our code is *not* ready for ADVANCED_OPTIMIZATIONS
|
2011-02-09 06:14:47 +00:00
|
|
|
# NOTE: WHITESPACE_ONLY and --formatting PRETTY_PRINT is helpful for debugging.
|
2011-01-17 22:11:35 +00:00
|
|
|
$(COMPILED_JS):
|
2010-10-29 05:23:25 +00:00
|
|
|
java -jar $(CLOSURE) \
|
2011-01-18 06:46:45 +00:00
|
|
|
--compilation_level SIMPLE_OPTIMIZATIONS \
|
2011-01-17 22:11:35 +00:00
|
|
|
$(CLOSURE_JS_ARGS) \
|
|
|
|
--js_output_file $(COMPILED_JS)
|
2009-09-05 16:46:41 +00:00
|
|
|
|
2012-03-17 17:45:28 +00:00
|
|
|
compile: $(COMPILED_JS)
|
|
|
|
|
2009-09-05 16:46:41 +00:00
|
|
|
release: build/$(PACKAGE)
|
2009-09-05 18:36:44 +00:00
|
|
|
cd build ; $(ZIP) $(PACKAGE).zip -r $(PACKAGE) ; cd ..
|
2010-09-09 16:36:17 +00:00
|
|
|
tar -z -c -f build/$(PACKAGE)-src.tar.gz \
|
2011-01-17 22:11:35 +00:00
|
|
|
--exclude='\.svn' \
|
2010-09-09 16:36:17 +00:00
|
|
|
--exclude='build/*' \
|
|
|
|
.
|
2009-09-05 16:46:41 +00:00
|
|
|
|
|
|
|
firefox: build/$(PACKAGE)
|
2009-09-05 18:46:53 +00:00
|
|
|
mkdir -p build/firefox/content/editor
|
2009-09-05 18:52:39 +00:00
|
|
|
cp -r firefox-extension/* build/firefox
|
2009-09-05 18:46:53 +00:00
|
|
|
rm -rf build/firefox/content/.svn
|
2009-09-05 18:52:39 +00:00
|
|
|
cp -r build/$(PACKAGE)/* build/firefox/content/editor
|
2011-02-11 16:25:04 +00:00
|
|
|
rm -f build/firefox/content/editor/embedapi.js
|
2009-09-05 18:36:44 +00:00
|
|
|
cd build/firefox ; $(ZIP) ../$(PACKAGE).xpi -r * ; cd ../..
|
2009-09-05 16:46:41 +00:00
|
|
|
|
|
|
|
opera: build/$(PACKAGE)
|
|
|
|
mkdir -p build/opera/editor
|
2009-09-05 18:52:39 +00:00
|
|
|
cp opera-widget/* build/opera
|
|
|
|
cp -r build/$(PACKAGE)/* build/opera/editor
|
2009-09-05 18:36:44 +00:00
|
|
|
cd build/opera ; $(ZIP) ../$(PACKAGE).wgt -r * ; cd ../..
|
2009-09-05 16:46:41 +00:00
|
|
|
|
2011-06-01 12:53:49 +00:00
|
|
|
chrome:
|
|
|
|
mkdir -p build/svgedit_app
|
|
|
|
cp -a chrome-app/* build/svgedit_app
|
|
|
|
cd build ; $(ZIP) -r $(PACKAGE)-crx.zip svgedit_app ; rm -rf svgedit_app; cd ..
|
|
|
|
|
2013-02-23 21:32:09 +00:00
|
|
|
jgraduate:
|
|
|
|
java -jar $(CLOSURE) --js editor/jgraduate/jquery.jgraduate.js --js_output_file editor/jgraduate/jquery.jgraduate.min.js
|
2009-09-05 16:46:41 +00:00
|
|
|
clean:
|
2009-10-09 19:15:18 +00:00
|
|
|
rm -rf config
|
2009-09-05 16:46:41 +00:00
|
|
|
rm -rf build/$(PACKAGE)
|
|
|
|
rm -rf build/firefox
|
|
|
|
rm -rf build/opera
|
2011-01-18 06:13:40 +00:00
|
|
|
rm -rf build/$(PACKAGE).zip
|
|
|
|
rm -rf build/$(PACKAGE)-src.tar.gz
|
|
|
|
rm -rf build/$(PACKAGE).xpi
|
|
|
|
rm -rf build/$(PACKAGE).wgt
|
2011-01-17 22:11:35 +00:00
|
|
|
rm -rf $(COMPILED_JS)
|