1 ###################################################################################
3 ###################################################################################
5 QOOXDOO = ../qooxdoo-0.6.3-sdk
7 APPCLASS = swat.main.Main
9 OPTIMIZESTRINGS = false
10 OPTIMIZEVARIABLES = false
13 LOCALINSTALLDIR = /usr/local/samba/share/swat/apps/swat
16 ###################################################################################
18 ###################################################################################
20 FRONTEND = $(QOOXDOO)/frontend
21 FRAMEWORK = $(FRONTEND)/framework
23 CACHE = $(FRAMEWORK)/.cache
24 GENERATOR = $(FRAMEWORK)/tool/generator.py
27 ifeq ($(INCLUDEALL),false)
28 INCLUDE = --include $(APPCLASS)
33 ifeq ($(OPTIMIZESTRINGS),true)
34 OPTIMIZESTR = --optimize-strings
39 ifeq ($(OPTIMIZEVARIABLES),true)
40 OPTIMIZEVAR = --optimize-variables
45 ifneq ($(SOURCELOADER),)
46 SOURCELDR = --source-loader-type $(SOURCELOADER)
52 ###################################################################################
54 ###################################################################################
60 ###################################################################################
62 ###################################################################################
65 generate-script-source \
69 generate-script-build \
74 api: generate-api-build generate-api-data
76 @echo " CREATE COPY OF HTML FILE"
77 @echo "----------------------------------------------------------------------------"
78 @echo " * Copying file..."
79 @cp -f $(API)/source/index.html api/index.html
81 pretty: generate-pretty
86 ###################################################################################
88 ###################################################################################
92 @echo " CLEANUP OF GENERATED FILES"
93 @echo "----------------------------------------------------------------------------"
94 @echo " * Deleting files..."
95 @rm -f source/script/$(SCRIPTNAME) build/script/$(SCRIPTNAME)
99 @echo " CLEANUP OF GENERATED FILES (REAL)"
100 @echo "----------------------------------------------------------------------------"
101 @echo " * Deleting files..."
102 @nice -n $(NICE) rm -rf build
106 @echo " CLEANUP OF GENERATED FILES (DIST)"
107 @echo "----------------------------------------------------------------------------"
108 @echo " * Deleting files..."
109 @nice -n $(NICE) find . -name "*~" -o -name "*.bak" -o -name "*.old" | xargs rm -rf
110 @nice -n $(NICE) rm -rf $(CACHE)
114 ###################################################################################
116 ###################################################################################
118 generate-script-source:
119 @chmod u+x $(GENERATOR) && nice -n $(NICE) $(GENERATOR) \
120 --script-input $(FRAMEWORK)/source/class \
121 --source-script-path ../$(FRAMEWORK)/source/class \
122 --script-input $(API)/source/class \
123 --source-script-path ../$(API)/source/class \
124 --script-input source/class \
125 --source-script-path class \
126 --generate-source-script $(SOURCELDR) \
128 --source-script-file source/script/$(SCRIPTNAME) \
129 --define-runtime-setting qx.manager.object.AliasManager.resourceUri:../$(FRAMEWORK)/source/resource \
130 --cache-directory $(CACHE) \
134 # djl: --script-input begins a set for which --resource-input and
135 # --resource-output apply. Since there is a --resource-input and a
136 # --resource-output defined for one set, it must be defined for each set
138 generate-script-build:
139 @chmod u+x $(GENERATOR) && nice -n $(NICE) $(GENERATOR) \
140 --script-input $(FRAMEWORK)/source/class \
141 --resource-input $(FRAMEWORK)/source/resource \
142 --resource-output build/resource \
143 --script-input $(API)/source/class \
144 --resource-input $(API)/source/resource \
145 --resource-output build/resource \
146 --script-input source/class \
147 --resource-input source/resource \
148 --resource-output build/resource \
149 --generate-compiled-script \
150 $(INCLUDE) $(OPTIMIZESTR) $(OPTIMIZEVAR) \
151 --compiled-script-file build/script/$(SCRIPTNAME) \
153 --define-runtime-setting qx.manager.object.AliasManager.resourceUri:./resource \
154 --cache-directory $(CACHE) \
158 @chmod u+x $(GENERATOR) && nice -n $(NICE) $(GENERATOR) \
159 --script-input $(FRAMEWORK)/source/class \
160 --resource-input $(FRAMEWORK)/source/resource \
161 --resource-output api/resource/qooxdoo \
162 --script-input $(API)/source/class \
163 --resource-input $(API)/source/resource \
164 --resource-output api/resource \
166 $(OPTIMIZESTR) $(OPTIMIZEVAR) \
167 --generate-compiled-script \
168 --compiled-script-file api/script/api.js \
169 --define-runtime-setting qx.manager.object.AliasManager.resourceUri:resource/qooxdoo \
170 --define-runtime-setting api.Viewer.title:Swat \
172 --cache-directory $(CACHE)
175 @chmod u+x $(GENERATOR) && nice -n $(NICE) $(GENERATOR) \
176 --script-input $(FRAMEWORK)/source/class \
177 --script-input $(API)/source/class \
178 --script-input source/class \
179 --generate-api-documentation \
180 --api-documentation-json-file build/script/data.js \
181 --cache-directory $(CACHE)
184 @chmod u+x $(GENERATOR) && nice -n $(NICE) $(GENERATOR) \
185 --script-input source/class \
186 --script-input $(FRAMEWORK)/source/class \
187 --include-without-dependencies api.* \
189 --cache-directory $(CACHE)
192 @chmod u+x $(GENERATOR) && nice -n $(NICE) $(GENERATOR) \
193 --script-input source/class \
194 --script-input $(FRAMEWORK)/source/class \
195 --include-without-dependencies api.* \
197 --cache-directory $(CACHE)
201 ###################################################################################
203 ###################################################################################
207 @echo " CREATE COPY OF HTML FILE"
208 @echo "----------------------------------------------------------------------------"
209 @echo " * Copying file..."
210 @cp -f source/index.html build/index.html
214 @echo " FIX RIGHTS ON BUILD FILES"
215 @echo "----------------------------------------------------------------------------"
216 @echo " * Fixing file rights..."
217 @nice -n $(NICE) find build -type d | xargs chmod a+rx
218 @nice -n $(NICE) find build -type f | xargs chmod a+r
224 ###################################################################################
226 ###################################################################################
229 @echo "****************************************************************************"
230 @echo " GENERATING SWAT WEB APPLICATION BUILD"
231 @echo "****************************************************************************"
234 @echo "****************************************************************************"
235 @echo " GENERATING SWAT WEB APPLICATION SOURCE"
236 @echo "****************************************************************************"
238 ###################################################################################
239 # INSTALL TARGETS (for developer use only)
240 ###################################################################################
243 @echo "****************************************************************************"
244 @echo " INSTALLING SWAT"
245 @echo "****************************************************************************"
246 @echo " * Installing swat files..."
247 @rsync -av --exclude=crystalsvg --delete build/ $(LOCALINSTALLDIR)