X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=Makefile;h=ec2a1fa45bc03f1fcc3d4845779da7eb226784b1;hb=refs%2Fheads%2Ftizen;hp=3a1cc68906e05860aed4175065b5c9e22ecd65e0;hpb=7429448778474d221e384ae1ea329b9251cc57fb;p=platform%2Fframework%2Fweb%2Fweb-ui-fw.git diff --git a/Makefile b/Makefile old mode 100755 new mode 100644 index 3a1cc68..ec2a1fa --- a/Makefile +++ b/Makefile @@ -9,9 +9,10 @@ PKG_VERSION = $(shell cat packaging/web-ui-fw.spec | grep Version: | sed -e "s@V THEME_NAME = default PATH := $(CURDIR)/build-tools/bin:$(PATH) +NODE = /usr/bin/node JSLINT_LEVEL = 1 -JSLINT = jslint --sloppy --eqeq --bitwise --forin --nomen --predef jQuery --color --plusplus --browser --jqmspace +JSLINT = jslint --sloppy --eqeq --bitwise --forin --nomen --predef jQuery --color --plusplus --browser --jqmspace --regexp --continue COMMON_WIDGET = common INLINE_PROTO = 1 OUTPUT_ROOT = $(CURDIR)/build @@ -20,14 +21,15 @@ FRAMEWORK_ROOT = ${OUTPUT_ROOT}/${PROJECT_NAME}/${VERSION} LATEST_ROOT = ${OUTPUT_ROOT}/${PROJECT_NAME}/latest JS_OUTPUT_ROOT = ${FRAMEWORK_ROOT}/js +JS_LIB_OUTPUT_DIR = ${JS_OUTPUT_ROOT}/src export THEME_OUTPUT_ROOT = ${FRAMEWORK_ROOT}/themes CSS_OUTPUT_ROOT = ${FRAMEWORK_ROOT}/themes/${THEME_NAME} CSS_IMAGES_OUTPUT_DIR = ${CSS_OUTPUT_ROOT}/images WIDGET_CSS_OUTPUT_ROOT = ${FRAMEWORK_ROOT}/widget-css PROTOTYPE_HTML_OUTPUT_DIR = proto-html -WIDGETS_DIR = $(CURDIR)/src/widgets - +JS_DIR = $(CURDIR)/src/js +WIDGETS_DIR = ${JS_DIR}/widgets THEMES_DIR = $(CURDIR)/src/themes LIBS_DIR = $(CURDIR)/libs @@ -49,11 +51,12 @@ FW_LIBS_JS = ${JS_OUTPUT_ROOT}/${PROJECT_NAME}-libs.js FW_THEME_CSS_FILE = ${PROJECT_NAME}-theme.css FW_WIDGET_CSS_FILE = ${WIDGET_CSS_OUTPUT_ROOT}/${PROJECT_NAME}-widget.css -LIBS_JS_FILES = jlayout/jquery.sizes.js \ - jquery.easing.1.3.js \ - jquery.tmpl.js \ - jquery.mobile.js \ - $(NULL) +LIBS_JS_FILES = jquery.easing.1.3.js \ + jquery.tmpl.js \ + jquery.mobile.js \ + globalize/lib/globalize.js \ + gl-matrix.js \ + $(NULL) JQUERY_MOBILE_CSS = submodules/jquery-mobile/compiled/jquery.mobile.structure.css \ submodules/jquery-mobile/compiled/jquery.mobile.css \ @@ -66,19 +69,7 @@ JQM_LIB_PATH = $(CURDIR)/libs/js/${JQM_VERSION} JQUERY = jquery-1.8.2.js JQUERY_MIN = $(subst .js,.min.js,$(JQUERY)) -LIBS_CSS_FILES = -ifeq (${DEBUG},yes) -LIBS_CSS_FILES +=\ - $(CURDIR)/src/jqm/compiled/jquery.mobile-1.0rc2pre.css \ - $(NULL) -else -LIBS_CSS_FILES +=\ - $(CURDIR)/src/jqm/compiled/jquery.mobile-1.0rc2pre.min.css \ - $(NULL) -endif - - -all: libs_prepare third_party widgets libs_cleanup loader themes version version_compat compress +all: libs_prepare third_party js libs_cleanup themes version version_compat compress libs_prepare: # Prepare libs/ build... @@ -99,7 +90,7 @@ jqm: init cd ${JQM_LIB_PATH} && make js NODE=/usr/bin/node || exit 1; \ cp -f ${JQM_LIB_PATH}/compiled/*.js ${JQM_LIB_PATH}/../; \ -third_party: init jqm +third_party: init jqm globalize # Building third party components... @@cd ${LIBS_DIR}/js; \ for f in ${LIBS_JS_FILES}; do \ @@ -109,16 +100,37 @@ third_party: init jqm done; \ cp ${LIBS_DIR}/js/${JQUERY} ${JS_OUTPUT_ROOT}/jquery.js cp ${LIBS_DIR}/js/${JQUERY_MIN} ${JS_OUTPUT_ROOT}/jquery.min.js - @@cd ${LIBS_DIR}/css; \ - for f in ${LIBS_CSS_FILES}; do \ - cat $$f >> ${FW_CSS}; \ - done; \ - cp -r images/* ${CSS_IMAGES_OUTPUT_DIR} - - #@@cp -a ${LIBS_DIR}/images ${FRAMEWORK_ROOT}/ +js: init third_party + # Building JS files... + mkdir -p ${JS_LIB_OUTPUT_DIR}; \ + cp -a ${JS_DIR}/* ${JS_LIB_OUTPUT_DIR}/; \ + ${NODE} $(CURDIR)/tools/moduledep.js -c ${JS_LIB_OUTPUT_DIR} > ${JS_LIB_OUTPUT_DIR}/../depData.json; \ + find ${JS_LIB_OUTPUT_DIR} -iname '*.js' | sort | \ + while read JSFILE; do \ + echo " # Building $$JSFILE"; \ + sed -i -e '/^\/\/>>excludeStart\(.*\);/,/^\/\/>>excludeEnd\(.*\);/d' $$JSFILE; \ + if test ${JSLINT_LEVEL} -ge 1; then \ + ${JSLINT} $$JSFILE; \ + if test ${JSLINT_LEVEL} -ge 2 -a $$? -ne 0; then \ + exit 1; \ + fi; \ + fi; \ + if test "x${INLINE_PROTO}x" = "x1x"; then \ + echo " $$f (include inline-proto if exists)"; \ + ./tools/inline-protos.sh $$JSFILE > $$JSFILE.compiled; \ + rm -f $$JSFILE; \ + mv $$JSFILE.compiled $$JSFILE; \ + else \ + echo " $$f"; \ + fi; \ + done; \ + ${NODE} $(CURDIR)/tools/moduledep.js -d ${JS_LIB_OUTPUT_DIR} ${JS_LIB_OUTPUT_DIR}/../depData.json >> ${FW_JS}; \ + cp -a ${JS_DIR}/* ${JQM_LIB_PATH}/js/* ${JS_LIB_OUTPUT_DIR}/; \ + ${NODE} $(CURDIR)/tools/moduledep.js -c ${JS_LIB_OUTPUT_DIR} > ${JS_LIB_OUTPUT_DIR}/../depData.json; \ + find ${JS_LIB_OUTPUT_DIR} -iname '*.js' | xargs sed -i -e '/^\/\/>>excludeStart\(.*\);/,/^\/\/>>excludeEnd\(.*\);/d'; -widgets: init third_party +widgets: init third_party globalize # Building widgets... @@ls -l ${WIDGETS_DIR} | grep '^d' | awk '{print $$NF;}' | \ while read REPLY; do \ @@ -166,25 +178,18 @@ widgets: init third_party fi; \ done - -loader: widgets globalize - cat 'src/loader/loader.js' >> ${FW_JS} - - -globalize: widgets - cat 'libs/js/globalize/lib/globalize.js' >> ${FW_JS} +globalize: # copy globalize libs... cp -a libs/js/globalize/lib/cultures ${FRAMEWORK_ROOT}/js/ - themes: make -C src/themes || exit $? -version: loader themes +version: js themes echo '(function($$){$$.tizen.frameworkData.pkgVersion="$(PKG_VERSION)";}(jQuery));' >> ${FW_JS} echo "$(PKG_VERSION)" > ${FRAMEWORK_ROOT}/../VERSION -compress: widgets loader themes +compress: third_party js themes # Javacript code compressing @@echo " # Compressing...."; \ echo '/*' > ${FW_MIN}; \ @@ -217,14 +222,14 @@ docs: init cat docs/index.footer >> docs/index.html -version_compat: third_party widgets +version_compat: third_party js # Creating compatible version dirs... for v_compat in ${VERSION_COMPAT}; do \ ln -sf ${VERSION} ${FRAMEWORK_ROOT}/../$$v_compat; \ done; ln -sf ${VERSION} ${FRAMEWORK_ROOT}/../latest -demo: widgets +demo: js mkdir -p ${OUTPUT_ROOT}/demos cp -av demos/* ${OUTPUT_ROOT}/demos/ cp -f src/template/bootstrap.js ${OUTPUT_ROOT}/demos/gallery/