]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/xul/staff_client/Makefile
added some more utility code and css
[Evergreen.git] / Open-ILS / xul / staff_client / Makefile
1 # ILS/Open-ILS/xul/staff_client/Makefile
2
3 export STAFF_CLIENT_BUILD_ID = $$(/bin/date +"%Y%m%d.%H%M%S")
4
5 all: build 
6         @echo
7         @echo
8
9 build: remove_symlinks build_dir generated open-ils custom stamp add_symlinks 
10         @echo
11         @echo 
12         @echo To test the staff client:
13         @echo "  cd build/"
14         @echo "  xulrunner application.ini"
15
16 remove_symlinks:
17         @echo
18         @echo Removing convenience symlinks from server/ and chrome/ before copying to build/
19         find server/ -type l -exec rm -f {} \;
20         find chrome/ -type l -exec rm -f {} \;
21
22 add_symlinks:
23         @echo
24         @echo Adding convenience symlinks back into server/ and chrome/
25         ln -s ../chrome/content/util server/util
26         ln -s ../../chrome/content/main/constants.js server/main/constants.js
27         ln -s ../../chrome/content/OpenILS/data.js server/OpenILS/data.js
28         (cd build/chrome/content/OpenSRF/; for x in *; do ln -s  ../../../build/chrome/content/OpenSRF/$$x ../../../../chrome/content/OpenSRF/$$x; done)
29         (cd build/chrome/content/OpenILS/util/; for x in *; do if [ $$x != 'fmall.js' ]; then ln -s  ../../../../build/chrome/content/OpenILS/util/$$x ../../../../../chrome/content/OpenILS/util/$$x; fi ; done)
30         (cd build/chrome/content/legacy/; for x in [a-z]*; do ln -s  ../../../build/chrome/content/legacy/$$x ../../../../chrome/content/legacy/$$x; done)
31         (cd build/chrome/locale/en-US/; for x in *; do ln -s  ../../../build/chrome/locale/en-US/$$x ../../../../chrome/locale/en-US/$$x; done)
32
33 build_dir:
34         @echo
35         @echo '*********************************************************  Creating and populating build/ '
36         mkdir -p build/
37         cp -R chrome build/
38         cp -R server build/
39         cp -R defaults build/
40         cp -R components build/
41         cp application.ini build/
42         cp -R build/chrome/content/util/ build/server/
43         cp build/chrome/content/main/constants.js build/server/main/constants.js
44         cp build/chrome/content/OpenILS/data.js build/server/OpenILS/data.js
45         external/prune_dirs.sh build/
46
47 stamp: 
48         @echo
49         @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
50         @if [ -z "${STAFF_CLIENT_BUILD_ID}" ]; then ( echo "No Build ID for versioning" ; echo "none" > build/BUILD_ID ) ; fi
51         @if [ -n "${STAFF_CLIENT_BUILD_ID}" ]; then sed -i s/^Version=.\*/Version=${STAFF_CLIENT_BUILD_ID}/ build/application.ini ; fi
52         @if [ -n "${STAFF_CLIENT_BUILD_ID}" ]; then sed -i s/^BuildID=.\*/BuildID=${STAFF_CLIENT_BUILD_ID}/ build/application.ini ; fi
53         @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
54         @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
55
56 generated:
57         @echo
58         @echo '********************************************************* Grabbing lang.dtd from the OPAC code '
59         cp ../../../Open-ILS/web/opac/locale/en-US/lang.dtd build/chrome/locale/en-US/
60         external/dtd2js.pl build/chrome/locale/en-US/lang.dtd > build/chrome/content/main/lang.js
61
62 open-ils:
63         @echo
64         @echo '********************************************************* Grabbing more OPAC code and legacy code '
65         cp ../../../OpenSRF/src/javascript/*.js build/chrome/content/OpenSRF/
66         cp ../../../Open-ILS/web/opac/common/js/*.js build/chrome/content/OpenILS/util/
67         cp ../../../Evergreen/staff_client/chrome/content/evergreen/cat/marc* build/chrome/content/legacy/
68         cp ../../../Evergreen/staff_client/chrome/content/evergreen/cat/browse* build/chrome/content/legacy/
69         cp ../../../Evergreen/staff_client/chrome/locale/en-US/evergreen/cat.dtd build/chrome/locale/en-US/
70         find build/chrome/content/legacy/ -type f -name '*.*' -exec sed -i s/evergreen/open_ils_staff_client/g {} \;
71
72 custom:
73         @echo
74         @echo
75         @echo '********************************************************* Placeholder for debugging tweaks '
76         #(cd chrome/content/OpenILS/util; cp RemoteRequest.js~ RemoteRequest.js)
77
78 clean: remove_symlinks
79         @echo
80         @echo '********************************************************* Removing build/ '
81         rm -rf build/