2015-05-19 06:29:55 -05:00
2019-03-15 11:27:27 -05:00
L10N_PO = $(wildcard $(srcdir)/po/*.po)
if !ENABLE_MOBILEAPP
L10N_JSON = $(patsubst $(srcdir)/po/%.po,$(builddir)/dist/l10n/%.json,$(L10N_PO))
endif
2018-11-09 14:28:46 -06:00
if ENABLE_IOSAPP
L10N_IOS_ALL_JS = $(builddir)/dist/l10n-all.js
2019-03-15 11:23:28 -05:00
L10N_JSON = $(L10N_IOS_ALL_JS)
2018-11-09 14:28:46 -06:00
$(L10N_IOS_ALL_JS) : $(wildcard $(srcdir)/po/ui-*.po) $(shell find $(srcdir)/l10n -name '*.*')
for F in $(wildcard $(srcdir)/po/ui-*.po); do \
$(srcdir)/util/po2json.py $$F -o $$F.json; \
done
@mkdir -p $(dir $@)
perl $(srcdir)/util/create-l10n-all-js.pl >$@
for F in $(wildcard $(srcdir)/po/ui-*.po); do \
rm $$F.json; \
done
endif
2017-05-05 04:18:26 -05:00
2019-01-10 05:34:43 -06:00
JQUERY_LIGHTNESS_IMAGE_PATH = node_modules/jquery-ui/themes/ui-lightness/images
JQUERY_LIGHTNESS_IMAGES = $(wildcard $(JQUERY_LIGHTNESS_IMAGE_PATH)/*.png)
JQUERY_LIGHTNESS_DIST_IMAGES = $(patsubst $(JQUERY_LIGHTNESS_IMAGE_PATH)/%.png,$(builddir)/dist/images/%.png,$(JQUERY_LIGHTNESS_IMAGES))
JQUERY_MINIFIED_IMAGE_PATH = node_modules/jquery-ui/themes/base/minified/images
JQUERY_MINIFIED_IMAGES = $(wildcard $(JQUERY_MINIFIED_IMAGE_PATH)/*.png)
JQUERY_MINIFIED_DIST_IMAGES = $(patsubst $(JQUERY_MINIFIED_IMAGE_PATH)/%.png,$(builddir)/dist/images/%.png,$(JQUERY_MINIFIED_IMAGES))
2018-04-12 14:57:00 -05:00
2018-05-24 13:44:04 -05:00
LOLEAFLET_IMAGES_SRC = $(shell find $(srcdir)/images -name '*.*')
2018-04-12 14:57:00 -05:00
LOLEAFLET_IMAGES_DST = $(patsubst $(srcdir)/%,$(builddir)/dist/%,$(LOLEAFLET_IMAGES_SRC))
2019-06-21 03:43:53 -05:00
LOLEAFLET_IMAGES_CUSTOM_SRC = $(shell find $(CUSTOM_ICONS_DIRECTORY) -name '*.*')
LOLEAFLET_IMAGES_CUSTOM_DST = $(patsubst $(CUSTOM_ICONS_DIRECTORY)/%,$(builddir)/dist/images/%,$(LOLEAFLET_IMAGES_CUSTOM_SRC))
2018-04-12 14:57:00 -05:00
2019-03-15 11:25:41 -05:00
LOLEAFLET_L10N_SRC = $(shell find $(srcdir)/l10n -name '*.*')
if !ENABLE_IOSAPP
LOLEAFLET_L10N_DST = $(patsubst $(srcdir)/l10n/%,$(builddir)/dist/l10n/%,$(LOLEAFLET_L10N_SRC))
endif
2018-04-12 14:57:00 -05:00
LOLEAFLET_HTML_SRC = $(shell find $(srcdir)/html -name '*.html')
LOLEAFLET_HTML_DST = $(patsubst $(srcdir)/html/%.html,$(builddir)/dist/%.html,$(LOLEAFLET_HTML_SRC))
2018-05-10 12:41:37 -05:00
LOLEAFLET_ADMIN_SRC = $(shell find $(srcdir)/admin -name '*.html')
2018-05-26 15:57:40 -05:00
LOLEAFLET_ADMIN_ALL = $(shell find $(srcdir)/admin -name '*')
2018-05-10 12:41:37 -05:00
LOLEAFLET_ADMIN_DST = $(patsubst $(srcdir)/admin/%,$(builddir)/dist/admin/%,$(LOLEAFLET_ADMIN_SRC))
2018-04-12 14:57:00 -05:00
define file_target
$(1): $(2)
2019-02-12 04:47:24 -06:00
@if test -z '$(ENABLE_BROWSERSYNC)'; then \
`cp $$< $$@`; \
else \
`ln -sf ../$$< $$@`; \
fi
2018-04-12 14:57:00 -05:00
endef
define file_targets
$(foreach file,$(1),$(call file_target,\
$(builddir)/dist/$(notdir $(file)),\
$(file)))
endef
LOLEAFLET_CSS =\
2018-09-02 09:28:52 -05:00
$(builddir)/node_modules/select2/dist/css/select2.css \
2018-04-12 14:57:00 -05:00
$(srcdir)/css/w2ui-1.5.rc1.css \
$(srcdir)/css/leaflet.css \
2019-04-04 05:57:23 -05:00
$(srcdir)/css/leaflet-spinner.css \
2018-04-12 14:57:00 -05:00
$(srcdir)/css/selectionMarkers.css \
$(srcdir)/css/loleaflet.css \
$(srcdir)/css/toolbar.css \
2019-10-16 05:34:54 -05:00
$(srcdir)/css/toolbar-mobile.css \
2018-04-12 14:57:00 -05:00
$(srcdir)/css/partsPreviewControl.css \
2018-08-12 21:05:45 -05:00
$(srcdir)/css/sidebar.css \
2018-04-12 14:57:00 -05:00
$(srcdir)/css/scrollBar.css \
$(srcdir)/css/searchControl.css \
2019-10-16 05:34:54 -05:00
$(srcdir)/css/impress.css \
$(srcdir)/css/impress-mobile.css \
2018-04-12 14:57:00 -05:00
$(srcdir)/css/spreadsheet.css \
2019-10-16 05:34:54 -05:00
$(srcdir)/css/spreadsheet-mobile.css \
$(srcdir)/css/writer.css \
$(srcdir)/css/writer-mobile.css \
2018-04-12 14:57:00 -05:00
$(srcdir)/css/editor.css \
2018-11-15 09:25:08 -06:00
$(srcdir)/css/jquery.mCustomScrollbar.css \
2018-04-12 14:57:00 -05:00
$(builddir)/node_modules/jquery-contextmenu/dist/jquery.contextMenu.css \
2019-05-03 04:41:39 -05:00
$(builddir)/node_modules/vex-js/dist/css/vex.css \
$(builddir)/node_modules/vex-js/dist/css/vex-theme-plain.css \
$(builddir)/node_modules/vex-js/dist/css/vex-theme-bottom-right-corner.css \
2018-04-12 14:57:00 -05:00
$(builddir)/node_modules/smartmenus/dist/css/sm-core-css.css \
$(builddir)/node_modules/smartmenus/dist/css/sm-simple/sm-simple.css \
2019-03-20 03:44:39 -05:00
$(srcdir)/css/menubar.css \
2019-10-16 05:34:54 -05:00
$(srcdir)/css/menubar-mobile.css \
2019-10-16 10:40:53 -05:00
$(srcdir)/css/mobilewizard.css \
2019-10-16 05:34:54 -05:00
$(srcdir)/css/vex.css \
2019-03-20 03:44:39 -05:00
$(builddir)/node_modules/jquery-ui/themes/ui-lightness/jquery-ui.css
2018-04-12 14:57:00 -05:00
LOLEAFLET_CSS_DST = $(foreach file,$(LOLEAFLET_CSS),$(builddir)/dist/$(notdir $(file)))
LOLEAFLET_CSS_M4 = $(strip $(foreach file,$(LOLEAFLET_CSS),$(notdir $(file))))
$(eval $(call file_targets,$(LOLEAFLET_CSS)))
NODE_MODULES_JS =\
2019-05-30 10:34:25 -05:00
$(if $(ENABLE_DEBUG),node_modules/hammerjs/hammer.js,node_modules/hammerjs/hammer.min.js) \
2018-04-12 14:57:00 -05:00
node_modules/jquery/dist/jquery.js \
node_modules/jquery-mousewheel/jquery.mousewheel.js \
2019-05-10 09:03:09 -05:00
node_modules/jquery-contextmenu/dist/jquery.contextMenu.js \
2019-03-20 03:44:39 -05:00
node_modules/jquery-ui/jquery-ui.js \
2018-04-12 14:57:00 -05:00
node_modules/smartmenus/dist/jquery.smartmenus.js \
node_modules/autolinker/dist/Autolinker.js \
node_modules/json-js/json2.js \
node_modules/select2/dist/js/select2.js \
2019-05-03 04:41:39 -05:00
node_modules/vex-js/dist/js/vex.combined.js \
2019-04-02 01:24:18 -05:00
node_modules/@braintree/sanitize-url/dist.js
2018-04-12 14:57:00 -05:00
2019-05-02 14:26:05 -05:00
LOLEAFLET_LIBS_JS =\
jquery.mCustomScrollbar.js \
w2ui-1.5.rc1.js
2019-03-15 11:25:41 -05:00
if !ENABLE_MOBILEAPP
NODE_MODULES_JS +=\
node_modules/l10n-for-node/l10n.js
endif
2018-04-12 14:57:00 -05:00
NODE_MODULES_JS_SRC = $(patsubst %.js,$(builddir)/%.js,$(NODE_MODULES_JS))
NODE_MODULES_JS_DST = $(patsubst %.js,$(builddir)/dist/%.js,$(NODE_MODULES_JS))
2019-05-02 14:26:05 -05:00
LOLEAFLET_LIBS_JS_SRC = $(patsubst %.js,$(srcdir)/js/%.js,$(LOLEAFLET_LIBS_JS))
LOLEAFLET_LIBS_JS_DST = $(patsubst %.js,$(builddir)/dist/%.js,$(LOLEAFLET_LIBS_JS))
2018-04-12 14:57:00 -05:00
LOLEAFLET_JS = $(strip $(shell NODE_PATH=$(abs_builddir)/node_modules $(NODE) -e "try {console.log(require('$(1)').getFiles().join(' '))} catch(e) {}"))
LOLEAFLET_JS_SRC = $(shell find $(srcdir)/src -name '*.js')
LOLEAFLET_JS_DST = $(patsubst $(srcdir)/src/%.js,$(builddir)/dist/src/%.js,$(LOLEAFLET_JS_SRC))
COMMA := ,
EMPTY :=
SPACE := $(EMPTY) $(EMPTY)
LOLEAFLET_VERSION = $(shell cd $(srcdir) && git log -1 --pretty=format:"%h")
2018-05-10 12:41:37 -05:00
LOLEAFLET_PREFIX := $(if $(ENABLE_DEBUG),$(abs_builddir),$(abs_builddir)/build)
2017-11-10 00:00:06 -06:00
2017-08-25 02:08:13 -05:00
EXTRA_DIST = $(shell find . -type f -not -path './.git/*' | sed 's/.\///')
2017-01-03 22:24:55 -06:00
2018-05-26 23:20:29 -05:00
all-local:
2018-12-12 07:22:09 -06:00
$(abs_top_srcdir)/scripts/unocommands.py --check $(abs_top_srcdir)
2018-05-26 23:20:29 -05:00
@$(MAKE) node_modules
@$(MAKE) build-loleaflet
2018-05-26 09:26:47 -05:00
2019-02-13 06:22:25 -06:00
if !ENABLE_MOBILEAPP
2018-11-08 17:03:45 -06:00
ADMIN_BUNDLE = $(builddir)/dist/admin-bundle.js
endif
2019-03-15 11:27:27 -05:00
build-loleaflet: | $(LOLEAFLET_L10N_DST) \
$(L10N_JSON) \
2018-04-12 14:57:00 -05:00
$(LOLEAFLET_IMAGES_DST) \
2019-06-21 03:43:53 -05:00
$(LOLEAFLET_IMAGES_CUSTOM_DST) \
2019-01-10 05:34:43 -06:00
$(JQUERY_LIGHTNESS_DIST_IMAGES) \
$(JQUERY_MINIFIED_DIST_IMAGES) \
2018-05-10 12:41:37 -05:00
$(LOLEAFLET_PREFIX)/dist/loleaflet-src.js \
2018-11-08 17:03:45 -06:00
$(ADMIN_BUNDLE) \
2018-04-12 14:57:00 -05:00
$(builddir)/dist/bundle.css \
$(builddir)/dist/bundle.js \
$(builddir)/dist/loleaflet.html
@echo "build loleaflet completed"
2019-02-13 06:22:25 -06:00
if ENABLE_ANDROIDAPP
2019-07-11 04:29:13 -05:00
@rm -rf $(abs_top_srcdir)/android/lib/src/main/assets/dist
@cp -a $(builddir)/dist $(abs_top_srcdir)/android/lib/src/main/assets/
@if test -d "$(APP_BRANDING_DIR)" ; then cp -a "$(APP_BRANDING_DIR)/branding.css" "$(APP_BRANDING_DIR)/branding.js" $(abs_top_srcdir)/android/lib/src/main/assets/dist/ ; else touch $(abs_top_srcdir)/android/lib/src/main/assets/dist/branding.css ; fi
@if test -d "$(APP_BRANDING_DIR)" ; then cp -a "$(APP_BRANDING_DIR)"/*.svg $(abs_top_srcdir)/android/lib/src/main/assets/dist/images/ ; fi
@if test -d "$(APP_BRANDING_DIR)" ; then cp -a "$(APP_BRANDING_DIR)/toolbar-bg-logo.svg" $(abs_top_srcdir)/android/lib/src/main/assets/dist/images/toolbar-bg.svg ; fi
2019-02-13 06:22:25 -06:00
@echo
2019-07-11 04:29:13 -05:00
@echo "Copied JS, HTML and CSS to the Android project (android/lib/src/main/assets/dist)."
2019-02-13 06:22:25 -06:00
@echo
@echo " Now you need to build the actual .apk from Android Studio:"
@echo " Just open the 'android' subdir as a project there and build."
@echo
endif
2018-04-12 14:57:00 -05:00
2018-05-26 15:57:40 -05:00
$(builddir)/dist/admin-bundle.js: $(LOLEAFLET_ADMIN_DST) \
$(LOLEAFLET_PREFIX)/dist/admin-src.js
@NODE_PATH=$(abs_builddir)/node_modules:$(LOLEAFLET_PREFIX)/dist $(NODE) node_modules/browserify/bin/cmd.js -g browserify-css $(if $(ENABLE_DEBUG),--debug,-g uglifyify) -o $@ $(srcdir)/admin/main-admin.js
$(LOLEAFLET_PREFIX)/dist/admin-src.js: $(LOLEAFLET_ADMIN_ALL)
@echo "Checking for admin JS errors..."
2018-05-26 22:57:26 -05:00
@NODE_PATH=$(abs_builddir)/node_modules $(NODE) node_modules/eslint/bin/eslint.js $(srcdir)/admin/src --ignore-path $(srcdir)/.eslintignore --config $(srcdir)/.eslintrc
2018-05-26 22:24:34 -05:00
@awk 'FNR == 1 {print ""} 1' $(patsubst %.js,$(srcdir)/%.js,$(call LOLEAFLET_JS,$(srcdir)/admin/build/build.js)) > $@
2018-04-12 14:57:00 -05:00
if ENABLE_DEBUG
2019-03-10 08:12:39 -05:00
$(LOLEAFLET_PREFIX)/dist/loleaflet-src.js: $(LOLEAFLET_JS_DST)
2018-05-27 06:50:37 -05:00
@echo "Checking for loleaflet JS errors..."
2018-10-30 08:18:54 -05:00
@NODE_PATH=$(abs_builddir)/node_modules $(NODE) node_modules/eslint/bin/eslint.js $(srcdir)/src \
$(srcdir)/js --ignore-path $(srcdir)/.eslintignore --config $(srcdir)/.eslintrc
2018-04-12 14:57:00 -05:00
@touch $@
$(builddir)/dist/bundle.css: $(LOLEAFLET_CSS_DST)
@touch $@
$(builddir)/dist/bundle.js: $(NODE_MODULES_JS_DST) \
2018-05-10 12:41:37 -05:00
$(LOLEAFLET_PREFIX)/dist/loleaflet-src.js \
2019-05-02 14:26:05 -05:00
$(LOLEAFLET_LIBS_JS_DST)
2018-04-12 14:57:00 -05:00
@touch $@
else
2018-05-10 12:41:37 -05:00
$(LOLEAFLET_PREFIX)/dist/loleaflet-src.js: $(LOLEAFLET_JS_SRC)
2018-04-12 14:57:00 -05:00
@mkdir -p $(dir $@)
2018-05-26 15:57:40 -05:00
@echo "Checking for loleaflet JS errors..."
2018-10-30 08:18:54 -05:00
@NODE_PATH=$(abs_builddir)/node_modules $(NODE) node_modules/eslint/bin/eslint.js $(srcdir)/src \
$(srcdir)/js --ignore-path $(srcdir)/.eslintignore --config $(srcdir)/.eslintrc
2018-04-12 14:57:00 -05:00
@(cat $(srcdir)/src/copyright.js | sed 's/{VERSION}/$(LOLEAFLET_VERSION)/' - \
&& echo "(function (window, document, undefined) {" \
2018-05-17 16:13:24 -05:00
&& awk 'FNR == 1 {print ""} 1' \
$(patsubst %.js,$(srcdir)/%.js,$(call LOLEAFLET_JS,$(srcdir)/build/build.js)) \
2018-04-12 14:57:00 -05:00
&& echo "}(window, document));") > $@
$(builddir)/dist/bundle.css: $(LOLEAFLET_CSS)
@echo "Uglify loleaflet css files..."
2018-05-26 09:39:20 -05:00
@NODE_PATH=$(abs_builddir)/node_modules $(NODE) node_modules/uglifycss/uglifycss $(LOLEAFLET_CSS) > $@
2018-04-12 14:57:00 -05:00
2019-01-27 14:46:41 -06:00
$(builddir)/dist/global.js: $(srcdir)/js/global.js
@echo "Uglify global.js file..."
@NODE_PATH=$(abs_builddir)/node_modules $(NODE) node_modules/uglify-js/bin/uglifyjs $< --output $@
2018-04-12 14:57:00 -05:00
$(builddir)/dist/bundle.js: $(NODE_MODULES_JS_SRC) \
2018-05-10 12:41:37 -05:00
$(LOLEAFLET_PREFIX)/dist/loleaflet-src.js \
2019-05-02 14:26:05 -05:00
$(LOLEAFLET_LIBS_JS_SRC)
2018-04-12 14:57:00 -05:00
@echo "Uglify loleaflet js files..."
2018-11-09 14:28:46 -06:00
NODE_PATH=$(abs_builddir)/node_modules $(NODE) node_modules/uglify-js/bin/uglifyjs \
2019-03-15 11:25:41 -05:00
$(L10N_IOS_ALL_JS) \
2018-04-12 14:57:00 -05:00
$(NODE_MODULES_JS) \
2019-05-02 14:26:05 -05:00
$(LOLEAFLET_LIBS_JS_SRC) \
2018-05-19 16:28:39 -05:00
$(builddir)/build/dist/loleaflet-src.js \
2019-02-13 09:04:44 -06:00
--output $@
2018-04-12 14:57:00 -05:00
endif
2019-03-21 10:17:56 -05:00
$(builddir)/dist/loleaflet.html: $(srcdir)/html/loleaflet.html.m4 $(LOLEAFLET_HTML_DST) $(builddir)/dist/bundle.css $(builddir)/dist/global.js \
\
2018-04-12 14:57:00 -05:00
$(builddir)/dist/bundle.css $(builddir)/dist/bundle.js
@echo "Generating loleaflet.html..."
@m4 -E -DDEBUG=$(ENABLE_DEBUG) \
2018-08-31 05:24:17 -05:00
-DIOSAPP=$(ENABLE_IOSAPP) \
2018-10-16 17:22:24 -05:00
-DGTKAPP=$(ENABLE_GTKAPP) \
2019-02-13 06:22:25 -06:00
-DANDROIDAPP=$(ENABLE_ANDROIDAPP) \
2019-03-30 13:12:19 -05:00
-DMOBILEAPPNAME="$(APP_NAME)" \
2018-04-12 14:57:00 -05:00
-DLOLEAFLET_CSS="$(subst $(SPACE),$(COMMA),$(LOLEAFLET_CSS_M4))" \
2019-01-27 11:42:44 -06:00
-DBUNDLE_CSS="$(abs_builddir)/dist/bundle.css" \
2019-01-27 12:04:26 -06:00
-DGLOBAL_JS="$(abs_builddir)/dist/global.js" \
-DLOLEAFLET_JS="$(subst $(SPACE),$(COMMA),$(NODE_MODULES_JS) \
2019-05-02 14:26:05 -05:00
$(LOLEAFLET_LIBS_JS) \
2019-03-11 15:53:39 -05:00
$(call LOLEAFLET_JS,$(srcdir)/build/build.js))" \
2019-04-03 09:26:51 -05:00
-DVENDOR="$(VENDOR)" \
2018-05-27 08:16:52 -05:00
$(srcdir)/html/loleaflet.html.m4 > $@
2016-08-07 11:27:29 -05:00
2016-12-12 04:24:43 -06:00
node_modules: npm-shrinkwrap.json
2018-05-26 09:26:47 -05:00
@npm install
@touch node_modules
2016-12-12 04:24:43 -06:00
2018-05-17 16:13:24 -05:00
$(builddir)/dist/plugins/%.js: $(srcdir)/plugins/%.js
@mkdir -p $(dir $@)
2019-02-12 04:47:24 -06:00
@if test -z '$(ENABLE_BROWSERSYNC)'; then \
`cp $< $@`; \
else \
`ln -sf $(abs_srcdir)/$< $@`; \
fi
2018-05-17 16:13:24 -05:00
2019-06-21 03:43:53 -05:00
$(builddir)/dist/images/%: $(CUSTOM_ICONS_DIRECTORY)/%
@mkdir -p $(dir $@)
@cp $< $@
2018-04-12 14:57:00 -05:00
$(builddir)/dist/images/%: $(srcdir)/images/%
@mkdir -p $(dir $@)
@cp $< $@
$(builddir)/dist/%.html: $(srcdir)/html/%.html
@mkdir -p $(dir $@)
2019-05-17 04:26:47 -05:00
@if test -z '$(ENABLE_BROWSERSYNC)'; then \
`cp $< $@`; \
else \
`ln -sf $(abs_srcdir)/$< $@`; \
fi
2018-04-12 14:57:00 -05:00
$(builddir)/dist/src/%.js: $(srcdir)/src/%.js
@mkdir -p $(dir $@)
2019-02-12 04:47:24 -06:00
@if test -z '$(ENABLE_BROWSERSYNC)'; then \
`cp $< $@`; \
else \
`echo $< $@`; \
`ln -sf $(abs_srcdir)/$< $@`; \
fi
2018-04-12 14:57:00 -05:00
$(builddir)/dist/%.js: $(srcdir)/js/%.js
@mkdir -p $(dir $@)
2019-02-12 04:47:24 -06:00
@if test -z '$(ENABLE_BROWSERSYNC)'; then \
`cp $< $@`; \
else \
`ln -sf $(abs_srcdir)/$< $@`; \
fi
2018-04-12 14:57:00 -05:00
$(builddir)/dist/node_modules/%.js: $(builddir)/node_modules/%.js
@mkdir -p $(dir $@)
@cp $< $@
2019-01-10 05:34:43 -06:00
$(builddir)/dist/$(JQUERY_LIGHTNESS_IMAGE_PATH)/%.png: $(JQUERY_LIGHTNESS_IMAGE_PATH)/%.png
@mkdir -p $(dir $@)
@cp $< $@
$(builddir)/dist/images/%.png: $(JQUERY_LIGHTNESS_IMAGE_PATH)/%.png
@mkdir -p $(dir $@)
@cp $< $@
$(builddir)/dist/$(JQUERY_MINIFIED_IMAGE_PATH)/%.png: $(JQUERY_MINIFIED_IMAGE_PATH)/%.png
2018-04-12 14:57:00 -05:00
@mkdir -p $(dir $@)
@cp $< $@
2019-01-10 05:34:43 -06:00
$(builddir)/dist/images/%.png: $(JQUERY_MINIFIED_IMAGE_PATH)/%.png
2018-04-12 14:57:00 -05:00
@mkdir -p $(dir $@)
@cp $< $@
2019-03-15 11:45:16 -05:00
$(builddir)/dist/l10n/%: $(srcdir)/l10n/%
2018-04-12 14:57:00 -05:00
@mkdir -p $(dir $@)
2019-03-15 11:27:27 -05:00
@cp $< $@
2017-11-10 00:00:06 -06:00
2019-03-18 08:20:26 -05:00
$(builddir)/dist/l10n/%.json: $(srcdir)/po/%.po
@$(srcdir)/util/po2json.py $< -o $@
2018-05-10 12:41:37 -05:00
$(builddir)/dist/admin/%: $(srcdir)/admin/%
@mkdir -p $(dir $@)
@cp $< $@
2017-01-04 08:08:33 -06:00
install-data-hook:
mkdir -p $(DESTDIR)$(pkgdatadir)/loleaflet; \
cp -ar dist/ $(DESTDIR)$(pkgdatadir)/loleaflet/;
2016-02-08 10:20:05 -06:00
pot:
2016-08-10 05:36:57 -05:00
xgettext --from-code=UTF-8 --keyword=_ --output=po/templates/loleaflet-ui.pot \
2018-05-26 15:57:40 -05:00
admin/admin.strings.js \
2018-05-26 22:24:34 -05:00
admin/src/AdminSocketAnalytics.js \
admin/src/AdminSocketBase.js \
admin/src/AdminSocketOverview.js \
admin/src/AdminSocketSettings.js \
admin/src/Util.js \
2018-01-17 09:55:11 -06:00
src/control/Control.AlertDialog.js \
2017-04-12 15:22:49 -05:00
src/control/Control.ContextMenu.js \
2016-09-20 02:52:24 -05:00
src/control/Control.DocumentRepair.js \
2019-06-24 07:32:43 -05:00
src/control/Control.DownloadProgress.js \
2019-10-14 09:51:15 -05:00
src/control/ColorPicker.js \
2019-09-23 06:31:20 -05:00
src/control/Control.JSDialogBuilder.js \
2019-07-22 04:44:05 -05:00
src/control/Control.LanguageDialog.js \
2016-05-23 15:49:11 -05:00
src/control/Control.Menubar.js \
2019-08-28 13:42:12 -05:00
src/control/Control.MobileWizard.js \
2017-03-13 07:03:00 -05:00
src/control/Control.Scroll.Annotation.js \
2016-05-31 16:26:02 -05:00
src/control/Control.Tabs.js \
2019-04-01 03:27:32 -05:00
src/control/Control.Toolbar.js \
2018-11-15 04:13:06 -06:00
src/control/Ruler.js \
2019-09-17 03:52:53 -05:00
src/control/Signing.js \
2016-06-09 08:26:08 -05:00
src/control/Toolbar.js \
2016-05-31 09:36:21 -05:00
src/core/Socket.js \
2018-11-15 04:13:06 -06:00
src/errormessages.js \
2017-03-13 07:03:00 -05:00
src/layer/marker/Annotation.js \
2019-09-17 03:52:53 -05:00
src/layer/marker/ClipboardContainer.js \
src/layer/tile/CalcTileLayer.js \
src/layer/tile/ImpressTileLayer.js \
2017-03-13 07:03:00 -05:00
src/layer/tile/TileLayer.js \
2019-09-17 03:52:53 -05:00
src/layer/tile/WriterTileLayer.js \
2019-06-22 12:42:48 -05:00
src/map/Clipboard.js \
2019-09-17 03:52:53 -05:00
src/map/Map.js \
2018-11-15 04:13:06 -06:00
src/map/handler/Map.FileInserter.js \
src/map/handler/Map.WOPI.js
2016-05-31 16:26:02 -05:00
2018-05-11 09:38:47 -05:00
html2po --pot --input=html/loleaflet-help.html --output=po/templates/loleaflet-help.pot --duplicates=merge
2016-02-08 10:20:05 -06:00
2019-04-13 14:59:41 -05:00
prop2po --pot --personality=strings --encoding=utf8 --input=$(abs_top_srcdir)/ios/Mobile/Resources/Settings.bundle/en.lproj/Root.strings --output=po/templates/ios.pot
2019-03-29 16:34:42 -05:00
2016-02-08 10:20:05 -06:00
l10n: pot
2016-08-10 05:36:57 -05:00
for i in po/ui-*.po; do pot2po --input=po/templates/loleaflet-ui.pot --template=$$i --output=$$i.new; mv $$i.new $$i;done
for i in po/help-*.po; do pot2po --input=po/templates/loleaflet-help.pot --template=$$i --output=$$i.new; mv $$i.new $$i;done
2019-04-13 14:59:41 -05:00
for i in po/ios-*.po;do pot2po --input=po/templates/ios.pot --template=$$i --output=$$i.new; mv $$i.new $$i; done
# FIXME: po2prop gives 'string index out of range' error.
# for lang in ca cs da de el es fi fr hr hu id it ja ko ms nl no pl pt pt_PT ro ru sk sv th tr uk vi zh_CN zh_TW; do \
# mkdir -p $(abs_top_srcdir)/ios/Mobile/Resources/Settings.bundle/$$lang.lproj; \
# po2prop --personality=strings --encoding=utf8 --template=$(abs_top_srcdir)/ios/Mobile/Resources/Settings.bundle/en.lproj/Root.strings --input=po/ios-$$lang.po --output=$(abs_top_srcdir)/ios/Mobile/Resources/Settings.bundle/$$lang.lproj/Root.strings; \
# done
2016-02-08 10:20:05 -06:00
2016-12-12 06:23:32 -06:00
clean-local:
rm -rf node_modules
2018-05-17 16:13:24 -05:00
rm -rf $(builddir)/dist
rm -rf $(builddir)/build/dist
2016-12-12 06:23:32 -06:00
2015-09-11 02:41:23 -05:00
spec/data/load-test:
if [ ! -d spec/data/load_test ]; then \
mkdir -p spec/data/load_test; \
for i in $$(seq 1 125); \
do \
cp spec/data/eval.odt spec/data/load_test/eval$$i.odt; \
cp spec/data/eval.odp spec/data/load_test/eval$$i.odp; \
cp spec/data/eval.ods spec/data/load_test/eval$$i.ods; \
cp spec/data/eval.odg spec/data/load_test/eval$$i.odg; \
done; \
fi
load-test: spec/data/load-test
rm -rf load_test_out; \
mkdir load_test_out; \
for i in $$(seq 1 20); \
do \
2016-03-07 04:59:14 -06:00
node_modules/.bin/mocha spec/headlessLoadTest.js > load_test_out/$$i.out 2>&1 & \
2015-09-11 02:41:23 -05:00
done;