2020-04-29 07:14:16 -05:00
MAKEFLAGS = --no-builtin-rules
2019-12-23 11:59:16 -06:00
CTAGS = ctags
2015-05-19 06:29:55 -05:00
2019-03-15 11:27:27 -05:00
L10N_PO = $(wildcard $(srcdir)/po/*.po)
2020-05-27 10:31:03 -05:00
BUNDLE ?= $(if $(filter true,$(ENABLE_DEBUG)),DEBUG,RELEASE)
IS_DEBUG = $(if $(filter DEBUG,$(BUNDLE)),true,)
2019-03-15 11:27:27 -05:00
2020-05-27 11:43:29 -05:00
DIST_FOLDER ?= $(builddir)/dist
2020-04-19 18:43:20 -05:00
2020-05-26 07:36:34 -05:00
export NODE_PATH=$(abs_builddir)/node_module
2019-03-15 11:27:27 -05:00
if !ENABLE_MOBILEAPP
2020-04-19 18:43:20 -05:00
L10N_JSON = $(patsubst $(srcdir)/po/%.po,$(DIST_FOLDER)/l10n/%.json,$(L10N_PO))
2019-12-11 04:46:52 -06:00
else
2020-04-19 18:43:20 -05:00
L10N_IOS_ALL_JS = $(DIST_FOLDER)/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
2019-12-11 04:46:52 -06:00
$(L10N_IOS_ALL_JS) : $(wildcard $(srcdir)/po/ui-*.po) $(shell find $(srcdir)/l10n -name '*.*') $(srcdir)/util/create-l10n-all-js.pl
2018-11-09 14:28:46 -06:00
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
2020-06-02 04:46:39 -05:00
JQUERY_LIGHTNESS_IMAGE_PATH = $(srcdir)/images/jquery-ui-lightness
2019-01-10 05:34:43 -06:00
JQUERY_LIGHTNESS_IMAGES = $(wildcard $(JQUERY_LIGHTNESS_IMAGE_PATH)/*.png)
2020-04-19 18:43:20 -05:00
JQUERY_LIGHTNESS_DIST_IMAGES = $(patsubst $(JQUERY_LIGHTNESS_IMAGE_PATH)/%.png,$(DIST_FOLDER)/images/%.png,$(JQUERY_LIGHTNESS_IMAGES))
2019-01-10 05:34:43 -06:00
2020-06-02 04:46:39 -05:00
JQUERY_MINIFIED_IMAGE_PATH = node_modules/jquery-ui-dist/images
2019-01-10 05:34:43 -06:00
JQUERY_MINIFIED_IMAGES = $(wildcard $(JQUERY_MINIFIED_IMAGE_PATH)/*.png)
2020-04-19 18:43:20 -05:00
JQUERY_MINIFIED_DIST_IMAGES = $(patsubst $(JQUERY_MINIFIED_IMAGE_PATH)/%.png,$(DIST_FOLDER)/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 '*.*')
2020-04-19 18:43:20 -05:00
LOLEAFLET_IMAGES_DST = $(patsubst $(srcdir)/%,$(DIST_FOLDER)/%,$(LOLEAFLET_IMAGES_SRC))
2019-06-21 03:43:53 -05:00
LOLEAFLET_IMAGES_CUSTOM_SRC = $(shell find $(CUSTOM_ICONS_DIRECTORY) -name '*.*')
2020-04-19 18:43:20 -05:00
LOLEAFLET_IMAGES_CUSTOM_DST = $(patsubst $(CUSTOM_ICONS_DIRECTORY)/%,$(DIST_FOLDER)/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 '*.*')
2019-12-11 04:46:52 -06:00
if !ENABLE_MOBILEAPP
2020-04-19 18:43:20 -05:00
LOLEAFLET_L10N_DST = $(patsubst $(srcdir)/l10n/%,$(DIST_FOLDER)/l10n/%,$(LOLEAFLET_L10N_SRC))
2019-03-15 11:25:41 -05:00
endif
2018-04-12 14:57:00 -05:00
LOLEAFLET_HTML_SRC = $(shell find $(srcdir)/html -name '*.html')
2020-04-19 18:43:20 -05:00
LOLEAFLET_HTML_DST = $(patsubst $(srcdir)/html/%.html,$(DIST_FOLDER)/%.html,$(LOLEAFLET_HTML_SRC))
2018-04-12 14:57:00 -05:00
2020-05-27 07:20:43 -05:00
LOLEAFLET_WELCOME_SRC = $(shell find $(srcdir)/welcome -name '*.html')
LOLEAFLET_WELCOME_DST = $(patsubst $(srcdir)/welcome/%.html,$(DIST_FOLDER)/welcome/%.html,$(LOLEAFLET_WELCOME_SRC))
2020-06-03 17:36:46 -05:00
LOLEAFLET_ADMIN_SRC = $(shell find $(srcdir)/admin -name '*.html' -or -name '*.css' -or -name '*.ttf' -or -name 'OFL.txt')
2018-05-26 15:57:40 -05:00
LOLEAFLET_ADMIN_ALL = $(shell find $(srcdir)/admin -name '*')
2020-04-19 18:43:20 -05:00
LOLEAFLET_ADMIN_DST = $(patsubst $(srcdir)/admin/%,$(DIST_FOLDER)/admin/%,$(LOLEAFLET_ADMIN_SRC))
2018-05-10 12:41:37 -05:00
2018-04-12 14:57:00 -05:00
define file_target
$(1): $(2)
2020-05-26 17:00:51 -05:00
@mkdir -p $$(dir $$@)
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,\
2020-04-19 18:43:20 -05:00
$(DIST_FOLDER)/$(notdir $(file)),\
2018-04-12 14:57:00 -05:00
$(file)))
endef
2020-02-19 08:17:31 -06:00
define npm_source
for package in $(1); do \
npm pack $${package}; \
fname=$$(ls *.tgz); \
pdir=$${fname%%.tgz}; \
mkdir -p $${pdir}; \
tar -xzf $${fname} -C $${pdir} --strip-components=1; \
rm $${fname}; \
done
endef
2020-03-12 15:37:06 -05:00
LOLEAFLET_ADMIN_JS =\
admin/src/Base.js \
admin/src/Admin.js \
admin/src/AdminSocketBase.js \
admin/src/Util.js \
admin/src/AdminSocketOverview.js \
admin/src/AdminSocketAnalytics.js \
admin/src/AdminSocketSettings.js \
2020-05-13 08:40:05 -05:00
admin/src/AdminSocketHistory.js \
2020-06-09 03:13:52 -05:00
admin/src/AdminSocketLog.js \
admin/src/ModalDialogCreator.js
2020-03-12 15:37:06 -05:00
2020-02-19 08:17:31 -06:00
NODE_MODULES_SRC =\
2020-05-29 14:52:50 -05:00
autolinker@3.14.1 \
2020-02-20 10:04:32 -06:00
json-js@1.1.2 \
2020-06-01 02:27:28 -05:00
select2@4.0.13 \
2020-02-20 06:25:27 -06:00
vex-js@4.1.0 \
l10n-for-node@0.0.1 \
2020-05-29 10:26:47 -05:00
@braintree/sanitize-url@4.0.1
2020-02-19 08:17:31 -06:00
2018-04-12 14:57:00 -05:00
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/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 10:40:53 -05:00
$(srcdir)/css/mobilewizard.css \
2020-05-22 08:48:57 -05:00
$(srcdir)/css/jsdialogs.css \
2020-04-22 06:11:29 -05:00
$(srcdir)/css/notebookbar.css \
2019-10-16 05:34:54 -05:00
$(srcdir)/css/vex.css \
2020-06-02 04:46:39 -05:00
$(srcdir)/css/jquery-ui-lightness.css
2018-04-12 14:57:00 -05:00
2020-04-19 18:43:20 -05:00
LOLEAFLET_CSS_DST = $(foreach file,$(LOLEAFLET_CSS),$(DIST_FOLDER)/$(notdir $(file)))
2018-04-12 14:57:00 -05:00
LOLEAFLET_CSS_M4 = $(strip $(foreach file,$(LOLEAFLET_CSS),$(notdir $(file))))
$(eval $(call file_targets,$(LOLEAFLET_CSS)))
NODE_MODULES_JS =\
2020-05-27 10:31:03 -05:00
$(if $(IS_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 \
2020-06-02 04:46:39 -05:00
node_modules/jquery-ui-dist/jquery-ui.js \
2020-02-20 10:21:44 -06:00
node_modules/smartmenus/dist/jquery.smartmenus.js
2018-04-12 14:57:00 -05:00
2020-02-19 13:08:17 -06:00
LOLEAFLET_LIBS_JS =\
2020-02-20 10:21:44 -06:00
Autolinker.js \
2020-02-20 10:04:32 -06:00
json2.js \
2020-02-20 07:54:53 -06:00
select2.js \
2020-02-20 06:25:27 -06:00
vex.combined.js \
2020-02-19 13:08:17 -06:00
sanitize-url.js
2019-05-02 14:26:05 -05:00
2019-03-15 11:25:41 -05:00
if !ENABLE_MOBILEAPP
2020-02-19 08:17:31 -06:00
LOLEAFLET_LIBS_JS +=\
l10n.js
2019-03-15 11:25:41 -05:00
endif
2020-02-19 08:17:31 -06:00
LOLEAFLET_LIBS_JS +=\
jquery.mCustomScrollbar.js \
w2ui-1.5.rc1.js
2018-04-12 14:57:00 -05:00
NODE_MODULES_JS_SRC = $(patsubst %.js,$(builddir)/%.js,$(NODE_MODULES_JS))
2020-04-19 18:43:20 -05:00
NODE_MODULES_JS_DST = $(patsubst %.js,$(DIST_FOLDER)/%.js,$(NODE_MODULES_JS))
2018-04-12 14:57:00 -05:00
2019-05-02 14:26:05 -05:00
LOLEAFLET_LIBS_JS_SRC = $(patsubst %.js,$(srcdir)/js/%.js,$(LOLEAFLET_LIBS_JS))
2020-04-19 18:43:20 -05:00
LOLEAFLET_LIBS_JS_DST = $(patsubst %.js,$(DIST_FOLDER)/%.js,$(LOLEAFLET_LIBS_JS))
2019-05-02 14:26:05 -05:00
2020-02-21 11:09:26 -06:00
LOLEAFLET_JS =\
src/Leaflet.js \
src/errormessages.js \
src/unocommands.js \
src/viamapi-client.js \
src/core/Log.js \
src/core/Util.js \
src/core/LOUtil.js \
src/core/Class.js \
src/core/Events.js \
src/core/Socket.js \
src/core/Matrix.js \
src/geometry/Point.js \
src/geometry/Bounds.js \
src/geometry/Transformation.js \
src/dom/DomUtil.js src/geo/LatLng.js \
src/geo/LatLngBounds.js \
src/geo/projection/Projection.LonLat.js \
src/geo/crs/CRS.js \
src/geo/crs/CRS.Simple.js \
src/map/Map.js \
src/map/Clipboard.js \
src/layer/Layer.js \
src/layer/tile/GridLayer.js \
src/layer/tile/TileLayer.js \
src/layer/tile/TileLayer.TableOverlay.js \
src/layer/ObjectFocusDarkOverlay.js \
src/layer/tile/WriterTileLayer.js \
src/layer/tile/ImpressTileLayer.js \
src/layer/tile/CalcTileLayer.js \
src/layer/BackgroundColor.js \
src/layer/ImageOverlay.js \
src/layer/marker/ProgressOverlay.js \
src/layer/marker/TextInput.js \
src/layer/marker/Icon.js \
src/layer/marker/Icon.Default.js \
src/layer/marker/Marker.js \
src/layer/marker/Cursor.js \
src/layer/marker/DivIcon.js \
src/layer/Popup.js \
src/layer/Layer.Popup.js \
src/layer/marker/Marker.Popup.js \
src/layer/LayerGroup.js \
src/layer/FeatureGroup.js \
src/layer/CalcGridLines.js \
src/layer/vector/Renderer.js \
src/layer/vector/Path.js \
src/layer/vector/Path.Popup.js \
src/geometry/LineUtil.js \
src/layer/vector/Polyline.js \
src/geometry/PolyUtil.js \
src/layer/vector/Polygon.js \
src/layer/vector/Rectangle.js \
src/layer/vector/CircleMarker.js \
src/layer/vector/Circle.js \
src/layer/vector/SVG.js \
src/layer/vector/Path.Transform.SVG.js \
src/core/Handler.js \
src/layer/vector/SVGGroup.js \
src/layer/vector/Path.Drag.Transform.js \
src/layer/vector/Path.Drag.js \
src/layer/vector/Path.Transform.Util.js \
src/layer/vector/Path.Transform.js \
src/layer/vector/SVG.VML.js \
src/layer/vector/Path.Transform.SVG.VML.js \
src/layer/vector/Canvas.js \
src/layer/vector/Path.Transform.Canvas.js \
2020-04-29 06:36:05 -05:00
src/layer/FormFieldButtonLayer.js \
2020-02-21 11:09:26 -06:00
src/dom/DomEvent.js \
src/dom/Draggable.js \
src/map/handler/Map.Drag.js \
src/map/handler/Map.Scroll.js \
src/map/handler/Map.DoubleClickZoom.js \
src/dom/DomEvent.Pointer.js \
src/map/handler/Map.TouchGesture.js \
src/map/handler/Map.BoxZoom.js \
src/map/handler/Map.Keyboard.js \
src/dom/DomEvent.MultiClick.js \
src/map/handler/Map.Mouse.js \
src/map/handler/Map.Print.js \
src/map/handler/Map.SlideShow.js \
src/map/handler/Map.FileInserter.js \
src/map/handler/Map.StateChanges.js \
src/map/handler/Map.WOPI.js \
src/layer/marker/Marker.Drag.js \
src/control/Control.Toolbar.js \
src/control/Control.js \
src/control/Control.PartsPreview.js \
src/control/Control.Header.js \
src/control/Control.ColumnHeader.js \
src/control/Control.RowHeader.js \
src/control/Control.DocumentRepair.js \
src/control/Control.DownloadProgress.js \
src/control/Control.ContextMenu.js \
src/control/Control.Menubar.js \
src/control/Control.Tabs.js \
src/control/Control.Permission.js \
src/control/Control.Selection.js \
src/control/Control.Scroll.js \
src/control/Control.LokDialog.js \
src/control/Control.AlertDialog.js \
src/control/Control.Infobar.js src/control/ColorPicker.js \
src/control/Control.JSDialogBuilder.js \
src/control/Control.MobileWizard.js \
src/control/Control.LanguageDialog.js \
src/control/Control.Attribution.js \
src/control/Control.MobileSlide.js \
src/control/Control.Scale.js \
2020-04-10 04:29:52 -05:00
src/control/Control.StatusBar.js \
2020-04-10 08:19:56 -05:00
src/control/Control.SearchBar.js \
2020-04-10 10:36:40 -05:00
src/control/Control.MobileTopBar.js \
2020-04-10 12:44:21 -05:00
src/control/Control.MobileBottomBar.js \
2020-04-14 11:07:25 -05:00
src/control/Control.UserList.js \
2020-04-15 06:38:46 -05:00
src/control/Control.FormulaBar.js \
2020-04-15 07:15:22 -05:00
src/control/Control.SheetsBar.js \
2020-04-15 08:25:22 -05:00
src/control/Control.PresentationBar.js \
2020-04-16 04:13:21 -05:00
src/control/Control.SigningBar.js \
2020-04-16 06:19:55 -05:00
src/control/Control.TopToolbar.js \
2020-04-16 11:21:44 -05:00
src/control/Control.UIManager.js \
2020-04-20 06:55:35 -05:00
src/control/Control.DocumentNameInput.js \
2020-04-21 07:10:38 -05:00
src/control/Control.Notebookbar.js \
2020-05-01 05:19:29 -05:00
src/control/Control.NotebookbarWriter.js \
src/control/Control.NotebookbarCalc.js \
2020-05-07 04:33:18 -05:00
src/control/Control.NotebookbarImpress.js \
2020-04-22 04:29:31 -05:00
src/control/Control.NotebookbarBuilder.js \
2020-02-21 11:09:26 -06:00
src/control/Control.Layers.js \
src/control/Search.js \
src/control/Permission.js \
src/control/Toolbar.js \
src/control/Signing.js \
src/control/Parts.js \
src/control/Scroll.js \
src/control/Styles.js \
src/control/Ruler.js \
src/dom/PosAnimation.js \
src/map/anim/Map.PanAnimation.js \
src/dom/PosAnimation.Timer.js \
src/map/anim/Map.ZoomAnimation.js \
src/map/anim/Map.FlyTo.js \
src/layer/AnnotationManager.js \
src/control/Control.Scroll.Annotation.js \
src/layer/marker/Annotation.js \
src/layer/marker/DivOverlay.js \
src/main.js
2018-04-12 14:57:00 -05:00
LOLEAFLET_JS_SRC = $(shell find $(srcdir)/src -name '*.js')
2020-04-19 18:43:20 -05:00
LOLEAFLET_JS_DST = $(patsubst $(srcdir)/src/%.js,$(DIST_FOLDER)/src/%.js,$(LOLEAFLET_JS_SRC))
2018-04-12 14:57:00 -05:00
COMMA := ,
EMPTY :=
SPACE := $(EMPTY) $(EMPTY)
LOLEAFLET_VERSION = $(shell cd $(srcdir) && git log -1 --pretty=format:"%h")
2020-05-27 10:16:08 -05:00
INTERMEDIATE_DIR ?= $(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
2020-05-26 14:25:28 -05:00
define bundle_loleaflet
2020-05-28 11:08:06 -05:00
$(if $(IS_DEBUG),\
2020-05-26 14:25:28 -05:00
@touch $@,
@m4 -PE -DIOSAPP=$(ENABLE_IOSAPP) \
-DGTKAPP=$(ENABLE_GTKAPP) \
-DANDROIDAPP=$(ENABLE_ANDROIDAPP) \
-DMOBILEAPPNAME="$(APP_NAME)" \
-DVERSION=$(LOLEAFLET_VERSION) \
-DCOPYRIGHT=$(srcdir)/src/copyright.js \
-DLOLEAFLET_JS=$(subst $(SPACE),$(COMMA),$(patsubst %.js,$(srcdir)/%.js,$(LOLEAFLET_JS))) \
$(srcdir)/loleaflet-src.js.m4 > $@)
endef
define prereq_loleaflet
2020-05-28 11:08:06 -05:00
$(if $(IS_DEBUG),$(LOLEAFLET_JS_DST),$(LOLEAFLET_JS_SRC))
2020-05-26 14:25:28 -05:00
endef
2020-05-26 17:00:51 -05:00
define bundle_css
2020-05-28 11:08:06 -05:00
$(if $(IS_DEBUG),\
2020-05-26 17:00:51 -05:00
@touch $@,\
@echo "Uglify loleaflet css files..."
@$(NODE) node_modules/uglifycss/uglifycss $(LOLEAFLET_CSS) > $@)
endef
define prereq_css
2020-05-28 11:08:06 -05:00
$(if $(IS_DEBUG),$(LOLEAFLET_CSS_DST),$(LOLEAFLET_CSS))
2020-05-26 17:00:51 -05:00
endef
2020-05-26 18:28:52 -05:00
define bundle_all
2020-05-28 11:08:06 -05:00
$(if $(IS_DEBUG),\
2020-05-26 18:28:52 -05:00
@touch $@,\
@echo "Uglify loleaflet js files..."
@m4 -PE -DL10N_IOS_ALL_JS=$(L10N_IOS_ALL_JS) \
-DNODE_MODULES_JS=$(subst $(SPACE),$(COMMA),$(NODE_MODULES_JS)) \
-DLOLEAFLET_LIBS_JS=$(subst $(SPACE),$(COMMA),$(LOLEAFLET_LIBS_JS_SRC)) \
-DLOLEAFLET_JS=$(INTERMEDIATE_DIR)/loleaflet-src.js \
$(srcdir)/bundle.js.m4 > $(INTERMEDIATE_DIR)/bundle.js
@$(NODE) node_modules/uglify-js/bin/uglifyjs \
$(INTERMEDIATE_DIR)/bundle.js \
--output $@)
endef
define prereq_all
2020-05-28 11:08:06 -05:00
$(if $(IS_DEBUG),$(NODE_MODULES_JS_DST) $(LOLEAFLET_LIBS_JS_DST),\
2020-05-26 18:28:52 -05:00
$(NODE_MODULES_JS_SRC) $(LOLEAFLET_LIBS_JS_SRC))
endef
2020-05-26 19:17:22 -05:00
define global_file
2020-05-28 11:08:06 -05:00
$(if $(IS_DEBUG),
2020-05-26 19:17:22 -05:00
@cp $< $@,
@echo "Uglify global.js file..."
@$(NODE) node_modules/uglify-js/bin/uglifyjs $< --output $@)
endef
2020-05-27 10:00:13 -05:00
.PHONY: build-loleaflet
2020-04-28 16:25:49 -05:00
all-local: build-loleaflet
2018-05-26 09:26:47 -05:00
2019-02-13 06:22:25 -06:00
if !ENABLE_MOBILEAPP
2020-04-19 18:43:20 -05:00
ADMIN_BUNDLE = $(DIST_FOLDER)/admin-bundle.js
2018-11-08 17:03:45 -06:00
endif
2020-06-09 03:13:52 -05:00
compilets:
$(srcdir)/node_modules/typescript/bin/tsc
2020-06-11 05:37:11 -05:00
@touch $@
2020-06-09 03:13:52 -05:00
build-loleaflet: compilets \
$(LOLEAFLET_L10N_DST) \
2019-03-15 11:27:27 -05:00
$(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-11-08 17:03:45 -06:00
$(ADMIN_BUNDLE) \
2020-04-19 18:43:20 -05:00
$(DIST_FOLDER)/bundle.css \
$(DIST_FOLDER)/device-mobile.css \
$(DIST_FOLDER)/device-tablet.css \
$(DIST_FOLDER)/device-desktop.css \
$(DIST_FOLDER)/bundle.js \
$(DIST_FOLDER)/loleaflet.html
2018-04-12 14:57:00 -05:00
@echo "build loleaflet completed"
2019-02-13 06:22:25 -06:00
if ENABLE_ANDROIDAPP
2020-05-27 11:43:29 -05:00
@if test -d "$(APP_BRANDING_DIR)" ; then cp -a "$(APP_BRANDING_DIR)/branding.css" "$(APP_BRANDING_DIR)/branding.js" $(DIST_FOLDER)/ ; else touch $(DIST_FOLDER)/branding.css ; fi
@if test -d "$(APP_BRANDING_DIR)" ; then cp -a "$(APP_BRANDING_DIR)"/images/*.svg $(DIST_FOLDER)/images/ ; fi
@if test -d "$(APP_BRANDING_DIR)" ; then cp -a "$(APP_BRANDING_DIR)/images/toolbar-bg-logo.svg" $(DIST_FOLDER)/images/toolbar-bg.svg ; fi
2019-02-13 06:22:25 -06:00
@echo
2020-04-21 17:11:13 -05:00
@echo "JS, HTML and CSS has been updated (android/lib/src/main/assets/dist)."
2019-02-13 06:22:25 -06:00
endif
2018-04-12 14:57:00 -05:00
2020-04-19 18:43:20 -05:00
$(DIST_FOLDER)/admin-bundle.js: $(LOLEAFLET_ADMIN_DST) \
2020-05-26 09:45:55 -05:00
$(INTERMEDIATE_DIR)/admin-src.js
2020-05-27 10:31:03 -05:00
@NODE_PATH=$(abs_builddir)/node_modules:$(INTERMEDIATE_DIR) $(NODE) node_modules/browserify/bin/cmd.js -g browserify-css $(if $(IS_DEBUG),--debug,-g uglifyify) -o $@ $(srcdir)/admin/main-admin.js
2018-05-26 15:57:40 -05:00
2020-06-11 05:37:11 -05:00
$(INTERMEDIATE_DIR)/admin-src.js: $(LOLEAFLET_ADMIN_ALL) compilets
2020-05-27 10:16:08 -05:00
@mkdir -p $(dir $@)
2018-05-26 15:57:40 -05:00
@echo "Checking for admin JS errors..."
2020-05-26 07:36:34 -05:00
@$(NODE) node_modules/eslint/bin/eslint.js $(srcdir)/admin/src --ignore-path $(srcdir)/.eslintignore --config $(srcdir)/.eslintrc
2020-03-12 15:37:06 -05:00
@awk 'FNR == 1 {print ""} 1' $(patsubst %.js,$(srcdir)/%.js,$(LOLEAFLET_ADMIN_JS)) > $@
2020-06-11 05:37:11 -05:00
$(INTERMEDIATE_DIR)/loleaflet-src.js: $(call prereq_loleaflet) compilets
2020-04-19 18:43:20 -05:00
@mkdir -p $(dir $@)
2020-05-27 09:08:16 -05:00
$(abs_top_srcdir)/scripts/unocommands.py --check $(abs_top_srcdir)
2018-05-27 06:50:37 -05:00
@echo "Checking for loleaflet JS errors..."
2020-05-26 07:36:34 -05:00
@$(NODE) node_modules/eslint/bin/eslint.js $(srcdir)/src \
2018-10-30 08:18:54 -05:00
$(srcdir)/js --ignore-path $(srcdir)/.eslintignore --config $(srcdir)/.eslintrc
2020-05-28 11:08:06 -05:00
$(call bundle_loleaflet)
2018-04-12 14:57:00 -05:00
2020-05-28 11:08:06 -05:00
$(DIST_FOLDER)/bundle.css: $(call prereq_css)
2020-05-26 17:00:51 -05:00
@mkdir -p $(dir $@)
2020-05-28 11:08:06 -05:00
$(call bundle_css)
2018-04-12 14:57:00 -05:00
2020-05-28 11:08:06 -05:00
$(DIST_FOLDER)/bundle.js: $(INTERMEDIATE_DIR)/loleaflet-src.js $(call prereq_all)
2020-05-26 18:28:52 -05:00
@mkdir -p $(dir $@)
2020-05-28 11:08:06 -05:00
$(call bundle_all)
2020-05-26 18:28:52 -05:00
2020-04-19 18:43:20 -05:00
$(DIST_FOLDER)/global.js: $(srcdir)/js/global.js
2020-05-26 19:17:22 -05:00
@mkdir -p $(dir $@)
2020-05-28 11:08:06 -05:00
$(call global_file)
2018-04-12 14:57:00 -05:00
2020-05-26 08:20:50 -05:00
$(DIST_FOLDER)/loleaflet.html: $(srcdir)/html/loleaflet.html.m4 \
$(LOLEAFLET_HTML_DST) \
$(DIST_FOLDER)/bundle.css \
$(DIST_FOLDER)/global.js \
$(DIST_FOLDER)/bundle.js
2018-04-12 14:57:00 -05:00
@echo "Generating loleaflet.html..."
2020-05-27 10:31:03 -05:00
@m4 -PE -DDEBUG=$(IS_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))" \
2020-04-19 18:43:20 -05:00
-DGLOBAL_JS="$(DIST_FOLDER)/global.js" \
2019-01-27 12:04:26 -06:00
-DLOLEAFLET_JS="$(subst $(SPACE),$(COMMA),$(NODE_MODULES_JS) \
2019-05-02 14:26:05 -05:00
$(LOLEAFLET_LIBS_JS) \
2020-05-27 08:54:06 -05:00
$(LOLEAFLET_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
2020-04-28 16:25:49 -05:00
node_modules: package.json archived-packages
2018-05-26 09:26:47 -05:00
@npm install
@touch node_modules
2016-12-12 04:24:43 -06:00
2020-05-28 07:17:16 -05:00
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status node_modules
@case '$?' in \
2020-05-28 10:27:32 -05:00
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@;; \
2020-05-28 07:17:16 -05:00
esac;
2020-04-19 18:43:20 -05:00
$(DIST_FOLDER)/device-%.css: $(srcdir)/css/device-%.css
2020-03-30 04:59:20 -05:00
@mkdir -p $(dir $@)
@if test -z '$(ENABLE_BROWSERSYNC)'; then \
2020-05-26 07:36:34 -05:00
$(NODE) node_modules/uglifycss/uglifycss $< > $@ ; \
2020-03-30 04:59:20 -05:00
else \
ln -sf $(abs_srcdir)/$< $@ ; \
fi
2020-04-19 18:43:20 -05:00
$(DIST_FOLDER)/plugins/%.js: $(srcdir)/plugins/%.js
2018-05-17 16:13:24 -05:00
@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
2020-04-19 18:43:20 -05:00
$(DIST_FOLDER)/images/%: $(CUSTOM_ICONS_DIRECTORY)/%
2019-06-21 03:43:53 -05:00
@mkdir -p $(dir $@)
@cp $< $@
2020-04-19 18:43:20 -05:00
$(DIST_FOLDER)/images/%: $(srcdir)/images/%
2018-04-12 14:57:00 -05:00
@mkdir -p $(dir $@)
@cp $< $@
2020-04-19 18:43:20 -05:00
$(DIST_FOLDER)/%.html: $(srcdir)/html/%.html
2018-04-12 14:57:00 -05:00
@mkdir -p $(dir $@)
2019-05-17 04:26:47 -05:00
@if test -z '$(ENABLE_BROWSERSYNC)'; then \
`cp $< $@`; \
2020-05-27 07:20:43 -05:00
else \
`ln -sf $(abs_srcdir)/$< $@`; \
fi
$(DIST_FOLDER)/welcome/%.html: $(srcdir)/welcome/%.html
@mkdir -p $(dir $@)
@if test -z '$(ENABLE_BROWSERSYNC)'; then \
`cp $< $@`; \
2019-05-17 04:26:47 -05:00
else \
`ln -sf $(abs_srcdir)/$< $@`; \
fi
2018-04-12 14:57:00 -05:00
2020-04-19 18:43:20 -05:00
$(DIST_FOLDER)/src/%.js: $(srcdir)/src/%.js
2018-04-12 14:57:00 -05:00
@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
2020-04-19 18:43:20 -05:00
$(DIST_FOLDER)/%.js: $(srcdir)/js/%.js
2018-04-12 14:57:00 -05:00
@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
2020-04-19 18:43:20 -05:00
$(DIST_FOLDER)/node_modules/%.js: $(builddir)/node_modules/%.js
2018-04-12 14:57:00 -05:00
@mkdir -p $(dir $@)
@cp $< $@
2020-04-19 18:43:20 -05:00
$(DIST_FOLDER)/$(JQUERY_LIGHTNESS_IMAGE_PATH)/%.png: $(JQUERY_LIGHTNESS_IMAGE_PATH)/%.png
2019-01-10 05:34:43 -06:00
@mkdir -p $(dir $@)
@cp $< $@
2020-04-19 18:43:20 -05:00
$(DIST_FOLDER)/images/%.png: $(JQUERY_LIGHTNESS_IMAGE_PATH)/%.png
2019-01-10 05:34:43 -06:00
@mkdir -p $(dir $@)
@cp $< $@
2020-04-19 18:43:20 -05:00
$(DIST_FOLDER)/$(JQUERY_MINIFIED_IMAGE_PATH)/%.png: $(JQUERY_MINIFIED_IMAGE_PATH)/%.png
2018-04-12 14:57:00 -05:00
@mkdir -p $(dir $@)
@cp $< $@
2020-04-19 18:43:20 -05:00
$(DIST_FOLDER)/images/%.png: $(JQUERY_MINIFIED_IMAGE_PATH)/%.png
2018-04-12 14:57:00 -05:00
@mkdir -p $(dir $@)
@cp $< $@
2020-04-19 18:43:20 -05:00
$(DIST_FOLDER)/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
2020-04-19 18:43:20 -05:00
$(DIST_FOLDER)/l10n/%.json: $(srcdir)/po/%.po
2019-03-18 08:20:26 -05:00
@$(srcdir)/util/po2json.py $< -o $@
2020-04-19 18:43:20 -05:00
$(DIST_FOLDER)/admin/%: $(srcdir)/admin/%
2018-05-10 12:41:37 -05:00
@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/;
2020-02-19 08:17:31 -06:00
libs:
@mkdir -p $(abs_srcdir)/libs
@cd $(abs_srcdir)/libs \
&& $(call npm_source,$(NODE_MODULES_SRC))
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 \
2020-04-16 07:23:59 -05:00
src/control/ColorPicker.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 \
2020-04-16 07:23:59 -05:00
src/control/Control.FormulaBar.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 \
2020-04-16 07:23:59 -05:00
src/control/Control.MobileBottomBar.js \
src/control/Control.MobileTopBar.js \
2019-08-28 13:42:12 -05:00
src/control/Control.MobileWizard.js \
2020-04-16 07:23:59 -05:00
src/control/Control.PresentationBar.js \
2017-03-13 07:03:00 -05:00
src/control/Control.Scroll.Annotation.js \
2020-04-16 07:23:59 -05:00
src/control/Control.SearchBar.js \
src/control/Control.SheetsBar.js \
2020-04-16 04:13:21 -05:00
src/control/Control.SigningBar.js \
2020-04-16 07:23:59 -05:00
src/control/Control.StatusBar.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 \
2020-04-16 06:19:55 -05:00
src/control/Control.TopToolbar.js \
2020-04-16 07:23:59 -05:00
src/control/Control.UserList.js \
2020-04-16 11:21:44 -05:00
src/control/Control.UIManager.js \
2020-04-20 06:55:35 -05:00
src/control/Control.DocumentNameInput.js \
2020-04-21 07:10:38 -05:00
src/control/Control.Notebookbar.js \
2020-05-01 05:19:29 -05:00
src/control/Control.NotebookbarWriter.js \
src/control/Control.NotebookbarCalc.js \
2020-05-07 04:33:18 -05:00
src/control/Control.NotebookbarImpress.js \
2020-04-22 04:29:31 -05:00
src/control/Control.NotebookbarBuilder.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-11-15 10:26:52 -06:00
src/layer/marker/TextInput.js \
2019-09-17 03:52:53 -05:00
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:
2020-04-27 10:20:10 -05:00
@rm -rf $(DIST_FOLDER)
2020-05-27 10:16:08 -05:00
@rm -rf $(INTERMEDIATE_DIR)
2020-04-05 08:47:27 -05:00
@rm -f $(abs_srcdir)/jsconfig.json
@rm -f $(abs_srcdir)/admin/jsconfig.json
2016-12-12 06:23:32 -06:00
2019-12-23 11:59:16 -06:00
ctags:
@$(CTAGS) --language-force=JavaScript $(LOLEAFLET_JS_SRC) $(srcdir)/js/global.js
2020-04-05 08:47:27 -05:00
$(abs_srcdir)/jsconfig.json:
@printf "{\n \
\"compilerOptions\" : {},\n \
\"include\" : [\"src/**/*\", \"js/**/*\"],\n \
\"exclude\" : [\"node_modules\", \"admin/**/*\"]\n}" > $@
$(abs_srcdir)/admin/jsconfig.json:
@printf "{\n \
\"compilerOptions\" : {},\n \
\"include\" : [\"./**/*\"],\n \
\"exclude\" : [\"node_modules\"]\n}" > $@
jsconfig: $(abs_srcdir)/jsconfig.json $(abs_srcdir)/admin/jsconfig.json