summaryrefslogtreecommitdiff
path: root/webapps/qooxdoo-0.6.5-sdk/frontend/Makefile
blob: 299aeaab20c3863cd83947ab6f99a76b92a4122f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
################################################################################
#
#  qooxdoo - the new era of web development
#
#  http://qooxdoo.org
#
#  Copyright:
#    2006-2007 1&1 Internet AG, Germany, http://www.1and1.org
#
#  License:
#    LGPL: http://www.gnu.org/licenses/lgpl.html
#    EPL: http://www.eclipse.org/org/documents/epl-v10.php
#    See the LICENSE file in the project's top-level directory for details.
#
#  Authors:
#    * Sebastian Werner (wpbasti)
#    * Andreas Ecker (ecker)
#    * Fabian Jakobs (fjakobs)
#
################################################################################

################################################################################
# PUBLIC VARIABLES
################################################################################

QOOXDOO_PATH = ..




################################################################################
# INCLUDE CORE
################################################################################

include $(QOOXDOO_PATH)/frontend/framework/tool/make/framework.mk





################################################################################
# PRIVATE VARIABLES
################################################################################

RELEASE_BUILD_UNIX = release/temp/build/unix/qooxdoo-$(FRAMEWORK_VERSION)-build
RELEASE_BUILD_DOS = release/temp/build/dos/qooxdoo-$(FRAMEWORK_VERSION)-build

RELEASE_SDK_UNIX = release/temp/sdk/unix/qooxdoo-$(FRAMEWORK_VERSION)-sdk
RELEASE_SDK_DOS = release/temp/sdk/dos/qooxdoo-$(FRAMEWORK_VERSION)-sdk

APPLICATIONS = apiviewer feedreader sample showcase webmail
SDK_COPY = Makefile application/Makefile application/index.html







################################################################################
# COMMON TARGETS
################################################################################

source:
	@$(MAKE) -s -C application source

build:
	@$(MAKE) -s -C application build

api:
	@$(MAKE) -s -C application api

all:
	@$(MAKE) -s -C application all

locales:
	@$(MAKE) -s -C application locales

pretty: framework-pretty
	@$(MAKE) -s -C application pretty

fix: framework-fix
	@$(MAKE) -s -C application fix

publish:
	@$(MAKE) -s -C application publish

clean:
	@$(MAKE) -s -C application clean

distclean:
	@$(MAKE) -s -C application distclean
	@$(MAKE) -s release-distclean
	@$(MAKE) -s framework-distclean






################################################################################
# FRAMEWORK TARGETS
################################################################################

framework-distclean:
	@echo
	@echo "****************************************************************************"
	@echo "  CLEANING UP FRAMEWORK COMPLETELY"
	@echo "****************************************************************************"
	@echo "  * Cleaning up..."
	@$(CMD_REMOVE) $(FRAMEWORK_CACHE_PATH)
	@$(CMD_REMOVE) $(FRAMEWORK_LOCALE_CLASS_PATH)
	@$(CMD_REMOVE) $(FRAMEWORK_TRANSLATION_CLASS_PATH)
	@$(CMD_REMOVE) application/skeleton.tar.gz
	@$(CMD_REMOVE) application/skeleton.zip
	@$(CMD_FIND) $(FRAMEWORK_PATH) $(FILES_TEMP) -exec $(CMD_REMOVE) {} \;
	@$(CMD_REMOVE) $(FRAMEWORK_TOOL_PATH)/icon/temp


framework-pretty:
	@echo
	@echo "****************************************************************************"
	@echo "  PRETTIFYING FRAMEWORK CLASSES"
	@echo "****************************************************************************"
	@$(CMD_GENERATOR) \
	  --pretty-print \
	  --class-path $(FRAMEWORK_SOURCE_PATH)/$(FRAMEWORK_CLASS_FOLDERNAME)

framework-fix:
	@echo
	@echo "****************************************************************************"
	@echo "  FIXING FRAMEWORK CLASSES"
	@echo "****************************************************************************"
	@$(CMD_GENERATOR) \
	  --fix-source \
	  --class-path $(FRAMEWORK_SOURCE_PATH)/$(FRAMEWORK_CLASS_FOLDERNAME)




################################################################################
# MIGRATION TARGETS
################################################################################


checkout-migration:
	@echo
	@echo "****************************************************************************"
	@echo "  MIGRATE CHECKOUT"
	@echo "****************************************************************************"
	@if [ 1 ]; then \
	  migrate_options="--class-path framework/source/class --migration-input application/sample/source/html/"; \
	  for APPLICATION in $(APPLICATIONS); do \
	    if [ -d application/$$APPLICATION/source/class ]; then \
	      migrate_options="$${migrate_options} --class-path application/$$APPLICATION/source/class"; \
	    fi; \
	  done; \
	  $(CMD_GENERATOR) \
	    --migrate-source --migration-target `echo $(FRAMEWORK_VERSION) | cut -d'-' -f1` \
	    $${migrate_options}; \
	 fi;







