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