We need to install the new org_tree proximity script if we're going to use it
[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 oils_cgi:
40         @echo $@
41         make -C apachemods oils_cgi.so
42
43 oils_cgi-install:
44         @echo $@
45         make -C apachemods oils_cgi-install
46
47 mod_xmlent-install:
48         @echo $@
49         make -C apachemods mod_xmlent-install
50
51 client-xul:
52         @echo $@
53         @echo "Building staff client"
54         make -C ../xul/staff_client 
55
56 server-xul:
57         @echo $@
58         mkdir -p ${WEBDIR}
59         @echo "Creating ${WEBDIR}/xul/"
60         mkdir -p ${WEBDIR}/xul/
61         @echo "BUILD_ID = ${STAFF_CLIENT_BUILD_ID}"
62         @echo "Copying xul into ${WEBDIR}/xul/${STAFF_CLIENT_BUILD_ID}"
63         mkdir -p "${WEBDIR}/xul/${STAFF_CLIENT_BUILD_ID}"
64         cp -R ../xul/staff_client/build/server "${WEBDIR}/xul/${STAFF_CLIENT_BUILD_ID}/"
65
66 webcore-install:
67         @echo $@
68         echo "Copying web into $(WEBDIR)"
69         mkdir -p $(ADMINDIR)
70         cp -r ../admin/* $(ADMINDIR)
71         mkdir -p $(WEBDIR)
72         mkdir -p $(WEBDIR)/opac/extras/xsl/
73         cp -r ../web/* $(WEBDIR)
74         cp $(OPENSRF_LIBS)/javascript/* $(WEBDIR)/opac/common/js/
75         ln -sf $(WEBDIR)/opac/skin/default/xml/index.xml $(WEBDIR)/opac/skin/default/xml/mresult.xml
76         ln -sf $(WEBDIR)/opac/skin/default/xml/index.xml $(WEBDIR)/opac/skin/default/xml/rresult.xml
77         ln -sf $(WEBDIR)/opac/skin/default/xml/index.xml $(WEBDIR)/opac/skin/default/xml/rdetail.xml
78         ln -sf $(WEBDIR)/opac/skin/default/xml/index.xml $(WEBDIR)/opac/skin/default/xml/advanced.xml
79         ln -sf $(WEBDIR)/opac/skin/default/xml/index.xml $(WEBDIR)/opac/skin/default/xml/myopac.xml
80         ln -sf $(WEBDIR)/opac/skin/default/xml/index.xml $(WEBDIR)/opac/skin/default/xml/cnbrowse.xml
81         cp ../xul/staff_client/chrome//content//util/date.js $(WEBDIR)/opac/common/js/
82         cp ../xsl/*.xsl $(WEBDIR)/opac/extras/xsl/
83         ln -sf $(ETCDIR)/fm_IDL.xml $(WEBDIR)/reports/
84         cp ../xul/staff_client/server/admin/adminlib.js $(WEBDIR)/reports/
85         mkdir -p $(WEBDIR)/opac/extras/slimpac/
86         
87
88 libfieldmapper: 
89         make -C apachemods libfieldmapper.so
90
91 libfieldmapper-install: 
92         make -C apachemods libfieldmapper-install
93
94 c_apps:
95         @echo $@
96         make -C c-apps
97         make -C extras oils_requestor
98
99 c_apps-install:
100         @echo $@
101         make -C c-apps install
102         make -C extras oils_requestor-install
103
104 autojs-install:
105         @echo $@
106         cp extras/fieldmapper.pl $(BINDIR)
107         cp extras/org_tree_js.pl $(BINDIR)
108         cp extras/org_tree_html_options.pl $(BINDIR)
109         cp extras/org_tree_proximity.pl $(BINDIR)
110         cp extras/autogen.sh $(BINDIR)
111         cp support-scripts/offline-blocked-list.pl $(BINDIR) # this should probably be somewhere else
112 # -----------------------------------------------------------------------------------
113
114 marcdumper:
115         @echo $@
116         make -C extras/marcdumper
117
118 marcdumper-install:
119         @echo $@
120         make -C extras/marcdumper install
121
122 # -----------------------------------------------------------------------------------
123
124 perl-install:
125         @echo $@
126         @echo "Installing Perl modules to $(PERLDIR)"
127         mkdir -p $(PERLDIR)
128         mkdir -p $(DATADIR)
129         mkdir -p $(BINDIR)
130         cp extras/ils_events.xml $(DATADIR)
131         cp -r perlmods/* $(PERLDIR)
132         cp ../examples/opensrf.xml.example $(ETCDIR)
133         cp ../examples/opensrf_core.xml.example $(ETCDIR)
134         cp ../examples/fm_IDL.xml $(ETCDIR)
135         cp ../examples/oils_sip.xml.example $(ETCDIR)
136         cp ../examples/hold_notification_template.example $(DATADIR)
137         cp ../examples/oils_ctl.sh $(BINDIR)
138         cp ../examples/lib_ips.txt.example $(ETCDIR)
139         mkdir -p $(TEMPLATEDIR)
140         cp -r templates/marc $(TEMPLATEDIR)
141
142 # ------------------------------------------------------------------------------
143
144 python-build:
145         if [ -n "$(EG_PYTHON_INSTALL)" ]; then echo $@; make -C python build; fi;
146
147 # -----------------------------------------------------------------------------------
148
149 python-install:
150         if [ -n "$(EG_PYTHON_INSTALL)" ]; then echo $@; make -C python install; fi;
151
152 # -----------------------------------------------------------------------------------
153
154 reporter-install:
155         @echo $@
156         @echo "Installing Reporter email templates to $(REPORTERDIR) and example configs to $(ETCDIR)"
157         cp reporter/clark-kent.pl $(BINDIR)
158         cp reporter/find_orphaned_reports.pl $(BINDIR)
159         cp reporter/report-fail $(DATADIR)
160         cp reporter/report-success $(DATADIR)
161         mkdir -p $(REPORTERDIR)
162
163 # -----------------------------------------------------------------------------------
164 offline-install:
165         @echo "Installing offline CGIs to $(CGIDIR)/offline";
166         mkdir -p $(CGIDIR)/offline;
167         mkdir -p $(DATADIR)/offline;
168         perl -pe "s{##CONFIG##}{$(ETCDIR)}" < offline/offline.pl > $(TMP)/offline.pl;
169         cp offline/offline-config.pl $(ETCDIR)
170         cp $(TMP)/offline.pl $(CGIDIR)/offline/
171         chmod +x $(CGIDIR)/offline/offline.pl
172
173 # -----------------------------------------------------------------------------------
174
175 cgi-bootstrap:
176         @echo "Installing cgi's to $(CGIDIR)"
177         mkdir -p $(TMP)/cgi-bin
178         mkdir -p $(CGIDIR)
179         for i in cgi-bin/*cgi; do perl -pe "s{##CONFIG##}{$(ETCDIR)}" < $$i > $(TMP)/$$i; done
180         cp $(TMP)/cgi-bin/*cgi $(CGIDIR)
181         cp -r cgi-bin/support $(CGIDIR)
182         cp cgi-bin/setup.pl $(ETCDIR)/live-db-setup.pl
183         chmod 755 $(CGIDIR)/*cgi
184
185 storage-bootstrap:
186         @echo $@
187         @echo ""
188         @echo "WARNING!"
189         @echo ""
190         @echo "storage-bootstrap will DESTROY all data within all of the ILS tables in your database."
191         @echo "The database this script will touch has a DBI DSN of"
192         @echo "    dbi:$(DBDRVR):host=$(DBHOST);dbname=$(DBNAME);port=$(DBPORT)"
193         @echo "Type control-c to avoid destroying all of the data.  Type enter to continue..."
194         @echo ""
195         @read X;
196         ./extras/import/build-oils-db.sh $(DBDRVR) $(DBHOST) $(DBPORT) $(DBNAME) $(DBUSER) $(DBPW) $(DBVER)
197
198 # -----------------------------------------------------------------------------------
199
200
201 string-templates-install:
202         @echo "Installing string templates to $(TEMPLATEDIR)"
203         mkdir -p $(TEMPLATEDIR)
204         cp -r templates/strings $(TEMPLATEDIR)
205
206 xsl-install:    
207         @echo "Installing XSL files to $(XSLDIR)"
208         mkdir -p $(XSLDIR)
209         cp ../xsl/*.xsl $(XSLDIR)
210 #       mkdir -p $(WEBDIR)/xsl/
211 #       cp ../xsl/*.xsl $(WEBDIR)/xsl/
212
213 clean:
214         @echo $@
215         make -C extras clean
216         make -C apachemods clean
217         make -C c-apps clean
218         if [ -n "$(EG_PYTHON_INSTALL)" ]; then echo $@; make -C python clean --all; fi;
219