################################################################################
# SKELETON TARGETS
################################################################################

SKELETON_TEMP_UNIX = temp-skeleton-unix
SKELETON_TEMP_DOS = temp-skeleton-dos

SKELETON_FILES = Makefile source/class source/resource source/index.html


info-skeleton-unix:
	@echo
	@echo "****************************************************************************"
	@echo "  GENERATING UNIX VERSION OF SKELETON"
	@echo "****************************************************************************"

info-skeleton-dos:
	@echo
	@echo "****************************************************************************"
	@echo "  GENERATING DOS VERSION OF SKELETON"
	@echo "****************************************************************************"

skeleton-unix: info-skeleton-unix exec-skeleton-unix exec-skeleton-unix-post exec-skeleton-unix-clean
skeleton-dos: info-skeleton-dos exec-skeleton-dos exec-skeleton-dos-post exec-skeleton-dos-clean

exec-skeleton-unix: exec-skeleton-unix-collect exec-skeleton-unix-archive
exec-skeleton-dos: exec-skeleton-dos-collect exec-skeleton-dos-archive

exec-skeleton-unix-collect:
	@echo "  * Collecting skeleton files..."
	@for FILE in $(SKELETON_FILES); do \
    	echo "    - $$FILE"; \
    	$(CMD_DIR) `dirname $(SKELETON_TEMP_UNIX)/skeleton/$$FILE`; \
	  	$(CMD_SYNC_OFFLINE) application/skeleton/$$FILE `dirname $(SKELETON_TEMP_UNIX)/skeleton/$$FILE`; \
  	done

exec-skeleton-unix-archive:
	@echo "  * Cleaning up target folders..."
	@$(CMD_FIND) $(SKELETON_TEMP_UNIX) $(FILES_TEMP) -exec $(CMD_REMOVE) {} \;

	@echo "  * Switching to Unix line endings..."
	@$(CMD_FIND) $(SKELETON_TEMP_UNIX) $(FILES_TEXT) $(CMD_ANY2UNIX)

	@echo "  * Fixing executables..."
	@$(CMD_FIND) $(SKELETON_TEMP_UNIX) $(FILES_EXEC) -exec $(CMD_MKEXEC) {} \;

	@echo "  * Building skeleton archive..."
	@$(CMD_REMOVE) $(SKELETON_TEMP_UNIX)/skeleton.tar.gz
	@cd $(SKELETON_TEMP_UNIX); $(CMD_TAR_CREATE) skeleton.tar.gz skeleton
	@$(CMD_REMOVE) $(SKELETON_TEMP_UNIX)/skeleton

exec-skeleton-dos-collect:
	@echo "  * Collecting skeleton files..."
	@for FILE in $(SKELETON_FILES); do \
    	echo "    - $$FILE"; \
    	$(CMD_DIR) `dirname $(SKELETON_TEMP_DOS)/skeleton/$$FILE`; \
	  	$(CMD_SYNC_OFFLINE) application/skeleton/$$FILE `dirname $(SKELETON_TEMP_DOS)/skeleton/$$FILE`; \
  	done

exec-skeleton-dos-archive:
	@echo "  * Cleaning up target folders..."
	@$(CMD_FIND) $(SKELETON_TEMP_DOS) $(FILES_TEMP) -exec $(CMD_REMOVE) {} \;

	@echo "  * Switching to DOS line endings..."
	@$(CMD_FIND) $(SKELETON_TEMP_DOS) $(FILES_TEXT) $(CMD_ANY2DOS)

	@echo "  * Fixing executables..."
	@$(CMD_FIND) $(SKELETON_TEMP_DOS) $(FILES_EXEC) -exec $(CMD_MKEXEC) {} \;

	@echo "  * Building skeleton archive..."
	@$(CMD_REMOVE) $(SKELETON_TEMP_DOS)/skeleton.zip
	@cd $(SKELETON_TEMP_DOS); $(CMD_ZIP_CREATE) skeleton.zip skeleton
	@$(CMD_REMOVE) $(SKELETON_TEMP_DOS)/skeleton

exec-skeleton-unix-post:
	@$(CMD_SYNC_OFFLINE) $(SKELETON_TEMP_UNIX)/skeleton.tar.gz application/
	@echo
	@echo "  * Created application/skeleton.tar.gz"
	@echo "    Please extract to a location outside this qooxdoo folder."

exec-skeleton-dos-post:
	@$(CMD_SYNC_OFFLINE) $(SKELETON_TEMP_DOS)/skeleton.zip application/
	@echo
	@echo "  * Created application/skeleton.zip"
	@echo "    Please extract to a location outside this qooxdoo folder."

