2009-04-26 06:43:27 +02:00
|
|
|
|
2010-03-14 06:04:09 +01:00
|
|
|
SRC_DIR = src
|
|
|
|
BUILD_DIR = build
|
|
|
|
DIST_DIR = dist
|
2010-09-19 07:54:35 +02:00
|
|
|
DEMOS_DIR = demos
|
2010-03-14 06:04:09 +01:00
|
|
|
OTHER_FILES = \
|
2010-09-19 07:54:35 +02:00
|
|
|
changelog.txt \
|
|
|
|
MIT-LICENSE.txt \
|
|
|
|
GPL-LICENSE.txt
|
|
|
|
|
|
|
|
VER = $$(cat version.txt)
|
2010-03-14 06:04:09 +01:00
|
|
|
VER_SED = sed s/@VERSION/"${VER}"/
|
2010-09-19 07:54:35 +02:00
|
|
|
DATE = $$(git log -1 --pretty=format:%ad)
|
2010-03-14 06:04:09 +01:00
|
|
|
DATE_SED = sed s/@DATE/"${DATE}"/
|
2009-09-08 05:37:35 +02:00
|
|
|
|
2010-09-19 07:54:35 +02:00
|
|
|
JQ = $$(sed -n "s/.*JQUERY\s*=\s*[\"']\(.*\)[\"'].*/\1/p" "${SRC_DIR}/_loader.js")
|
|
|
|
JQUI = $$(sed -n "s/.*JQUERY_UI\s*=\s*[\"']\(.*\)[\"'].*/\1/p" "${SRC_DIR}/_loader.js")
|
|
|
|
|
|
|
|
DEMO_FILES = $$(cd ${DEMOS_DIR}; find . -mindepth 1 -maxdepth 1 -type f)
|
|
|
|
DEMO_SUBDIRS = $$(cd ${DEMOS_DIR}; find . -mindepth 1 -maxdepth 1 -type d)
|
|
|
|
DEMO_RE = \(<script[^>]*_loader\.js[^>]*><\/script>\|<!--\[\[\|\]\]-->\)\s*
|
|
|
|
DEMO_SED = sed -n "1h;1!H;\$${;g;s/${DEMO_RE}//g;p;}"
|
|
|
|
|
|
|
|
JS_SED = sed -n "s/\s*js([\"']\(.*\)[\"']).*/\1/p"
|
|
|
|
CSS_SED = sed -n "s/\s*css([\"']\(.*\)[\"']).*/\1/p"
|
|
|
|
|
|
|
|
concat_js = \
|
|
|
|
files=$$(cat "$(1)/_loader.js" | ${JS_SED}); \
|
|
|
|
if [ -f "$(1)/intro.js" ]; then \
|
|
|
|
files="intro.js $$files"; \
|
|
|
|
fi; \
|
|
|
|
if [ -f "$(1)/outro.js" ]; then \
|
|
|
|
files="$$files outro.js"; \
|
|
|
|
fi; \
|
|
|
|
old=$$PWD; \
|
|
|
|
(cd "$(1)"; cat $$files; cd "$$old") \
|
|
|
|
| ${VER_SED} \
|
|
|
|
| ${DATE_SED} \
|
|
|
|
> "$(2)"
|
|
|
|
|
|
|
|
concat_css = \
|
|
|
|
files=$$(cat "$(1)/_loader.js" | ${CSS_SED}); \
|
|
|
|
if [ "$$files" ]; then \
|
|
|
|
old=$$PWD; \
|
|
|
|
(cd "$(1)"; cat $$files; cd "$$old") \
|
|
|
|
| ${VER_SED} \
|
|
|
|
| ${DATE_SED} \
|
|
|
|
> "$(2)"; \
|
|
|
|
fi
|
|
|
|
|
2009-04-26 06:43:27 +02:00
|
|
|
zip:
|
2010-03-14 06:04:09 +01:00
|
|
|
@rm -rf ${BUILD_DIR}/fullcalendar
|
|
|
|
@rm -rf ${BUILD_DIR}/fullcalendar-*
|
2010-09-19 07:54:35 +02:00
|
|
|
@mkdir -p ${BUILD_DIR}/fullcalendar/fullcalendar/
|
2009-09-08 09:50:23 +02:00
|
|
|
|
2010-09-19 07:54:35 +02:00
|
|
|
@echo "building core..."
|
|
|
|
@$(call concat_js,${SRC_DIR},"${BUILD_DIR}/fullcalendar/fullcalendar/fullcalendar.js")
|
|
|
|
@$(call concat_css,${SRC_DIR},"${BUILD_DIR}/fullcalendar/fullcalendar/fullcalendar.css")
|
2011-02-01 22:09:32 +01:00
|
|
|
@cat "${SRC_DIR}/common/print.css" \
|
|
|
|
| ${VER_SED} \
|
|
|
|
| ${DATE_SED} \
|
|
|
|
> "${BUILD_DIR}/fullcalendar/fullcalendar/fullcalendar.print.css"
|
2010-09-19 07:54:35 +02:00
|
|
|
|
|
|
|
@echo "compressing core js..."
|
|
|
|
@java -jar ${BUILD_DIR}/compiler.jar --warning_level VERBOSE --jscomp_off checkTypes --externs build/externs.js \
|
|
|
|
--js ${BUILD_DIR}/fullcalendar/fullcalendar/fullcalendar.js \
|
|
|
|
> ${BUILD_DIR}/fullcalendar/fullcalendar/fullcalendar.min.js; \
|
2010-03-14 06:04:09 +01:00
|
|
|
|
2010-09-19 07:54:35 +02:00
|
|
|
@echo "building plugins..."
|
|
|
|
@for loader in ${SRC_DIR}/*/_loader.js; do \
|
|
|
|
dir=`dirname $$loader`; \
|
|
|
|
name=`basename $$dir`; \
|
|
|
|
$(call concat_js,$$dir,"${BUILD_DIR}/fullcalendar/fullcalendar/$$name.js"); \
|
|
|
|
done
|
|
|
|
|
|
|
|
@echo "copying jquery..."
|
|
|
|
@mkdir -p ${BUILD_DIR}/fullcalendar/jquery
|
|
|
|
@cp lib/${JQ} ${BUILD_DIR}/fullcalendar/jquery
|
|
|
|
@cp lib/${JQUI} ${BUILD_DIR}/fullcalendar/jquery
|
|
|
|
|
|
|
|
@echo "building demos..."
|
|
|
|
@mkdir -p ${BUILD_DIR}/fullcalendar/demos
|
|
|
|
@for f in ${DEMO_FILES}; do \
|
|
|
|
cat ${DEMOS_DIR}/$$f \
|
|
|
|
| ${DEMO_SED} \
|
|
|
|
| sed "s/jquery\.js/${JQ}/" \
|
|
|
|
| sed "s/jquery-ui\.js/${JQUI}/" \
|
|
|
|
> ${BUILD_DIR}/fullcalendar/demos/$$f; \
|
2009-09-08 09:50:23 +02:00
|
|
|
done
|
2010-09-19 07:54:35 +02:00
|
|
|
@for d in ${DEMO_SUBDIRS}; do \
|
|
|
|
cp -r ${DEMOS_DIR}/$$d ${BUILD_DIR}/fullcalendar/demos/$$d; \
|
2010-03-14 06:04:09 +01:00
|
|
|
done
|
2010-09-19 07:54:35 +02:00
|
|
|
|
2010-03-14 06:04:09 +01:00
|
|
|
@echo "copying other files..."
|
|
|
|
@cp -r ${OTHER_FILES} ${BUILD_DIR}/fullcalendar
|
2010-09-19 07:54:35 +02:00
|
|
|
|
2009-09-08 09:50:23 +02:00
|
|
|
@echo "zipping..."
|
2010-03-14 06:04:09 +01:00
|
|
|
@mv ${BUILD_DIR}/fullcalendar ${BUILD_DIR}/fullcalendar-${VER}
|
|
|
|
@cd ${BUILD_DIR}; for f in fullcalendar-*; do \
|
|
|
|
zip -q -r $$f.zip $$f; \
|
2009-09-16 08:17:37 +02:00
|
|
|
done
|
2010-03-14 06:04:09 +01:00
|
|
|
@mv ${BUILD_DIR}/fullcalendar-${VER} ${BUILD_DIR}/fullcalendar
|
2009-09-08 09:50:23 +02:00
|
|
|
|
2010-03-14 06:04:09 +01:00
|
|
|
@mkdir -p ${DIST_DIR}
|
|
|
|
@mv ${BUILD_DIR}/fullcalendar-${VER}.zip ${DIST_DIR}
|
2009-09-08 09:50:23 +02:00
|
|
|
@echo "done."
|
2010-09-19 07:54:35 +02:00
|
|
|
|
2009-09-08 09:50:23 +02:00
|
|
|
clean:
|
2010-03-14 06:04:09 +01:00
|
|
|
@rm -rf ${BUILD_DIR}/fullcalendar
|
|
|
|
@rm -rf ${BUILD_DIR}/fullcalendar-*
|
|
|
|
@rm -rf ${DIST_DIR}/*
|
2009-11-23 05:45:19 +01:00
|
|
|
|