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