exec-skeleton-unix-clean:
	@$(CMD_REMOVE) $(SKELETON_TEMP_UNIX)

exec-skeleton-dos-clean:
	@$(CMD_REMOVE) $(SKELETON_TEMP_DOS)








################################################################################
# RELEASE TARGETS
################################################################################

release-distclean:
	@echo
	@echo "****************************************************************************"
	@echo "  CLEANING UP RELEASE COMPLETELY"
	@echo "****************************************************************************"
	@echo "  * Cleaning up..."
	@$(CMD_REMOVE) release




release: release-sdk release-build
release-fast: release-build-fast release-sdk-fast




release-build: build release-build-fast
release-build-fast: release-build-info release-build-unix release-build-dos

release-build-info:
	@echo
	@echo "****************************************************************************"
	@echo "  GENERATING BUILD VERSION OF RELEASE $(FRAMEWORK_VERSION)"
	@echo "****************************************************************************"

release-build-unix:
	@echo
	@echo "  SYNCHRONISATION OF BUILD RELEASE (UNIX VERSION)"
	@echo "----------------------------------------------------------------------------"

	@echo "  * Copying info files..."
	@$(CMD_DIR) $(RELEASE_BUILD_UNIX)
	@for FILE in `find ../ -maxdepth 1 -type f -name "[A-Z]*"`; do \
	  echo "    - `basename $$FILE`"; \
	  cp -f $$FILE $(RELEASE_BUILD_UNIX); \
	done

	@echo "  * Synchronizing applications..."
	@for APPLICATION in $(APPLICATIONS); do \
		echo "    - $$APPLICATION"; \
	  $(CMD_DIR) $(RELEASE_BUILD_UNIX)/frontend/$$APPLICATION; \
		if [ ! -r application/$$APPLICATION/build ]; then \
		  echo "      - Missing build folder! Run $(MAKE) build first!"; \
		  exit 1; \
		fi; \
	  $(CMD_SYNC_OFFLINE) application/$$APPLICATION/build/* $(RELEASE_BUILD_UNIX)/frontend/$$APPLICATION; \
	done
	@echo "  * Generating index.html..."
	@cat application/index.html | \
		sed 's/class="source"/class="source hide"/g' | \
		sed 's/class="build"//g' > $(RELEASE_BUILD_UNIX)/frontend/index.html

	@echo "  * Switching to Unix line endings..."
	@$(CMD_FIND) $(RELEASE_BUILD_UNIX) $(FILES_TEXT) $(CMD_ANY2UNIX)

	@echo "  * Generating tar archive..."
	@cd release/temp/build/unix; $(CMD_REMOVE) qooxdoo-$(FRAMEWORK_VERSION)-build.tar.gz; $(CMD_NICE) tar cfzp ../../../qooxdoo-$(FRAMEWORK_VERSION)-build.tar.gz qooxdoo-$(FRAMEWORK_VERSION)-build

release-build-dos:
	@echo
	@echo "  SYNCHRONISATION OF BUILD RELEASE (DOS VERSION)"
	@echo "----------------------------------------------------------------------------"

	@echo "  * Copying info files..."
	@$(CMD_DIR) $(RELEASE_BUILD_DOS)
	@for FILE in `find ../ -maxdepth 1 -type f -name "[A-Z]*"`; do \
	  echo "    - `basename $$FILE`"; \
	  cp -f $$FILE $(RELEASE_BUILD_DOS); \
	done

	@echo "  * Synchronizing applications..."
	@for APPLICATION in $(APPLICATIONS); do \
		echo "    - $$APPLICATION"; \
	  $(CMD_DIR) $(RELEASE_BUILD_DOS)/frontend/$$APPLICATION; \
		if [ ! -r application/$$APPLICATION/build ]; then \
		  echo "      - Missing build folder! Run $(MAKE) build first!"; \
		  exit 1; \
		fi; \
	  $(CMD_SYNC_OFFLINE) application/$$APPLICATION/build/* $(RELEASE_BUILD_DOS)/frontend/$$APPLICATION; \
	done

	@echo "  * Generating index.html..."
	@cat application/index.html | \
		sed 's/class="source"/class="source hide"/g' | \
		sed 's/class="build"//g' > $(RELEASE_BUILD_DOS)/frontend/index.html

	@echo "  * Switching to DOS line endings..."
	@$(CMD_FIND) $(RELEASE_BUILD_DOS) $(FILES_TEXT) $(CMD_ANY2DOS)

	@echo "  * Generating zip archive..."
	@cd release/temp/build/dos; $(CMD_REMOVE) qooxdoo-$(FRAMEWORK_VERSION)-build.zip; $(CMD_NICE) zip -rq ../../../qooxdoo-$(FRAMEWORK_VERSION)-build.zip qooxdoo-$(FRAMEWORK_VERSION)-build









release-sdk: distclean release-sdk-fast
release-sdk-fast: release-sdk-info release-sdk-unix release-sdk-dos

release-sdk-info:
	@echo
	@echo "****************************************************************************"
	@echo "  GENERATING SDK VERSION OF RELEASE $(FRAMEWORK_VERSION)"
	@echo "****************************************************************************"

release-sdk-unix:
	@echo
	@echo "  SYNCHRONISATION OF SDK RELEASE (UNIX VERSION)"
	@echo "----------------------------------------------------------------------------"

	@echo "  * Copying info files..."
	@$(CMD_DIR) $(RELEASE_SDK_UNIX)
	@for FILE in `find ../ -maxdepth 1 -type f -name "[A-Z]*"`; do \
	  echo "    - `basename $$FILE`"; \
	  cp -f $$FILE $(RELEASE_SDK_UNIX); \
	done

	@echo "  * Synchronizing applications..."
	@for APPLICATION in $(APPLICATIONS); do \
		echo "    - $$APPLICATION"; \
	  $(CMD_DIR) $(RELEASE_SDK_UNIX)/frontend/application/$$APPLICATION; \
	  $(CMD_SYNC_OFFLINE) --exclude script --exclude build --exclude publish application/$$APPLICATION/* $(RELEASE_SDK_UNIX)/frontend/application/$$APPLICATION; \
	done

	@echo "  * Synchronizing framework..."
	@$(CMD_DIR) $(RELEASE_SDK_UNIX)/frontend/framework
	@$(CMD_SYNC_OFFLINE) --exclude .cache --exclude tool/icon/themes --exclude tool/icon/temp framework/* $(RELEASE_SDK_UNIX)/frontend/framework

	@echo "  * Copying remaining SDK files..."
	@for ITEM in $(SDK_COPY); do \
	  cp -f $$ITEM $(RELEASE_SDK_UNIX)/frontend/$$ITEM; \
	done

	@$(MAKE) -s exec-skeleton-unix
	@$(CMD_SYNC_OFFLINE) $(SKELETON_TEMP_UNIX)/skeleton.tar.gz $(RELEASE_SDK_UNIX)/frontend/application/
	@$(MAKE) -s exec-skeleton-unix-clean

	@echo "  * Generating tar archive..."
	@cd release/temp/sdk/unix; $(CMD_REMOVE) qooxdoo-$(FRAMEWORK_VERSION)-sdk.tar.gz; $(CMD_TAR_CREATE) ../../../qooxdoo-$(FRAMEWORK_VERSION)-sdk.tar.gz qooxdoo-$(FRAMEWORK_VERSION)-sdk

release-sdk-dos:
	@echo
	@echo "  SYNCHRONISATION OF SDK RELEASE (DOS VERSION)"
	@echo "----------------------------------------------------------------------------"

	@echo "  * Copying info files..."
	@$(CMD_DIR) $(RELEASE_SDK_DOS)
	@for FILE in `find ../ -maxdepth 1 -type f -name "[A-Z]*"`; do \
	  echo "    - `basename $$FILE`"; \
	  cp -f $$FILE $(RELEASE_SDK_DOS); \
	done

	@echo "  * Synchronizing applications..."
	@for APPLICATION in $(APPLICATIONS); do \
		echo "    - $$APPLICATION"; \
	  $(CMD_DIR) $(RELEASE_SDK_DOS)/frontend/application/$$APPLICATION; \
	  $(CMD_SYNC_OFFLINE) --exclude script --exclude build --exclude publish application/$$APPLICATION/* $(RELEASE_SDK_DOS)/frontend/application/$$APPLICATION; \
	done

	@echo "  * Synchronizing framework..."
	@$(CMD_DIR) $(RELEASE_SDK_DOS)/frontend/framework
	@$(CMD_SYNC_OFFLINE) --exclude .cache --exclude tool/icon/themes --exclude tool/icon/temp framework/* $(RELEASE_SDK_DOS)/frontend/framework

	@echo "  * Copying remaining SDK files..."
	@for ITEM in $(SDK_COPY); do \
	  cp -f $$ITEM $(RELEASE_SDK_DOS)/frontend/$$ITEM; \
	done

	@$(MAKE) -s exec-skeleton-dos
	@$(CMD_SYNC_OFFLINE) $(SKELETON_TEMP_DOS)/skeleton.zip $(RELEASE_SDK_DOS)/frontend/application/
	@$(MAKE) -s exec-skeleton-dos-clean

	@echo "  * Generating zip archive..."
	@cd release/temp/sdk/dos; $(CMD_REMOVE) qooxdoo-$(FRAMEWORK_VERSION)-sdk.zip; $(CMD_ZIP_CREATE) ../../../qooxdoo-$(FRAMEWORK_VERSION)-sdk.zip qooxdoo-$(FRAMEWORK_VERSION)-sdk