added simple request utilty to display fieldmapper objects
[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
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  
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_xmlbuilder:
35         @echo $@
36         make -C apachemods mod_xmlbuilder.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_xmlbuilder-install:
47         @echo $@
48         make -C apachemods mod_xmlbuilder-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 $(WEBDIR)
69         cp -r ../web/* $(WEBDIR)
70         ln -sf $(WEBDIR)/opac/skin/default/xml/index.xml $(WEBDIR)/opac/skin/default/xml/mresult.xml
71         ln -sf $(WEBDIR)/opac/skin/default/xml/index.xml $(WEBDIR)/opac/skin/default/xml/rresult.xml
72         ln -sf $(WEBDIR)/opac/skin/default/xml/index.xml $(WEBDIR)/opac/skin/default/xml/rdetail.xml
73         ln -sf $(WEBDIR)/opac/skin/default/xml/index.xml $(WEBDIR)/opac/skin/default/xml/advanced.xml
74         ln -sf $(WEBDIR)/opac/skin/default/xml/index.xml $(WEBDIR)/opac/skin/default/xml/myopac.xml
75
76 libfieldmapper: 
77         make -C apachemods libfieldmapper.so
78
79 libfieldmapper-install: 
80         make -C apachemods libfieldmapper-install
81
82 c_apps: libfieldmapper
83         @echo $@
84         make -C c-apps
85         make -C extras oils_requestor
86
87 c_apps-install: libfieldmapper-install
88         @echo $@
89         make -C c-apps install
90         make -C extras oils_requestor-install
91
92 autojs-install:
93         @echo $@
94         cp extras/fieldmapper.pl $(BINDIR)
95         cp extras/org_tree_js.pl $(BINDIR)
96         cp extras/autogen.sh $(BINDIR)
97 # -----------------------------------------------------------------------------------
98
99 marcdumper:
100         @echo $@
101         make -C extras/marcdumper
102
103 marcdumper-install:
104         @echo $@
105         make -C extras/marcdumper install
106
107 # -----------------------------------------------------------------------------------
108
109 perl-install:
110         @echo $@
111         @echo "Installing Perl modules to $(PERLDIR)"
112         mkdir -p $(PERLDIR)
113         mkdir -p $(DATADIR)
114         cp extras/ils_events.xml $(DATADIR)
115         cp -r perlmods/* $(PERLDIR)
116         cp ../examples/openils.xml.example $(ETCDIR)
117         mkdir -p $(TEMPLATEDIR)
118         cp -r templates/marc $(TEMPLATEDIR)
119
120 # -----------------------------------------------------------------------------------
121
122 reporter-install:
123         @echo $@
124         @echo "Installing Reporter templates to $(REPORTERDIR) and example configs to $(ETCDIR)"
125         cp reporter/report_base.example.xml $(ETCDIR)/reporter.example.xml
126         cp reporter/tables.example.xml $(ETCDIR)
127         cp reporter/widgets.example.xml $(ETCDIR)
128         mkdir -p $(REPORTERDIR)
129         cp -r reporter/templates/* $(REPORTERDIR)
130
131 # -----------------------------------------------------------------------------------
132
133 cgi-bootstrap:
134         @echo "Installing cgi's to $(CGIDIR)"
135         mkdir -p $(TMP)/cgi-bin
136         mkdir -p $(CGIDIR)
137         for i in cgi-bin/*cgi; do perl -pe "s{##CONFIG##}{$(ETCDIR)}" < $$i > $(TMP)/$$i; done
138         cp $(TMP)/cgi-bin/*cgi $(CGIDIR)
139         cp -r cgi-bin/support $(CGIDIR)
140         cp cgi-bin/setup.pl $(ETCDIR)/live-db-setup.pl
141
142 storage-bootstrap:
143         @echo $@
144         @echo ""
145         @echo "WARNING!"
146         @echo ""
147         @echo "storage-bootstrap will DESTROY all data within all of the ILS tables in your database."
148         @echo "Type control-c to avoid destroying all of the data.  Type enter to continue..."
149         @echo ""
150         @read X;
151         ./extras/import/build-oils-db.sh $(DBDRVR) $(DBHOST) $(DBNAME) $(DBUSER) $(DBPW)
152
153 # -----------------------------------------------------------------------------------
154
155
156 string-templates-install:
157         @echo "Installing string templates to $(TEMPLATEDIR)"
158         mkdir -p $(TEMPLATEDIR)
159         cp -r templates/strings $(TEMPLATEDIR)
160
161 xsl-install:    
162         @echo "Installing XSL files to $(XSLDIR)"
163         mkdir -p $(XSLDIR)
164         cp ../xsl/*.xsl $(XSLDIR)
165
166 clean:
167         @echo $@
168         make -C extras clean
169         make -C apachemods clean
170         make -C c-apps clean
171