add date fields for 008/7-14
[Evergreen.git] / Open-ILS / src / Makefile
1 # vim:noet:ts=4
2
3 export LDFLAGS                  += -L . -L$(TMP) -L $(OPENSRF_LIBS)
4 export CFLAGS                   += -pipe -g -Wall -O2 -fPIC -I../../include -I$(LIBXML2_HEADERS) -I$(APACHE2_HEADERS) -I$(APR_HEADERS) \
5                                 -D_LARGEFILE64_SOURCE -I$(LIBXML2_HEADERS)/libxml  -I$(TMP) -I$(OPENSRF_HEADERS)
6
7 export INCDIR = "$(INCLUDEDIR)/openils/"
8
9 export STAFF_CLIENT_BUILD_ID = `/bin/cat ../xul/staff_client/build/BUILD_ID`
10
11 all:  c_apps client-xul mod_xmlent python-build
12
13 install:        perl-install python-install web-install server-xul string-templates-install xsl-install c_apps-install circ_rules-install offline-install storage-bootstrap cgi-bootstrap
14
15 web-install:    webcore-install autojs-install mod_xmlent-install offline-install reporter-install
16
17 circ_rules-install:
18         @echo $@
19         mkdir -p $(CIRCRULESDIR)
20         mkdir -p $(PENALTYRULESDIR)
21         mkdir -p $(CATALOGSCRIPTDIR)
22         cp javascript/backend/circ/*.js $(CIRCRULESDIR)
23         cp javascript/backend/penalty/*.js $(PENALTYRULESDIR)
24         cp javascript/backend/catalog/*.js $(CATALOGSCRIPTDIR)
25         cp support-scripts/fine_generator.pl $(BINDIR) 
26         cp support-scripts/hold_targeter.pl $(BINDIR) 
27         cp support-scripts/reshelving_complete.srfsh $(BINDIR) 
28         cp support-scripts/thaw_expired_frozen_holds.srfsh $(BINDIR) 
29         cp support-scripts/long-overdue-status-update.pl $(BINDIR) 
30
31
32 # -----------------------------------------------------------------------------------
33 # Web stuff
34 # -----------------------------------------------------------------------------------
35 mod_xmlent:
36         @echo $@
37         make -C apachemods mod_xmlent.so
38
39 mod_xmlent-install:
40         @echo $@
41         make -C apachemods mod_xmlent-install
42
43 client-xul:
44         @echo $@
45         @echo "Building staff client"
46         make -C ../xul/staff_client 
47
48 server-xul:
49         @echo $@
50         mkdir -p ${WEBDIR}
51         @echo "Creating ${WEBDIR}/xul/"
52         mkdir -p ${WEBDIR}/xul/
53         @echo "BUILD_ID = ${STAFF_CLIENT_BUILD_ID}"
54         @echo "Copying xul into ${WEBDIR}/xul/${STAFF_CLIENT_BUILD_ID}"
55         mkdir -p "${WEBDIR}/xul/${STAFF_CLIENT_BUILD_ID}"
56         cp -R ../xul/staff_client/build/server "${WEBDIR}/xul/${STAFF_CLIENT_BUILD_ID}/"
57
58 webcore-install:
59         @echo $@
60         echo "Copying web into $(WEBDIR)"
61         mkdir -p $(ADMINDIR)
62         cp -r ../admin/* $(ADMINDIR)
63         mkdir -p $(WEBDIR)
64         mkdir -p $(WEBDIR)/js/dojo/opensrf/
65         mkdir -p $(WEBDIR)/opac/extras/xsl/
66         cp -r ../web/* $(WEBDIR)
67         cp $(OPENSRF_LIBS)/javascript/* $(WEBDIR)/opac/common/js/
68         # dojo-ified opensrf libs
69         cp $(OPENSRF_LIBS)/javascript/md5.js $(WEBDIR)/js/dojo/opensrf/
70         cp $(OPENSRF_LIBS)/javascript/JSON_v1.js $(WEBDIR)/js/dojo/opensrf/
71         cp $(OPENSRF_LIBS)/javascript/opensrf*js $(WEBDIR)/js/dojo/opensrf/
72         cp $(OPENSRF_LIBS)/javascript/DojoSRF.js $(WEBDIR)/js/dojo/
73         ln -sf $(WEBDIR)/opac/skin/default/xml/index.xml $(WEBDIR)/opac/skin/default/xml/mresult.xml
74         ln -sf $(WEBDIR)/opac/skin/default/xml/index.xml $(WEBDIR)/opac/skin/default/xml/rresult.xml
75         ln -sf $(WEBDIR)/opac/skin/default/xml/index.xml $(WEBDIR)/opac/skin/default/xml/rdetail.xml
76         ln -sf $(WEBDIR)/opac/skin/default/xml/index.xml $(WEBDIR)/opac/skin/default/xml/advanced.xml
77         ln -sf $(WEBDIR)/opac/skin/default/xml/index.xml $(WEBDIR)/opac/skin/default/xml/myopac.xml
78         ln -sf $(WEBDIR)/opac/skin/default/xml/index.xml $(WEBDIR)/opac/skin/default/xml/cnbrowse.xml
79         cp ../xul/staff_client/chrome//content//util/date.js $(WEBDIR)/opac/common/js/
80         cp ../xsl/*.xsl $(WEBDIR)/opac/extras/xsl/
81         ln -sf $(ETCDIR)/fm_IDL.xml $(WEBDIR)/reports/
82         cp ../xul/staff_client/server/admin/adminlib.js $(WEBDIR)/reports/
83         mkdir -p $(WEBDIR)/opac/extras/slimpac/
84         mkdir -p $(WEBDIR)/standalone/
85         
86
87 c_apps:
88         @echo $@
89         make -C c-apps
90         make -C extras oils_requestor
91
92 c_apps-install:
93         @echo $@
94         make -C c-apps install
95         make -C extras oils_requestor-install
96
97 autojs-install:
98         @echo $@
99         cp extras/fieldmapper.pl $(BINDIR)
100         cp extras/org_tree_js.pl $(BINDIR)
101         cp extras/org_lasso_js.pl $(BINDIR)
102         cp extras/org_tree_html_options.pl $(BINDIR)
103         cp extras/org_tree_proximity.pl $(BINDIR)
104         cp extras/autogen.sh $(BINDIR)
105         cp extras/openurl_map.pl $(BINDIR)
106         cp support-scripts/offline-blocked-list.pl $(BINDIR) # this should probably be somewhere else
107 # -----------------------------------------------------------------------------------
108
109 perl-install:
110         @echo $@
111         @echo "Installing Perl modules to $(PERLDIR)"
112         mkdir -p $(PERLDIR)
113         mkdir -p $(DATADIR)
114         mkdir -p $(BINDIR)
115         mkdir -p $(DATADIR)/overdue/
116         cp extras/ils_events.xml $(DATADIR)
117         cp -r perlmods/* $(PERLDIR)
118         cp ../examples/opensrf.xml.example $(ETCDIR)
119         cp ../examples/opensrf_core.xml.example $(ETCDIR)
120         cp ../examples/fm_IDL.xml $(ETCDIR)
121         cp ../examples/oils_sip.xml.example $(ETCDIR)
122         cp ../examples/hold_notification_template.example $(DATADIR)
123         cp ../examples/oils_ctl.sh $(BINDIR)
124         cp ../examples/lib_ips.txt.example $(ETCDIR)
125         mkdir -p $(TEMPLATEDIR)
126         cp -r templates/marc $(TEMPLATEDIR)
127
128 # ------------------------------------------------------------------------------
129
130 python-build:
131         if [ -n "$(EG_PYTHON_INSTALL)" ]; then echo $@; make -C python build; fi;
132
133 # -----------------------------------------------------------------------------------
134
135 python-install:
136         if [ -n "$(EG_PYTHON_INSTALL)" ]; then echo $@; make -C python install; fi;
137
138 # -----------------------------------------------------------------------------------
139
140 reporter-install:
141         @echo $@
142         @echo "Installing Reporter email templates to $(REPORTERDIR) and example configs to $(ETCDIR)"
143         cp reporter/clark-kent.pl $(BINDIR)
144         cp reporter/find_orphaned_reports.pl $(BINDIR)
145         cp reporter/report-fail $(DATADIR)
146         cp reporter/report-success $(DATADIR)
147         mkdir -p $(REPORTERDIR)
148
149 # -----------------------------------------------------------------------------------
150 offline-install:
151         @echo "Installing offline CGIs to $(CGIDIR)/offline";
152         mkdir -p $(CGIDIR)/offline;
153         mkdir -p $(DATADIR)/offline;
154         perl -pe "s{##CONFIG##}{$(ETCDIR)}" < offline/offline.pl > $(TMP)/offline.pl;
155         cp offline/offline-config.pl $(ETCDIR)
156         cp $(TMP)/offline.pl $(CGIDIR)/offline/
157         chmod +x $(CGIDIR)/offline/offline.pl
158
159 # -----------------------------------------------------------------------------------
160
161 cgi-bootstrap:
162         @echo "Installing cgi's to $(CGIDIR)"
163         mkdir -p $(TMP)/cgi-bin
164         mkdir -p $(CGIDIR)
165         for i in cgi-bin/*cgi; do perl -pe "s{##CONFIG##}{$(ETCDIR)}" < $$i > $(TMP)/$$i; done
166         cp $(TMP)/cgi-bin/*cgi $(CGIDIR)
167         cp -r cgi-bin/support $(CGIDIR)
168         cp cgi-bin/setup.pl $(ETCDIR)/live-db-setup.pl
169         chmod 755 $(CGIDIR)/*cgi
170
171 storage-bootstrap:
172         @echo $@
173         @echo ""
174         @echo "WARNING!"
175         @echo ""
176         @echo "storage-bootstrap will DESTROY all data within all of the ILS tables in your database."
177         @echo "The database this script will touch has a DBI DSN of"
178         @echo "    dbi:$(DBDRVR):host=$(DBHOST);dbname=$(DBNAME);port=$(DBPORT)"
179         @echo "Type control-c to avoid destroying all of the data.  Type enter to continue..."
180         @echo ""
181         @read X;
182         ./extras/import/build-oils-db.sh $(DBDRVR) $(DBHOST) $(DBPORT) $(DBNAME) $(DBUSER) $(DBPW)
183
184 # -----------------------------------------------------------------------------------
185
186
187 string-templates-install:
188         @echo "Installing string templates to $(TEMPLATEDIR)"
189         mkdir -p $(TEMPLATEDIR)
190         cp -r templates/strings $(TEMPLATEDIR)
191
192 xsl-install:    
193         @echo "Installing XSL files to $(XSLDIR)"
194         mkdir -p $(XSLDIR)
195         cp ../xsl/*.xsl $(XSLDIR)
196 #       mkdir -p $(WEBDIR)/xsl/
197 #       cp ../xsl/*.xsl $(WEBDIR)/xsl/
198
199 clean:
200         @echo $@
201         make -C extras clean
202         make -C apachemods clean
203         make -C c-apps clean
204         if [ -n "$(EG_PYTHON_INSTALL)" ]; then echo $@; make -C python clean --all; fi;
205