added target for circ script installing
[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 all: mod_xmlbuilder mod_ils_rest_gateway c_apps 
10
11 install:        perl-install web-install string-templates-install storage-bootstrap cgi-bootstrap xsl-install c_apps-install circ_rules-install
12
13 web-install:    webcore-install autojs-install  mod_xmlbuilder-install mod_ils_rest_gateway-install
14
15 circ_rules-install:
16         @echo $@
17         cp javascript/backend/circ/* $(CIRCRULESDIR)
18
19
20 # -----------------------------------------------------------------------------------
21 # Web stuff
22 # -----------------------------------------------------------------------------------
23 mod_ils_rest_gateway:
24         @echo $@
25         make -C apachemods mod_ils_rest_gateway.so
26
27 mod_ils_rest_gateway-install:
28         @echo $@
29         make -C apachemods libfieldmapper-install
30         make -C apachemods mod_ils_rest_gateway-install
31
32 mod_xmlbuilder:
33         @echo $@
34         make -C apachemods mod_xmlbuilder.so
35
36 mod_xmlbuilder-install:
37         @echo $@
38         make -C apachemods mod_xmlbuilder-install
39
40 webcore-install:
41         @echo $@
42         echo "Copying web into $(WEBDIR)"
43 #       mkdir -p $(WEBDIR)
44 #       cp -r ../web/* $(WEBDIR)
45 #       ln -s $(WEBDIR)/opac/skin/default/xml/index.xml $(WEBDIR)/opac/skin/default/xml/mresult.xml
46 #       ln -s $(WEBDIR)/opac/skin/default/xml/index.xml $(WEBDIR)/opac/skin/default/xml/rresult.xml
47 #       ln -s $(WEBDIR)/opac/skin/default/xml/index.xml $(WEBDIR)/opac/skin/default/xml/rdetail.xml
48 #       ln -s $(WEBDIR)/opac/skin/default/xml/index.xml $(WEBDIR)/opac/skin/default/xml/advanced.xml
49 #       ln -s $(WEBDIR)/opac/skin/default/xml/index.xml $(WEBDIR)/opac/skin/default/xml/myopac.xml
50
51 libfieldmapper: 
52         make -C apachemods libfieldmapper.so
53
54 libfieldmapper-install: 
55         make -C apachemods libfieldmapper-install
56
57 c_apps: libfieldmapper
58         @echo $@
59         make -C c-apps
60
61 c_apps-install: libfieldmapper-install
62         @echo $@
63         make -C c-apps install
64
65 autojs-install:
66         @echo $@
67         cp extras/fieldmapper.pl $(BINDIR)
68         cp extras/org_tree_js.pl $(BINDIR)
69         cp extras/autogen.sh $(BINDIR)
70 # -----------------------------------------------------------------------------------
71
72 marcdumper:
73         @echo $@
74         make -C extras/marcdumper
75
76 marcdumper-install:
77         @echo $@
78         make -C extras/marcdumper install
79
80 # -----------------------------------------------------------------------------------
81
82 perl-install:
83         @echo $@
84         @echo "Installing Perl modules to $(PERLDIR)"
85         mkdir -p $(PERLDIR)
86         mkdir -p $(DATADIR)
87         cp extras/ils_events.xml $(DATADIR)
88         cp -r perlmods/* $(PERLDIR)
89         cp ../examples/openils.xml.example $(ETCDIR)
90         mkdir -p $(TEMPLATEDIR)
91         cp -r templates/marc $(TEMPLATEDIR)
92
93 # -----------------------------------------------------------------------------------
94
95 reporter-install:
96         @echo $@
97         @echo "Installing Reporter templates to $(REPORTERDIR) and example configs to $(ETCDIR)"
98         cp reporter/report_base.example.xml $(ETCDIR)/reporter.example.xml
99         cp reporter/tables.example.xml $(ETCDIR)
100         cp reporter/widgets.example.xml $(ETCDIR)
101         mkdir -p $(REPORTERDIR)
102         cp -r reporter/templates/* $(REPORTERDIR)
103
104 # -----------------------------------------------------------------------------------
105
106 cgi-bootstrap:
107         @echo "Installing cgi's to $(CGIDIR)"
108         mkdir -p $(TMP)/cgi-bin
109         mkdir -p $(CGIDIR)
110         for i in cgi-bin/*cgi; do perl -pe "s{##CONFIG##}{$(ETCDIR)}" < $$i > $(TMP)/$$i; done
111         cp $(TMP)/cgi-bin/*cgi $(CGIDIR)
112         cp -r cgi-bin/support $(CGIDIR)
113         cp cgi-bin/setup.pl $(ETCDIR)/live-db-setup.pl
114
115 storage-bootstrap:
116         ./extras/import/build-oils-db.sh $(DBDRVR) $(DBHOST) $(DBNAME) $(DBUSER) $(DBPW)
117
118 # -----------------------------------------------------------------------------------
119
120
121 string-templates-install:
122         @echo "Installing string templates to $(TEMPLATEDIR)"
123         mkdir -p $(TEMPLATEDIR)
124         cp -r templates/strings $(TEMPLATEDIR)
125
126 xsl-install:    
127         @echo "Installing XSL files to $(XSLDIR)"
128         mkdir -p $(XSLDIR)
129         cp ../xsl/*.xsl $(XSLDIR)
130
131 clean:
132         @echo $@
133         make -C extras clean
134         make -C apachemods clean
135