]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/xul/staff_client/Makefile
I'm not going to bother parsing the svn keyword for now, so this looks better like...
[Evergreen.git] / Open-ILS / xul / staff_client / Makefile
1 # ILS/Open-ILS/xul/staff_client/Makefile
2
3 export STAFF_CLIENT_BUILD_ID = $$(/bin/cat build/BUILD_ID)
4 ifeq ($(origin $(OPENSRF_LIBS)), undefined)
5         # Reasonable default when making the client outside of the root dir
6         OPENSRF_JSLIBS := "/openils/lib/javascript"
7 else
8         OPENSRF_JSLIBS := "$(OPENSRF_LIBS)/javascript"
9 endif
10
11 all: build 
12         @echo
13         @echo
14
15 build: build_dir generated open-ils custom stamp 
16         @echo
17         @echo 
18         @echo To test the staff client:
19         @echo "  cd build/"
20         @echo "  xulrunner application.ini"
21
22 build_dir:
23         @echo
24         @echo '*********************************************************  Creating and populating build/ '
25         mkdir -p build/
26         cp -R chrome build/
27         cp -R server build/
28         cp -R defaults build/
29         cp -R components build/
30         cp application.ini build/
31         cp -R build/chrome/content/util/ build/server/
32         cp -R build/chrome/content/auth/ build/server/
33         cp build/chrome/content/main/constants.js build/server/main/constants.js
34         cp build/chrome/content/main/simple_auth.xul build/server/main/simple_auth.xul
35         cp build/chrome/content/OpenILS/data.js build/server/OpenILS/data.js
36         cp build/chrome/content/OpenILS/global_util.js build/server/OpenILS/global_util.js
37         @echo 
38         # Is the following portable?
39         for i in `cd ../../../Evergreen/xul/staff_client/server/ && find -type f |grep -v \.svn|cut -f2- -d/`; do cp ../../../Evergreen/xul/staff_client/server/$$i build/server/$$i; done
40         external/prune_dirs.sh build/
41
42 stamp: 
43         @echo
44         @/bin/date +"%Y%m%d.%H%M%S" > build/BUILD_ID
45         @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
46         @if [ -z "${STAFF_CLIENT_BUILD_ID}" ]; then ( echo "No Build ID for versioning" ; echo "none" > build/BUILD_ID ) ; fi
47         @if [ -n "${STAFF_CLIENT_BUILD_ID}" ]; then sed -i s/^Version=.\*/Version=${STAFF_CLIENT_BUILD_ID}/ build/application.ini ; fi
48         @if [ -n "${STAFF_CLIENT_BUILD_ID}" ]; then sed -i s/^BuildID=.\*/BuildID=${STAFF_CLIENT_BUILD_ID}/ build/application.ini ; fi
49         @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
50         @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
51         @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
52         @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
53         @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
54
55 generated:
56         @echo
57         @echo '********************************************************* Grabbing lang.dtd from the OPAC code '
58         cp ../../../Open-ILS/web/opac/locale/en-US/lang.dtd build/chrome/locale/en-US/
59         # Generate the lang.js file for the stamped build
60         external/dtd2js.pl build/chrome/locale/en-US/lang.dtd > build/chrome/content/main/lang.js
61         cp build/chrome/content/main/lang.js build/server/main/lang.js
62
63 open-ils:
64         @echo
65         @echo '********************************************************* Grabbing more OPAC code and legacy code and custom code'
66         #cp ../../../OpenSRF/src/javascript/*.js build/chrome/content/OpenSRF/
67         cp ../../../Open-ILS/web/opac/common/js/*.js build/chrome/content/OpenILS/util/
68         cp $(OPENSRF_JSLIBS)/*.js build/chrome/content/OpenILS/util/
69         external/prune_dirs.sh build/
70
71 custom:
72         @echo
73         @echo
74         @echo '********************************************************* Placeholder for debugging tweaks '
75         #(cd chrome/content/OpenILS/util; cp RemoteRequest.js~ RemoteRequest.js)
76
77 clean: 
78         @echo
79         @echo '********************************************************* Removing build/ '
80         rm -rf build/