]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/src/Makefile.am
LP#1386347: Clear hold-copy-map efficiently
[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 STAFF_CLIENT_BUILD_ID = `/bin/cat @top_srcdir@/Open-ILS/xul/staff_client/build/BUILD_ID`
18 export DEF_LDFLAGS = -L. -L$(TMP) -L$(OPENSRF_LIBS)
19 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)
20 export DEF_LDLIBS = -lopensrf 
21
22
23 # Establish some installation directories and such
24 prefix=@prefix@
25 exec_prefix=@exec_prefix@
26 datadir=@localstatedir@/data
27 circrulesdir=@localstatedir@/circ
28 catalogscriptdir=@localstatedir@/catalog
29 penaltyrulesdir=@localstatedir@/penalty
30 examples = @top_srcdir@/Open-ILS/examples
31 jsbackend = @srcdir@/javascript/backend
32 supportscr = @srcdir@/support-scripts
33
34 # Collect files to be used by multiple targets
35
36 autojsbinscripts = @srcdir@/extras/autogen.sh
37
38 # Decide which entities to build
39
40 sysconf_DATA = $(examples)/action_trigger_filters.json.example \
41                $(examples)/opensrf.xml.example \
42                $(examples)/opensrf_core.xml.example \
43                $(examples)/fm_IDL.xml \
44                $(examples)/oils_sip.xml.example \
45                $(examples)/lib_ips.txt.example \
46                $(examples)/oils_yaz.xml.example \
47                $(examples)/kpac.xml.example \
48                $(examples)/oils_z3950.xml.example 
49
50 #----------------------------
51 # Build ILS CORE
52 #----------------------------
53
54 if BUILDILSCORE
55
56 #Add directories to build
57 OILSCORE_DIRS = c-apps extras perlmods
58 #Add manual (non-automake) install targets for simplicity of installing.
59 OILSCORE_INST = ilscore-install
60
61 core_data = @srcdir@/extras/ils_events.xml \
62             $(examples)/hold_notification_template.example
63
64 core_scripts =   $(examples)/oils_ctl.sh \
65                  $(supportscr)/fine_generator.pl \
66                  $(supportscr)/hold_targeter.pl \
67                  $(supportscr)/reshelving_complete.srfsh \
68                  $(supportscr)/clear_expired_circ_history.srfsh \
69                  $(supportscr)/update_hard_due_dates.srfsh \
70                  $(supportscr)/juv_to_adult.srfsh \
71                  $(supportscr)/thaw_expired_frozen_holds.srfsh \
72                  $(supportscr)/long-overdue-status-update.pl \
73                  $(supportscr)/purge_holds.srfsh \
74                  $(supportscr)/purge_circulations.srfsh \
75                  $(supportscr)/sitemap_generator \
76                  $(srcdir)/extras/eg_config \
77                  $(srcdir)/extras/openurl_map.pl \
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 gen_scripts = \
138         @srcdir@/extras/fast-extract \
139         @srcdir@/extras/import/marc2are.pl \
140         @srcdir@/extras/import/marc2bre.pl \
141         @srcdir@/extras/import/marc2sre.pl \
142         @srcdir@/extras/import/parallel_pg_loader.pl \
143         $(supportscr)/action_trigger_runner.pl \
144         $(supportscr)/authority_control_fields.pl \
145         $(supportscr)/authority_authority_linker.pl \
146         $(supportscr)/eg_db_config \
147         $(supportscr)/marc_export \
148         $(supportscr)/offline-blocked-list.pl
149
150 gen_docs = \
151         $(examples)/apache/eg.conf \
152         $(examples)/apache/eg_vhost.conf \
153         $(examples)/apache/eg_startup \
154         $(examples)/apache_24/eg_24.conf \
155         $(examples)/apache_24/eg_vhost_24.conf
156
157 bin_SCRIPTS = $(core_scripts) $(gen_scripts) $(reporter_scripts) $(installautojs)
158
159 CLEANFILES = $(gen_scripts)
160
161 data_DATA = $(core_data) $(reporter_data)
162
163 doc_DATA = $(gen_docs)
164
165 # Take care of which subdirectories to build, and which extra files to include in a distribution.
166
167 SUBDIRS = $(OILSCORE_DIRS) $(OILSWEB_DIR) $(OILSPYTHON_DIR) $(OILSJAVA_DIR)
168
169 EXTRA_DIST = @srcdir@/perlmods \
170         @srcdir@/data \
171         @srcdir@/templates \
172         @top_srcdir@/Open-ILS/xsl \
173         @srcdir@/cgi-bin \
174         $(gen_scripts) \
175         $(gen_docs) \
176         @srcdir@/extras/eg_config
177
178 do_subst = $(SED) \
179         -e 's,[@]bindir[@],$(bindir),g' \
180         -e 's,[@]datarootdir[@],$(datarootdir),g' \
181         -e 's,[@]docdir[@],$(docdir),g' \
182         -e 's,[@]exec_prefix[@],$(exec_prefix),g' \
183         -e 's,[@]includedir[@],$(includedir),g' \
184         -e 's,[@]libdir[@],$(libdir),g' \
185         -e 's,[@]localstatedir[@],$(localstatedir),g' \
186         -e 's,[@]prefix[@],$(prefix),g' \
187         -e 's,[@]sysconfdir[@],$(sysconfdir),g'
188
189 # Install header files
190
191 oilsincludedir = @includedir@/openils
192 headsdir = @top_srcdir@/Open-ILS/include/openils
193 oilsinclude_HEADERS = $(headsdir)/idl_fieldmapper.h $(headsdir)/oils_constants.h $(headsdir)/oils_event.h $(headsdir)/oils_idl.h $(headsdir)/oils_utils.h
194
195 # Install everything that did not get installed by autotools
196
197 install-data-hook: $(OILSCORE_INST) $(OILSWEB_INST) $(OILSUPDATES_INST) $(OILSREP_INST)
198
199 uninstall-hook:
200         rm -R $(TEMPLATEDIR)
201         rm -R $(XSLDIR)
202         rm -R $(CGIDIR)
203
204 @srcdir@/extras/fast-extract: Makefile @srcdir@/extras/fast-extract.in
205         $(do_subst) @srcdir@/extras/fast-extract.in > "$@"
206         chmod 755 "$@"
207
208 @srcdir@/extras/import/marc2are.pl: Makefile @srcdir@/extras/import/marc2are.pl.in
209         $(do_subst) @srcdir@/extras/import/marc2are.pl.in > "$@"
210         chmod 755 "$@"
211
212 @srcdir@/extras/import/marc2bre.pl: Makefile @srcdir@/extras/import/marc2bre.pl.in
213         $(do_subst) @srcdir@/extras/import/marc2bre.pl.in > "$@"
214         chmod 755 "$@"
215
216 @srcdir@/extras/import/marc2sre.pl: Makefile @srcdir@/extras/import/marc2sre.pl.in
217         $(do_subst) @srcdir@/extras/import/marc2sre.pl.in > "$@"
218         chmod 755 "$@"
219
220 @srcdir@/extras/import/parallel_pg_loader.pl: Makefile @srcdir@/extras/import/parallel_pg_loader.pl.in
221         $(do_subst) @srcdir@/extras/import/parallel_pg_loader.pl.in > "$@"
222         chmod 755 "$@"
223
224 $(supportscr)/action_trigger_runner.pl: Makefile $(supportscr)/action_trigger_runner.pl.in
225         $(do_subst) $(supportscr)/action_trigger_runner.pl.in > "$@"
226         chmod 755 "$@"
227
228 $(supportscr)/authority_authority_linker.pl: Makefile $(supportscr)/authority_authority_linker.pl.in
229         $(do_subst) $(supportscr)/authority_authority_linker.pl.in > "$@"
230         chmod 755 "$@"
231
232 $(supportscr)/authority_control_fields.pl: Makefile $(supportscr)/authority_control_fields.pl.in
233         $(do_subst) $(supportscr)/authority_control_fields.pl.in > "$@"
234         chmod 755 "$@"
235
236 $(supportscr)/eg_db_config: Makefile $(supportscr)/eg_db_config.in
237         $(do_subst) $(supportscr)/eg_db_config.in > "$@"
238         chmod 755 "$@"
239
240 $(supportscr)/marc_export: Makefile $(supportscr)/marc_export.in
241         $(do_subst) $(supportscr)/marc_export.in > "$@"
242         chmod 755 "$@"
243
244 $(supportscr)/offline-blocked-list.pl: Makefile $(supportscr)/offline-blocked-list.pl.in
245         $(do_subst) $(supportscr)/offline-blocked-list.pl.in > "$@"
246         chmod 755 "$@"
247
248 $(examples)/apache/eg.conf: Makefile $(examples)/apache/eg.conf.in
249         $(do_subst) $(examples)/apache/eg.conf.in > "$@"
250
251 $(examples)/apache/eg_vhost.conf: Makefile $(examples)/apache/eg_vhost.conf.in
252         $(do_subst) $(examples)/apache/eg_vhost.conf.in > "$@"
253
254 $(examples)/apache/eg_startup: Makefile $(examples)/apache/eg_startup.in
255         $(do_subst) $(examples)/apache/eg_startup.in > "$@"
256
257 $(examples)/apache_24/eg_24.conf: Makefile $(examples)/apache_24/eg.conf.in
258         $(do_subst) $(examples)/apache_24/eg.conf.in > "$@"
259
260 $(examples)/apache_24/eg_vhost_24.conf: Makefile $(examples)/apache_24/eg_vhost.conf.in
261         $(do_subst) $(examples)/apache_24/eg_vhost.conf.in > "$@"
262
263 #perl-install and string-templates-install      
264 ilscore-install:
265         @echo $@
266         $(MKDIR_P) $(DESTDIR)$(TEMPLATEDIR)
267         @echo "Installing templates to $(DESTDIR)$(TEMPLATEDIR)"
268         cp -r @srcdir@/templates/* $(DESTDIR)$(TEMPLATEDIR)
269         -@if test -d @srcdir@/data/locale; then \
270                 $(MKDIR_P) $(DESTDIR)$(datadir)/locale/ && \
271                 echo "Installing template data files to $(datadir)/locale/" && \
272                 cp @srcdir@/data/locale/* $(datadir)/locale/ ;\
273         fi;
274         $(MKDIR_P) $(DESTDIR)$(datadir)/overdue/
275         sed -i 's|LOCALSTATEDIR|@localstatedir@|g' '$(DESTDIR)@sysconfdir@/oils_sip.xml.example'
276         sed -i 's|SYSCONFDIR|@sysconfdir@|g' '$(DESTDIR)@sysconfdir@/oils_sip.xml.example'
277         sed -i 's|LIBDIR|@libdir@|g' '$(DESTDIR)@sysconfdir@/oils_sip.xml.example'
278         sed -i 's|LOCALSTATEDIR|@localstatedir@|g' '$(DESTDIR)@sysconfdir@/opensrf_core.xml.example'
279         sed -i 's|SYSCONFDIR|@sysconfdir@|g' '$(DESTDIR)@sysconfdir@/opensrf_core.xml.example'
280         sed -i 's|LOCALSTATEDIR|@localstatedir@|g' '$(DESTDIR)@sysconfdir@/opensrf.xml.example'
281         sed -i 's|SYSCONFDIR|@sysconfdir@|g' '$(DESTDIR)@sysconfdir@/opensrf.xml.example'
282         sed -i 's|LIBDIR|@libdir@|g' '$(DESTDIR)@sysconfdir@/opensrf.xml.example'
283         sed -i 's|BINDIR|@bindir@|g' '$(DESTDIR)@bindir@/autogen.sh'
284         sed -i 's|LOCALSTATEDIR|@localstatedir@|g' '$(DESTDIR)@bindir@/autogen.sh'
285         sed -i 's|SYSCONFDIR|@sysconfdir@|g' '$(DESTDIR)@bindir@/autogen.sh'
286         sed -i 's|BINDIR|@bindir@|g' '$(DESTDIR)@bindir@/reshelving_complete.srfsh'
287         sed -i 's|BINDIR|@bindir@|g' '$(DESTDIR)@bindir@/clear_expired_circ_history.srfsh'
288         sed -i 's|BINDIR|@bindir@|g' '$(DESTDIR)@bindir@/update_hard_due_dates.srfsh'
289         sed -i 's|BINDIR|@bindir@|g' '$(DESTDIR)@bindir@/juv_to_adult.srfsh'
290         sed -i 's|BINDIR|@bindir@|g' '$(DESTDIR)@bindir@/long-overdue-status-update.pl'
291         sed -i 's|SYSCONFDIR|@sysconfdir@|g' '$(DESTDIR)@bindir@/long-overdue-status-update.pl'
292         sed -i 's|BINDIR|@bindir@|g' '$(DESTDIR)@bindir@/thaw_expired_frozen_holds.srfsh'
293         sed -i 's|LOCALSTATEDIR|@localstatedir@|g' '$(DESTDIR)@bindir@/oils_ctl.sh'
294         sed -i 's|SYSCONFDIR|@sysconfdir@|g' '$(DESTDIR)@bindir@/oils_ctl.sh'
295
296 reporter-install:
297         sed -i 's|SYSCONFDIR|@sysconfdir@|g' '$(DESTDIR)@bindir@/clark-kent.pl'
298         sed -i 's|SYSCONFDIR|@sysconfdir@|g' '$(DESTDIR)@bindir@/find_orphaned_reports.pl'
299
300 docs-install: gen_docs
301         $(MKDIR_P) $(DESTDIR)$(docdir)