Start using automake/autoconf for configuring, building, and installing Evergreen
[Evergreen.git] / Open-ILS / xul / staff_client / Makefile.am
1 #---------------------------------------------------------
2 # Makefile.am for xul/staff_client
3 ## Process this file with automake to generate Makefile.in
4 #---------------------------------------------------------
5
6 export STAFF_CLIENT_BUILD_ID = $$(/bin/cat build/BUILD_ID)
7 OPENSRF_JSLIBS = "$(OPENSRF_LIBS)/javascript"
8
9 install-exec-local: build
10
11 build: build_dir generated open-ils stamp
12         @echo To test the staff client:
13         @echo "  cd build/"
14         @echo "  xulrunner application.ini"
15
16 build_dir:
17         @echo ' * Creating and populating build/ '
18         mkdir -p build/
19         cp -R chrome build/
20         cp -R server build/
21         cp -R defaults build/
22         cp -R components build/
23         cp application.ini build/
24         cp -R build/chrome/content/util/ build/server/
25         cp -R build/chrome/content/auth/ build/server/
26         cp build/chrome/content/main/constants.js build/server/main/constants.js
27         cp build/chrome/content/main/simple_auth.xul build/server/main/simple_auth.xul
28         cp build/chrome/content/OpenILS/data.js build/server/OpenILS/data.js
29         cp build/chrome/content/OpenILS/global_util.js build/server/OpenILS/global_util.js
30         for i in `cd @top_srcdir@/Evergreen/xul/staff_client/server/ && find -type f |grep -v \.svn|cut -f2- -d/`; do cp @top_srcdir@/Evergreen/xul/staff_client/server/$$i build/server/$$i; done
31         external/prune_dirs.sh build/
32
33 stamp:
34         @/bin/date +"%Y%m%d.%H%M%S" > build/BUILD_ID
35         @if [ -n "${STAFF_CLIENT_BUILD_ID}" ]; then ( echo "Stamping with Build ID: ${STAFF_CLIENT_BUILD_ID}" ; echo ${STAFF_CLIENT_BUILD_ID} > build/BUILD_ID ) ; fi
36         @if [ -z "${STAFF_CLIENT_BUILD_ID}" ]; then ( echo "No Build ID for versioning" ; echo "none" > build/BUILD_ID ) ; fi
37         @if [ -n "${STAFF_CLIENT_BUILD_ID}" ]; then sed -i s/^Version=.\*/Version=${STAFF_CLIENT_BUILD_ID}/ build/application.ini ; fi
38         @if [ -n "${STAFF_CLIENT_BUILD_ID}" ]; then sed -i s/^BuildID=.\*/BuildID=${STAFF_CLIENT_BUILD_ID}/ build/application.ini ; fi
39         @if [ -n "${STAFF_CLIENT_BUILD_ID}" ]; then find build/ -name '*.xul' -exec sed -i s/xul\\\/server/xul\\\/${STAFF_CLIENT_BUILD_ID}\\\/server/g {} \; ; fi
40         @if [ -n "${STAFF_CLIENT_BUILD_ID}" ]; then find build/ -name '*.html' -exec sed -i s/xul\\\/server/xul\\\/${STAFF_CLIENT_BUILD_ID}\\\/server/g {} \; ; fi
41         @if [ -n "${STAFF_CLIENT_BUILD_ID}" ]; then find build/ -name '*.xhtml' -exec sed -i s/xul\\\/server/xul\\\/${STAFF_CLIENT_BUILD_ID}\\\/server/g {} \; ; fi
42         @if [ -n "${STAFF_CLIENT_BUILD_ID}" ]; then find build/ -name '*.js' -exec sed -i s/xul\\\/server/xul\\\/${STAFF_CLIENT_BUILD_ID}\\\/server/g {} \; ; fi
43         @if [ -n "${STAFF_CLIENT_BUILD_ID}" ]; then find build/ -name '*.xml' -exec sed -i s/xul\\\/server/xul\\\/${STAFF_CLIENT_BUILD_ID}\\\/server/g {} \; ; fi
44
45 generated:
46         @echo ' * Grabbing lang.dtd from the OPAC code '
47         cp @top_srcdir@/Open-ILS/web/opac/locale/en-US/lang.dtd build/chrome/locale/en-US/
48
49 open-ils:
50         @echo ' * Grabbing more OPAC code and legacy code and custom code'
51         cp @top_srcdir@/Open-ILS/web/opac/common/js/*.js build/chrome/content/OpenILS/util/
52         cp $(OPENSRF_JSLIBS)/*.js build/chrome/content/OpenILS/util/
53         external/prune_dirs.sh build/
54
55