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