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