added mod_xmlent to the build process
[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: mod_xmlbuilder mod_ils_rest_gateway c_apps client-xul mod_xmlent
12
13 install:        perl-install web-install server-xul string-templates-install storage-bootstrap cgi-bootstrap xsl-install c_apps-install circ_rules-install 
14
15 web-install:    webcore-install autojs-install  mod_xmlbuilder-install mod_ils_rest_gateway-install  mod_xmlent-install
16
17 circ_rules-install:
18         @echo $@
19         cp javascript/backend/circ/*.js $(CIRCRULESDIR)
20
21
22 # -----------------------------------------------------------------------------------
23 # Web stuff
24 # -----------------------------------------------------------------------------------
25 mod_ils_rest_gateway:
26         @echo $@
27         make -C apachemods mod_ils_rest_gateway.so
28
29 mod_ils_rest_gateway-install:
30         @echo $@
31         make -C apachemods libfieldmapper-install
32         make -C apachemods mod_ils_rest_gateway-install
33
34 mod_xmlent:
35         @echo $@
36         make -C apachemods mod_xmlent.so
37
38 mod_xmlbuilder:
39         @echo $@
40         make -C apachemods mod_xmlbuilder.so
41
42 oils_cgi:
43         @echo $@
44         make -C apachemods oils_cgi.so
45
46 oils_cgi-install:
47         @echo $@
48         make -C apachemods oils_cgi-install
49
50 mod_xmlbuilder-install:
51         @echo $@
52         make -C apachemods mod_xmlbuilder-install
53
54 mod_xmlent-install:
55         @echo $@
56         make -C apachemods mod_xmlent-install
57
58
59 client-xul:
60         @echo $@
61         @echo "Building staff client"
62         make -C ../xul/staff_client 
63
64 server-xul:
65         @echo $@
66         mkdir -p ${WEBDIR}
67         @echo "Creating ${WEBDIR}/xul/"
68         mkdir -p ${WEBDIR}/xul/
69         @echo "BUILD_ID = ${STAFF_CLIENT_BUILD_ID}"
70         @echo "Copying xul into ${WEBDIR}/xul/${STAFF_CLIENT_BUILD_ID}"
71         mkdir -p "${WEBDIR}/xul/${STAFF_CLIENT_BUILD_ID}"
72         cp -R ../xul/staff_client/build/server "${WEBDIR}/xul/${STAFF_CLIENT_BUILD_ID}/"
73
74 webcore-install:
75         @echo $@
76         echo "Copying web into $(WEBDIR)"
77         mkdir -p $(WEBDIR)
78         cp -r ../web/* $(WEBDIR)
79         ln -sf $(WEBDIR)/opac/skin/default/xml/index.xml $(WEBDIR)/opac/skin/default/xml/mresult.xml
80         ln -sf $(WEBDIR)/opac/skin/default/xml/index.xml $(WEBDIR)/opac/skin/default/xml/rresult.xml
81         ln -sf $(WEBDIR)/opac/skin/default/xml/index.xml $(WEBDIR)/opac/skin/default/xml/rdetail.xml
82         ln -sf $(WEBDIR)/opac/skin/default/xml/index.xml $(WEBDIR)/opac/skin/default/xml/advanced.xml
83         ln -sf $(WEBDIR)/opac/skin/default/xml/index.xml $(WEBDIR)/opac/skin/default/xml/myopac.xml
84
85 libfieldmapper: 
86         make -C apachemods libfieldmapper.so
87
88 libfieldmapper-install: 
89         make -C apachemods libfieldmapper-install
90
91 c_apps: libfieldmapper
92         @echo $@
93         make -C c-apps
94         make -C extras oils_requestor
95
96 c_apps-install: libfieldmapper-install
97         @echo $@
98         make -C c-apps install
99         make -C extras oils_requestor-install
100
101 autojs-install:
102         @echo $@
103         cp extras/fieldmapper.pl $(BINDIR)
104         cp extras/org_tree_js.pl $(BINDIR)
105         cp extras/autogen.sh $(BINDIR)
106 # -----------------------------------------------------------------------------------
107
108 marcdumper:
109         @echo $@
110         make -C extras/marcdumper
111
112 marcdumper-install:
113         @echo $@
114         make -C extras/marcdumper install
115
116 # -----------------------------------------------------------------------------------
117
118 perl-install:
119         @echo $@
120         @echo "Installing Perl modules to $(PERLDIR)"
121         mkdir -p $(PERLDIR)
122         mkdir -p $(DATADIR)
123         cp extras/ils_events.xml $(DATADIR)
124         cp -r perlmods/* $(PERLDIR)
125         cp ../examples/openils.xml.example $(ETCDIR)
126         mkdir -p $(TEMPLATEDIR)
127         cp -r templates/marc $(TEMPLATEDIR)
128
129 # -----------------------------------------------------------------------------------
130
131 reporter-install:
132         @echo $@
133         @echo "Installing Reporter templates to $(REPORTERDIR) and example configs to $(ETCDIR)"
134         cp reporter/report_base.example.xml $(ETCDIR)/reporter.example.xml
135         cp reporter/tables.example.xml $(ETCDIR)
136         cp reporter/widgets.example.xml $(ETCDIR)
137         mkdir -p $(REPORTERDIR)
138         cp -r reporter/templates/* $(REPORTERDIR)
139
140 # -----------------------------------------------------------------------------------
141
142 cgi-bootstrap:
143         @echo "Installing cgi's to $(CGIDIR)"
144         mkdir -p $(TMP)/cgi-bin
145         mkdir -p $(CGIDIR)
146         for i in cgi-bin/*cgi; do perl -pe "s{##CONFIG##}{$(ETCDIR)}" < $$i > $(TMP)/$$i; done
147         cp $(TMP)/cgi-bin/*cgi $(CGIDIR)
148         cp -r cgi-bin/support $(CGIDIR)
149         cp cgi-bin/setup.pl $(ETCDIR)/live-db-setup.pl
150
151 storage-bootstrap:
152         @echo $@
153         @echo ""
154         @echo "WARNING!"
155         @echo ""
156         @echo "storage-bootstrap will DESTROY all data within all of the ILS tables in your database."
157         @echo "Type control-c to avoid destroying all of the data.  Type enter to continue..."
158         @echo ""
159         @read X;
160         ./extras/import/build-oils-db.sh $(DBDRVR) $(DBHOST) $(DBNAME) $(DBUSER) $(DBPW)
161
162 # -----------------------------------------------------------------------------------
163
164
165 string-templates-install:
166         @echo "Installing string templates to $(TEMPLATEDIR)"
167         mkdir -p $(TEMPLATEDIR)
168         cp -r templates/strings $(TEMPLATEDIR)
169
170 xsl-install:    
171         @echo "Installing XSL files to $(XSLDIR)"
172         mkdir -p $(XSLDIR)
173         cp ../xsl/*.xsl $(XSLDIR)
174
175 clean:
176         @echo $@
177         make -C extras clean
178         make -C apachemods clean
179         make -C c-apps clean
180