summaryrefslogtreecommitdiff
path: root/webapps/swat/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'webapps/swat/Makefile')
-rw-r--r--webapps/swat/Makefile297
1 files changed, 77 insertions, 220 deletions
diff --git a/webapps/swat/Makefile b/webapps/swat/Makefile
index c61f0a3287..f59a309c1a 100644
--- a/webapps/swat/Makefile
+++ b/webapps/swat/Makefile
@@ -1,241 +1,98 @@
-###################################################################################
-# PUBLIC VARIABLES
-###################################################################################
-
-QOOXDOO = ../qooxdoo-0.6.3-sdk
-SCRIPTNAME = swat.js
-APPCLASS = swat.main.Main
-INCLUDEALL = false
-OPTIMIZESTRINGS = false
-OPTIMIZEVARIABLES = false
-SOURCELOADER=
-NICE=10
-
-
-###################################################################################
-# PRIVATE VARIABLES
-###################################################################################
-
-FRONTEND = $(QOOXDOO)/frontend
-FRAMEWORK = $(FRONTEND)/framework
-API = $(FRONTEND)/api
-CACHE = $(FRAMEWORK)/.cache
-GENERATOR = $(FRAMEWORK)/tool/generator.py
-
-
-ifeq ($(INCLUDEALL),false)
- INCLUDE = --include $(APPCLASS)
-else
- INCLUDE =
-endif
-
-ifeq ($(OPTIMIZESTRINGS),true)
- OPTIMIZESTR = --optimize-strings
-else
- OPTIMIZESTR =
-endif
-
-ifeq ($(OPTIMIZEVARIABLES),true)
- OPTIMIZEVAR = --optimize-variables
-else
- OPTIMIZEVAR =
-endif
-
-ifneq ($(SOURCELOADER),)
- SOURCELDR = --source-loader-type $(SOURCELOADER)
-else
- SOURCELDR =
-endif
-
-
-###################################################################################
-# DEFAULT TARGET
-###################################################################################
-
-all: build
+################################################################################
+# REQUIRED SETTINGS
+################################################################################
+#
+# Path to the folder of your qooxdoo distribution.
+# Can either be
+# a) a path relative to the location of this Makefile (preferred) or
+# b) an absolute path starting at the root of your file system
+# Example: If you put the skeleton folder next to the qooxdoo SDK folder,
+# you can use the following relative path:
+# QOOXDOO_PATH = ../qooxdoo-0.6.5-sdk
+#
+QOOXDOO_PATH = ../qooxdoo-0.6.5-sdk
+#
+# Similar to above, but from the webserver point of view.
+# Starting point is now the application HTML file of the source folder
+# (source/index.html by default). In most cases just prepend a "../" to
+# QOOXDOO_PATH from above.
+# Example: QOOXDOO_URI = ../../qooxdoo-0.6.5-sdk
+#
+QOOXDOO_URI = ../../qooxdoo-0.6.5-sdk
-###################################################################################
-# COMMON TARGETS
-###################################################################################
-source: info-source \
- generate-script-source \
- generate-api-data
-build: info-build \
- generate-script-build \
- generate-api-data \
- copy-build-files \
- fix-build-rights
-swat-only: \
- info-build \
- generate-script-build \
- copy-build-files \
- fix-build-rights
-api: generate-api-build generate-api-data
- @echo
- @echo " CREATE COPY OF HTML FILE"
- @echo "----------------------------------------------------------------------------"
- @echo " * Copying file..."
- @cp -f $(API)/source/index.html api/index.html
-pretty: generate-pretty
-fix: generate-fix
+################################################################################
+# BASIC SETTINGS
+################################################################################
+#
+# Full namespace of your application
+#
+APPLICATION_NAMESPACE = swat
+#
+# Titles used in your API viewer and during the build process
+#
+APPLICATION_MAKE_TITLE = SWAT
+APPLICATION_API_TITLE = Swat
-###################################################################################
-# CLEANUP TARGETS
-###################################################################################
+#
+# Additional static files of your application (space separated list)
+#
+APPLICATION_FILES = index.html
-clean:
- @echo
- @echo " CLEANUP OF GENERATED FILES"
- @echo "----------------------------------------------------------------------------"
- @echo " * Deleting files..."
- @rm -f source/script/$(SCRIPTNAME) build/script/$(SCRIPTNAME)
+#
+# Locales to build (space separated list)
+# To set a specific locale like "en_US" the generic locale "en" has to be added as well
+# Example: APPLICATION_LOCALES = en en_US de de_DE es
+#
+APPLICATION_LOCALES =
-realclean: clean
- @echo
- @echo " CLEANUP OF GENERATED FILES (REAL)"
- @echo "----------------------------------------------------------------------------"
- @echo " * Deleting files..."
- @nice -n $(NICE) rm -rf build
-distclean: realclean
- @echo
- @echo " CLEANUP OF GENERATED FILES (DIST)"
- @echo "----------------------------------------------------------------------------"
- @echo " * Deleting files..."
- @nice -n $(NICE) find . -name "*~" -o -name "*.bak" -o -name "*.old" | xargs rm -rf
- @nice -n $(NICE) rm -rf $(CACHE)
-###################################################################################
-# GENERATOR TARGETS
-###################################################################################
-generate-script-source:
- @$(GENERATOR) \
- --script-input $(FRAMEWORK)/source/class \
- --source-script-path ../$(FRAMEWORK)/source/class \
- --script-input $(API)/source/class \
- --source-script-path ../$(API)/source/class \
- --script-input source/class \
- --source-script-path class \
- --generate-source-script $(SOURCELDR) \
- $(INCLUDE) \
- --source-script-file source/script/$(SCRIPTNAME) \
- --define-runtime-setting qx.manager.object.AliasManager.resourceUri:../$(FRAMEWORK)/source/resource \
- --cache-directory $(CACHE) \
- --add-new-lines
+################################################################################
+# ADVANCED SETTINGS
+################################################################################
#
-# djl: --script-input begins a set for which --resource-input and
-# --resource-output apply. Since there is a --resource-input and a
-# --resource-output defined for one set, it must be defined for each set
+# Please take a look at $(QOOXDOO_PATH)/frontend/framework/tool/make/application.mk
+# for an overview of available options
#
-generate-script-build:
- @$(GENERATOR) \
- --script-input $(FRAMEWORK)/source/class \
- --resource-input $(FRAMEWORK)/source/resource \
- --resource-output build/resource \
- --script-input $(API)/source/class \
- --resource-input $(API)/source/resource \
- --resource-output build/resource \
- --script-input source/class \
- --resource-input source/resource \
- --resource-output build/resource \
- --generate-compiled-script \
- $(INCLUDE) $(OPTIMIZESTR) $(OPTIMIZEVAR) \
- --compiled-script-file build/script/$(SCRIPTNAME) \
- --copy-resources \
- --define-runtime-setting qx.manager.object.AliasManager.resourceUri:./resource \
- --cache-directory $(CACHE) \
- --add-new-lines
-
-generate-api-build:
- @$(GENERATOR) \
- --script-input $(FRAMEWORK)/source/class \
- --resource-input $(FRAMEWORK)/source/resource \
- --resource-output api/resource/qooxdoo \
- --script-input $(API)/source/class \
- --resource-input $(API)/source/resource \
- --resource-output api/resource \
- --include api \
- $(OPTIMIZESTR) $(OPTIMIZEVAR) \
- --generate-compiled-script \
- --compiled-script-file api/script/api.js \
- --define-runtime-setting qx.manager.object.AliasManager.resourceUri:resource/qooxdoo \
- --define-runtime-setting api.Viewer.title:Swat \
- --copy-resources \
- --cache-directory $(CACHE)
-
-generate-api-data:
- @$(GENERATOR) \
- --script-input $(FRAMEWORK)/source/class \
- --script-input $(API)/source/class \
- --script-input source/class \
- --generate-api-documentation \
- --api-documentation-json-file build/script/data.js \
- --cache-directory $(CACHE)
-
-generate-pretty:
- @$(GENERATOR) \
- --script-input source/class \
- --script-input $(FRAMEWORK)/source/class \
- --include-without-dependencies api.* \
- --pretty-print \
- --cache-directory $(CACHE)
-
-generate-fix:
- @$(GENERATOR) \
- --script-input source/class \
- --script-input $(FRAMEWORK)/source/class \
- --include-without-dependencies api.* \
- --fix-source \
- --cache-directory $(CACHE)
-
-
-
-###################################################################################
-# ADDITIONAL TARGETS
-###################################################################################
-
-copy-build-files:
- @echo
- @echo " CREATE COPY OF HTML FILE"
- @echo "----------------------------------------------------------------------------"
- @echo " * Copying file..."
- @cp -f source/index.html build/index.html
-
-fix-build-rights:
- @echo
- @echo " FIX RIGHTS ON BUILD FILES"
- @echo "----------------------------------------------------------------------------"
- @echo " * Fixing file rights..."
- @nice -n $(NICE) find build -type d | xargs chmod a+rx
- @nice -n $(NICE) find build -type f | xargs chmod a+r
-
-
-
-
-
-###################################################################################
-# INFO TARGETS
-###################################################################################
-
-info-build:
- @echo "****************************************************************************"
- @echo " GENERATING SWAT WEB APPLICATION BUILD"
- @echo "****************************************************************************"
-
-info-source:
- @echo "****************************************************************************"
- @echo " GENERATING SWAT WEB APPLICATION SOURCE"
- @echo "****************************************************************************"
+
+include $(QOOXDOO_PATH)/frontend/framework/tool/make/apiviewer.mk
+
+APPLICATION_CLASSNAME = $(APPLICATION_NAMESPACE).main.Main
+APPLICATION_LINEBREAKS_BUILD = true
+APPLICATION_LINEBREAKS_SOURCE = true
+APPLICATION_OPTIMIZE_STRINGS = false
+APPLICATION_OPTIMIZE_VARIABLES = false
+APPLICATION_ADDITIONAL_CLASS_PATH = \
+ --class-path $(APIVIEWER_PATH)/source/class
+APPLICATION_ADDITIONAL_RESOURCE = \
+ --resource-input $(APIVIEWER_PATH)/source/resource \
+ --resource-output $(APPLICATION_BUILD_PATH)/resource/apiviewer \
+ --define-runtime-setting apiviewer.resourceUri:$(APPLICATION_PAGE_TO_TOPLEVEL)/resource/apiviewer
+APPLICATION_RESOURCE_FILTER = true
+APPLICATION_COMPLETE_SOURCE = false
+
+
+################################################################################
+# INCLUDE CORE
+################################################################################
+
+ifneq ($(QOOXDOO_PATH),PLEASE_DEFINE_QOOXDOO_PATH)
+ include $(QOOXDOO_PATH)/frontend/framework/tool/make/targets.mk
+ include $(QOOXDOO_PATH)/frontend/framework/tool/make/application.mk
+endif
+
+error:
+ @echo " * Please configure QOOXDOO_PATH"