Make building & installing the core components of Evergreen optional.
[Evergreen.git] / Open-ILS / src / Makefile.am
1 # Copyright (C) 2008 Equinox Software, Inc.
2 # Kevin Beswick <kevinbeswick00@gmail.com>
3 #
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; either version 2
7 # of the License, or (at your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 # GNU General Public License for more details.
13 #
14 ## Process this file with automake to generate Makefile.in
15
16
17 export INCDIR = "$(INCLUDEDIR)/openils/"
18 export STAFF_CLIENT_BUILD_ID = `/bin/cat @top_srcdir@/Open-ILS/xul/staff_client/build/BUILD_ID`
19 export DEF_LDFLAGS = -L. -L$(TMP) -L$(OPENSRF_LIBS)
20 export DEF_CFLAGS = -D_LARGEFILE64_SOURCE -pipe -g -Wall -O2 -fPIC -I@top_srcdir@/include -I$(LIBXML2_HEADERS) -I$(APACHE2_HEADERS) -I$(APR_HEADERS)  -I$(LIBXML2_HEADERS)/libxml  -I$(TMP) -I$(OPENSRF_HEADERS)
21 export DEF_LDLIBS = -lopensrf 
22
23
24 # Establish some installation directories and such
25 prefix=@prefix@
26 exec_prefix=@exec_prefix@
27 datadir=@localstatedir@/data
28 circrulesdir=@localstatedir@/circ
29 catalogscriptdir=@localstatedir@/catalog
30 penaltyrulesdir=@localstatedir@/penalty
31 examples = @top_srcdir@/Open-ILS/examples
32 jsbackend = @srcdir@/javascript/backend
33 supportscr = @srcdir@/support-scripts
34
35 # Collect files to be used by multiple targets
36
37 autojsbinscripts = @srcdir@/extras/fieldmapper.pl \
38          @srcdir@/extras/locale_html_options.pl \
39          @srcdir@/extras/org_tree_js.pl \
40          @srcdir@/extras/org_lasso_js.pl \
41          @srcdir@/extras/org_tree_html_options.pl \
42          @srcdir@/extras/org_tree_proximity.pl \
43          @srcdir@/extras/autogen.sh \
44          @srcdir@/support-scripts/offline-blocked-list.pl 
45
46 # Decide which entities to build
47
48 sysconf_DATA = $(examples)/opensrf.xml.example \
49                $(examples)/opensrf_core.xml.example \
50                $(examples)/fm_IDL.xml \
51                $(examples)/oils_sip.xml.example \
52                $(examples)/oils_web.xml.example \
53                $(examples)/lib_ips.txt.example
54
55 #----------------------------
56 # Build ILS CORE
57 #----------------------------
58
59 if BUILDILSCORE
60
61 #Add directories to build
62 OILSCORE_DIRS = c-apps extras 
63 #Add manual (non-automake) install targets for simplicity of installing.
64 OILSCORE_INST = ilscore-install
65
66 core_data = @srcdir@/extras/ils_events.xml \
67             $(examples)/hold_notification_template.example
68
69 core_scripts =   $(examples)/oils_ctl.sh \
70                  $(supportscr)/fine_generator.pl \
71                  $(supportscr)/hold_targeter.pl \
72                  $(supportscr)/reshelving_complete.srfsh \
73                  $(supportscr)/juv_to_adult.srfsh \
74                  $(supportscr)/thaw_expired_frozen_holds.srfsh \
75                  $(supportscr)/long-overdue-status-update.pl \
76                  $(srcdir)/extras/openurl_map.pl \
77                  $(srcdir)/extras/fast-extract \
78                  $(srcdir)/extras/import/marc_add_ids
79          
80 installautojs = $(autojsbinscripts)
81
82 #circ-rules-install
83 circrules_SCRIPTS = $(jsbackend)/circ/circ_duration.js \
84                     $(jsbackend)/circ/circ_groups.js \
85                     $(jsbackend)/circ/circ_item_config.js \
86                     $(jsbackend)/circ/circ_lib.js \
87                     $(jsbackend)/circ/circ_permit_copy.js \
88                     $(jsbackend)/circ/circ_permit_hold.js \
89                     $(jsbackend)/circ/circ_permit_patron.js \
90                     $(jsbackend)/circ/circ_permit_renew.js 
91 penaltyrules_SCRIPTS = $(jsbackend)/penalty/patron_penalty.js
92 catalogscript_SCRIPTS = $(jsbackend)/catalog/biblio_descriptor.js \
93                         $(jsbackend)/catalog/biblio_fingerprint.js \
94                         $(jsbackend)/catalog/fixed_fields.js \
95                         $(jsbackend)/catalog/phys_char.js \
96                         $(jsbackend)/catalog/record_type.js
97
98 endif
99
100 #--------------------
101 # Build Apache modules
102 #--------------------
103
104 if BUILDAPACHEMODS
105 OILSWEB_DIR = apachemods
106 endif
107
108 #---------------------
109 # Build ILS Reporter
110 #---------------------
111
112 if BUILDILSREPORTER
113 OILSREP_INST = reporter-install
114 #reporter-install
115 reporter_scripts = @srcdir@/reporter/clark-kent.pl \
116                    @srcdir@/reporter/find_orphaned_reports.pl
117 reporter_data = @srcdir@/reporter/report-fail \
118                @srcdir@/reporter/report-success
119 endif
120
121 #------------------------------
122 # Build EVERGREEN PYTHON
123 #------------------------------
124
125 if BUILDEGPYTHON
126 OILSPYTHON_DIR = python
127 endif
128
129 #------------------------------
130 # Build EVERGREEN JAVA
131 #------------------------------
132
133 if BUILDEGJAVA
134 OILSJAVA_DIR = java
135 endif
136
137 bin_SCRIPTS = $(core_scripts) $(reporter_scripts) $(installautojs) @srcdir@/extras/eg_config
138 data_DATA = $(core_data) $(reporter_data)
139
140 # Take care of which subdirectories to build, and which extra files to include in a distribution.
141
142 SUBDIRS = $(OILSCORE_DIRS) $(OILSWEB_DIR) $(OILSPYTHON_DIR) $(OILSJAVA_DIR)
143
144 EXTRA_DIST = @srcdir@/perlmods @srcdir@/templates @top_srcdir@/Open-ILS/xsl @srcdir@/cgi-bin
145
146 # Install header files
147
148 oilsincludedir = $(DESTDIR)@includedir@/openils
149 headsdir = @top_srcdir@/Open-ILS/include/openils
150 oilsinclude_HEADERS = $(headsdir)/idl_fieldmapper.h $(headsdir)/oils_constants.h $(headsdir)/oils_event.h $(headsdir)/oils_idl.h $(headsdir)/oils_utils.h
151
152 # Install everything that did not get installed by autotools
153
154 install-data-hook: $(OILSCORE_INST) $(OILSWEB_INST) $(OILSREP_INST)
155
156 uninstall-hook:
157         rm -R $(perldir)
158         rm -R $(TEMPLATEDIR)
159         rm -R $(XSLDIR)
160         rm -R $(CGIDIR)
161
162
163 #perl-install and string-templates-install      
164 ilscore-install:
165         @echo $@
166         @echo "Installing Perl modules"
167         mkdir -p $(perldir)
168         mkdir -p $(TEMPLATEDIR)
169         cp -r @srcdir@/perlmods/* $(perldir)
170         cp -r @srcdir@/templates/marc $(TEMPLATEDIR)
171         sed -i 's|SYSCONFDIR|@sysconfdir@|g' '$(DESTDIR)@libdir@/perl5/OpenILS/WWW/Web.pm'
172         sed -i 's|SYSCONFDIR|@sysconfdir@|g' '$(DESTDIR)@libdir@/perl5/OpenILS/WWW/Method.pm'
173         @echo "Installing string templates to $(TEMPLATEDIR)"
174         mkdir -p $(TEMPLATEDIR)
175         mkdir -p $(datadir)/overdue/
176         cp -r @srcdir@/templates/strings $(TEMPLATEDIR)
177         sed -i 's|LOCALSTATEDIR|@localstatedir@|g' '$(DESTDIR)@sysconfdir@/oils_sip.xml.example'
178         sed -i 's|SYSCONFDIR|@sysconfdir@|g' '$(DESTDIR)@sysconfdir@/oils_sip.xml.example'
179         sed -i 's|LOCALSTATEDIR|@localstatedir@|g' '$(DESTDIR)@sysconfdir@/opensrf_core.xml.example'
180         sed -i 's|SYSCONFDIR|@sysconfdir@|g' '$(DESTDIR)@sysconfdir@/opensrf_core.xml.example'
181         sed -i 's|LOCALSTATEDIR|@localstatedir@|g' '$(DESTDIR)@sysconfdir@/opensrf.xml.example'
182         sed -i 's|SYSCONFDIR|@sysconfdir@|g' '$(DESTDIR)@sysconfdir@/opensrf.xml.example'
183         sed -i 's|LIBDIR|@libdir@|g' '$(DESTDIR)@sysconfdir@/opensrf.xml.example'
184         sed -i 's|BINDIR|@bindir@|g' '$(DESTDIR)@bindir@/autogen.sh'
185         sed -i 's|LOCALSTATEDIR|@localstatedir@|g' '$(DESTDIR)@bindir@/autogen.sh'
186         sed -i 's|SYSCONFDIR|@sysconfdir@|g' '$(DESTDIR)@bindir@/autogen.sh'
187         sed -i 's|BINDIR|@bindir@|g' '$(DESTDIR)@bindir@/reshelving_complete.srfsh'
188         sed -i 's|BINDIR|@bindir@|g' '$(DESTDIR)@bindir@/juv_to_adult.srfsh'
189         sed -i 's|BINDIR|@bindir@|g' '$(DESTDIR)@bindir@/long-overdue-status-update.pl'
190         sed -i 's|SYSCONFDIR|@sysconfdir@|g' '$(DESTDIR)@bindir@/long-overdue-status-update.pl'
191         sed -i 's|BINDIR|@bindir@|g' '$(DESTDIR)@bindir@/thaw_expired_frozen_holds.srfsh'
192         sed -i 's|BINDIR|@bindir@|g' '$(DESTDIR)@bindir@/offline-blocked-list.pl'
193
194 reporter-install:
195         sed -i 's|SYSCONFDIR|@sysconfdir@|g' '$(DESTDIR)@bindir@/clark-kent.pl'
196         sed -i 's|SYSCONFDIR|@sysconfdir@|g' '$(DESTDIR)@bindir@/find_orphaned_reports.pl'
197
198