adjusting backdate so it does not clear fines for "today" (the backdate day); fine...
[Evergreen.git] / Open-ILS / src / Makefile
1
2 export TMPDIR                   = $(TMP)/opensrf
3 export LDFLAGS                  = -L $(TMPDIR) -L .
4 export CFLAGS                   = -pipe -g -Wall -O2 -fPIC -I$(LIBXML2_HEADERS) -I$(APACHE2_HEADERS) -I$(APR_HEADERS) \
5                                                                 -I$(LIBXML2_HEADERS)/libxml  -I$(TMP) -I$(TMPDIR)
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
12
13 install:        perl-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
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
26
27 # -----------------------------------------------------------------------------------
28 # Web stuff
29 # -----------------------------------------------------------------------------------
30 mod_xmlent:
31         @echo $@
32         make -C apachemods mod_xmlent.so
33
34 oils_cgi:
35         @echo $@
36         make -C apachemods oils_cgi.so
37
38 oils_cgi-install:
39         @echo $@
40         make -C apachemods oils_cgi-install
41
42 mod_xmlent-install:
43         @echo $@
44         make -C apachemods mod_xmlent-install
45
46
47 client-xul:
48         @echo $@
49         @echo "Building staff client"
50         make -C ../xul/staff_client 
51
52 server-xul:
53         @echo $@
54         mkdir -p ${WEBDIR}
55         @echo "Creating ${WEBDIR}/xul/"
56         mkdir -p ${WEBDIR}/xul/
57         @echo "BUILD_ID = ${STAFF_CLIENT_BUILD_ID}"
58         @echo "Copying xul into ${WEBDIR}/xul/${STAFF_CLIENT_BUILD_ID}"
59         mkdir -p "${WEBDIR}/xul/${STAFF_CLIENT_BUILD_ID}"
60         cp -R ../xul/staff_client/build/server "${WEBDIR}/xul/${STAFF_CLIENT_BUILD_ID}/"
61
62 webcore-install:
63         @echo $@
64         echo "Copying web into $(WEBDIR)"
65         mkdir -p $(WEBDIR)
66         mkdir -p $(WEBDIR)/opac/extras/xsl/
67         cp -r ../web/* $(WEBDIR)
68         ln -sf $(WEBDIR)/opac/skin/default/xml/index.xml $(WEBDIR)/opac/skin/default/xml/mresult.xml
69         ln -sf $(WEBDIR)/opac/skin/default/xml/index.xml $(WEBDIR)/opac/skin/default/xml/rresult.xml
70         ln -sf $(WEBDIR)/opac/skin/default/xml/index.xml $(WEBDIR)/opac/skin/default/xml/rdetail.xml
71         ln -sf $(WEBDIR)/opac/skin/default/xml/index.xml $(WEBDIR)/opac/skin/default/xml/advanced.xml
72         ln -sf $(WEBDIR)/opac/skin/default/xml/index.xml $(WEBDIR)/opac/skin/default/xml/myopac.xml
73         ln -sf $(WEBDIR)/opac/skin/default/xml/index.xml $(WEBDIR)/opac/skin/default/xml/cnbrowse.xml
74         cp ../xul/staff_client/chrome//content//util/date.js $(WEBDIR)/opac/common/js/
75         cp ../xsl/*.xsl $(WEBDIR)/opac/extras/xsl/
76
77 libfieldmapper: 
78         make -C apachemods libfieldmapper.so
79
80 libfieldmapper-install: 
81         make -C apachemods libfieldmapper-install
82
83 c_apps: libfieldmapper
84         @echo $@
85         make -C c-apps
86         make -C extras oils_requestor
87
88 c_apps-install: libfieldmapper-install
89         @echo $@
90         make -C c-apps install
91         make -C extras oils_requestor-install
92
93 autojs-install:
94         @echo $@
95         cp extras/fieldmapper.pl $(BINDIR)
96         cp extras/org_tree_js.pl $(BINDIR)
97         cp extras/autogen.sh $(BINDIR)
98         cp support-scripts/offline-blocked-list.pl $(BINDIR) # this should probably be somewhere else
99 # -----------------------------------------------------------------------------------
100
101 marcdumper:
102         @echo $@
103         make -C extras/marcdumper
104
105 marcdumper-install:
106         @echo $@
107         make -C extras/marcdumper install
108
109 # -----------------------------------------------------------------------------------
110
111 perl-install:
112         @echo $@
113         @echo "Installing Perl modules to $(PERLDIR)"
114         mkdir -p $(PERLDIR)
115         mkdir -p $(DATADIR)
116         mkdir -p $(BINDIR)
117         cp extras/ils_events.xml $(DATADIR)
118         cp -r perlmods/* $(PERLDIR)
119         cp ../examples/openils.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         mkdir -p $(TEMPLATEDIR)
125         cp -r templates/marc $(TEMPLATEDIR)
126
127 # -----------------------------------------------------------------------------------
128
129 reporter-install:
130         @echo $@
131         @echo "Installing Reporter templates to $(REPORTERDIR) and example configs to $(ETCDIR)"
132         cp reporter/report_base.example.xml $(ETCDIR)/reporter.example.xml
133         cp reporter/tables.example.xml $(ETCDIR)
134         cp reporter/widgets.example.xml $(ETCDIR)
135         mkdir -p $(REPORTERDIR)
136         cp -r reporter/templates/* $(REPORTERDIR)
137
138 # -----------------------------------------------------------------------------------
139 offline-install:
140         @echo "Installing offline CGIs to $(CGIDIR)/offline";
141         mkdir -p $(CGIDIR)/offline;
142         mkdir -p $(DATADIR)/offline;
143         perl -pe "s{##CONFIG##}{$(ETCDIR)}" < offline/offline.pl > $(TMP)/offline.pl;
144         cp offline/offline-config.pl $(ETCDIR)
145         cp $(TMP)/offline.pl $(CGIDIR)/offline/
146         chmod +x $(CGIDIR)/offline/offline.pl
147
148 # -----------------------------------------------------------------------------------
149
150 cgi-bootstrap:
151         @echo "Installing cgi's to $(CGIDIR)"
152         mkdir -p $(TMP)/cgi-bin
153         mkdir -p $(CGIDIR)
154         for i in cgi-bin/*cgi; do perl -pe "s{##CONFIG##}{$(ETCDIR)}" < $$i > $(TMP)/$$i; done
155         cp $(TMP)/cgi-bin/*cgi $(CGIDIR)
156         cp -r cgi-bin/support $(CGIDIR)
157         cp cgi-bin/setup.pl $(ETCDIR)/live-db-setup.pl
158
159 storage-bootstrap:
160         @echo $@
161         @echo ""
162         @echo "WARNING!"
163         @echo ""
164         @echo "storage-bootstrap will DESTROY all data within all of the ILS tables in your database."
165         @echo "The database this script will touch has a DBI DSN of"
166         @echo "    dbi:$(DBDRVR):host=$(DBHOST);dbname=$(DBNAME);port=$(DBPORT)"
167         @echo "Type control-c to avoid destroying all of the data.  Type enter to continue..."
168         @echo ""
169         @read X;
170         ./extras/import/build-oils-db.sh $(DBDRVR) $(DBHOST) $(DBPORT) $(DBNAME) $(DBUSER) $(DBPW)
171
172 # -----------------------------------------------------------------------------------
173
174
175 string-templates-install:
176         @echo "Installing string templates to $(TEMPLATEDIR)"
177         mkdir -p $(TEMPLATEDIR)
178         cp -r templates/strings $(TEMPLATEDIR)
179
180 xsl-install:    
181         @echo "Installing XSL files to $(XSLDIR)"
182         mkdir -p $(XSLDIR)
183         cp ../xsl/*.xsl $(XSLDIR)
184 #       mkdir -p $(WEBDIR)/xsl/
185 #       cp ../xsl/*.xsl $(WEBDIR)/xsl/
186
187 clean:
188         @echo $@
189         make -C extras clean
190         make -C apachemods clean
191         make -C c-apps clean
192