Stamping upgrade for relaxing rank_ou sorting
[working/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         @srcdir@/support-scripts/offline-blocked-list.pl 
38
39 # Decide which entities to build
40
41 sysconf_DATA = $(examples)/action_trigger_filters.json.example \
42                $(examples)/opensrf.xml.example \
43                $(examples)/opensrf_core.xml.example \
44                $(examples)/fm_IDL.xml \
45                $(examples)/oils_sip.xml.example \
46                $(examples)/lib_ips.txt.example \
47                $(examples)/oils_yaz.xml.example \
48                $(examples)/kpac.xml.example \
49                $(examples)/oils_z3950.xml.example 
50
51 #----------------------------
52 # Build ILS CORE
53 #----------------------------
54
55 if BUILDILSCORE
56
57 #Add directories to build
58 OILSCORE_DIRS = c-apps extras perlmods
59 #Add manual (non-automake) install targets for simplicity of installing.
60 OILSCORE_INST = ilscore-install
61
62 core_data = @srcdir@/extras/ils_events.xml \
63             $(examples)/hold_notification_template.example
64
65 core_scripts =   $(examples)/oils_ctl.sh \
66                  $(supportscr)/fine_generator.pl \
67                  $(supportscr)/hold_targeter.pl \
68                  $(supportscr)/reshelving_complete.srfsh \
69                  $(supportscr)/clear_expired_circ_history.srfsh \
70                  $(supportscr)/update_hard_due_dates.srfsh \
71                  $(supportscr)/juv_to_adult.srfsh \
72                  $(supportscr)/thaw_expired_frozen_holds.srfsh \
73                  $(supportscr)/long-overdue-status-update.pl \
74                  $(supportscr)/action_trigger_runner.pl \
75                  $(srcdir)/extras/eg_config \
76                  $(srcdir)/extras/openurl_map.pl \
77                  $(srcdir)/extras/import/marc_add_ids
78
79 installautojs = $(autojsbinscripts)
80
81 #circ-rules-install
82 circrules_SCRIPTS = $(jsbackend)/circ/circ_duration.js \
83                     $(jsbackend)/circ/circ_groups.js \
84                     $(jsbackend)/circ/circ_item_config.js \
85                     $(jsbackend)/circ/circ_lib.js \
86                     $(jsbackend)/circ/circ_permit_copy.js \
87                     $(jsbackend)/circ/circ_permit_hold.js \
88                     $(jsbackend)/circ/circ_permit_patron.js \
89                     $(jsbackend)/circ/circ_permit_renew.js 
90 penaltyrules_SCRIPTS = $(jsbackend)/penalty/patron_penalty.js
91 catalogscript_SCRIPTS = $(jsbackend)/catalog/biblio_descriptor.js \
92                         $(jsbackend)/catalog/biblio_fingerprint.js \
93                         $(jsbackend)/catalog/fixed_fields.js \
94                         $(jsbackend)/catalog/phys_char.js \
95                         $(jsbackend)/catalog/record_type.js
96
97 endif
98
99 #--------------------
100 # Build Apache modules
101 #--------------------
102
103 if BUILDAPACHEMODS
104 OILSWEB_DIR = apachemods
105 endif
106
107 #---------------------
108 # Build ILS Reporter
109 #---------------------
110
111 if BUILDILSREPORTER
112 OILSREP_INST = reporter-install
113 #reporter-install
114 reporter_scripts = @srcdir@/reporter/clark-kent.pl \
115                    @srcdir@/reporter/find_orphaned_reports.pl
116 reporter_data = @srcdir@/reporter/report-fail \
117                @srcdir@/reporter/report-success
118 endif
119
120 #------------------------------
121 # Build EVERGREEN PYTHON
122 #------------------------------
123
124 if BUILDEGPYTHON
125 OILSPYTHON_DIR = python
126 endif
127
128 #------------------------------
129 # Build EVERGREEN JAVA
130 #------------------------------
131
132 if BUILDEGJAVA
133 OILSJAVA_DIR = java
134 endif
135
136 gen_scripts = \
137         @srcdir@/extras/fast-extract \
138         @srcdir@/extras/import/marc2are.pl \
139         @srcdir@/extras/import/marc2bre.pl \
140         @srcdir@/extras/import/marc2sre.pl \
141         @srcdir@/extras/import/parallel_pg_loader.pl \
142         $(supportscr)/authority_control_fields.pl \
143         $(supportscr)/eg_db_config \
144         $(supportscr)/marc_export
145
146 gen_docs = \
147         $(examples)/apache/eg.conf \
148         $(examples)/apache/eg_vhost.conf \
149         $(examples)/apache/eg_startup
150
151 bin_SCRIPTS = $(core_scripts) $(gen_scripts) $(reporter_scripts) $(installautojs)
152
153 CLEANFILES = $(gen_scripts)
154
155 data_DATA = $(core_data) $(reporter_data)
156
157 doc_DATA = $(gen_docs)
158
159 # Take care of which subdirectories to build, and which extra files to include in a distribution.
160
161 SUBDIRS = $(OILSCORE_DIRS) $(OILSWEB_DIR) $(OILSPYTHON_DIR) $(OILSJAVA_DIR)
162
163 EXTRA_DIST = @srcdir@/perlmods \
164         @srcdir@/data \
165         @srcdir@/templates \
166         @top_srcdir@/Open-ILS/xsl \
167         @srcdir@/cgi-bin \
168         $(gen_scripts) \
169         $(gen_docs) \
170         @srcdir@/extras/eg_config
171
172 do_subst = $(SED) \
173         -e 's,[@]bindir[@],$(bindir),g' \
174         -e 's,[@]datarootdir[@],$(datarootdir),g' \
175         -e 's,[@]docdir[@],$(docdir),g' \
176         -e 's,[@]exec_prefix[@],$(exec_prefix),g' \
177         -e 's,[@]includedir[@],$(includedir),g' \
178         -e 's,[@]libdir[@],$(libdir),g' \
179         -e 's,[@]localstatedir[@],$(localstatedir),g' \
180         -e 's,[@]prefix[@],$(prefix),g' \
181         -e 's,[@]sysconfdir[@],$(sysconfdir),g'
182
183 # Install header files
184
185 oilsincludedir = @includedir@/openils
186 headsdir = @top_srcdir@/Open-ILS/include/openils
187 oilsinclude_HEADERS = $(headsdir)/idl_fieldmapper.h $(headsdir)/oils_constants.h $(headsdir)/oils_event.h $(headsdir)/oils_idl.h $(headsdir)/oils_utils.h
188
189 # Install everything that did not get installed by autotools
190
191 install-data-hook: $(OILSCORE_INST) $(OILSWEB_INST) $(OILSUPDATES_INST) $(OILSREP_INST)
192
193 uninstall-hook:
194         rm -R $(TEMPLATEDIR)
195         rm -R $(XSLDIR)
196         rm -R $(CGIDIR)
197
198 @srcdir@/extras/fast-extract: Makefile @srcdir@/extras/fast-extract.in
199         $(do_subst) @srcdir@/extras/fast-extract.in > "$@"
200         chmod 755 "$@"
201
202 @srcdir@/extras/import/marc2are.pl: Makefile @srcdir@/extras/import/marc2are.pl.in
203         $(do_subst) @srcdir@/extras/import/marc2are.pl.in > "$@"
204         chmod 755 "$@"
205
206 @srcdir@/extras/import/marc2bre.pl: Makefile @srcdir@/extras/import/marc2bre.pl.in
207         $(do_subst) @srcdir@/extras/import/marc2bre.pl.in > "$@"
208         chmod 755 "$@"
209
210 @srcdir@/extras/import/marc2sre.pl: Makefile @srcdir@/extras/import/marc2sre.pl.in
211         $(do_subst) @srcdir@/extras/import/marc2sre.pl.in > "$@"
212         chmod 755 "$@"
213
214 @srcdir@/extras/import/parallel_pg_loader.pl: Makefile @srcdir@/extras/import/parallel_pg_loader.pl.in
215         $(do_subst) @srcdir@/extras/import/parallel_pg_loader.pl.in > "$@"
216         chmod 755 "$@"
217
218 $(supportscr)/authority_control_fields.pl: Makefile $(supportscr)/authority_control_fields.pl.in
219         $(do_subst) $(supportscr)/authority_control_fields.pl.in > "$@"
220         chmod 755 "$@"
221
222 $(supportscr)/eg_db_config: Makefile $(supportscr)/eg_db_config.in
223         $(do_subst) $(supportscr)/eg_db_config.in > "$@"
224         chmod 755 "$@"
225
226 $(supportscr)/marc_export: Makefile $(supportscr)/marc_export.in
227         $(do_subst) $(supportscr)/marc_export.in > "$@"
228         chmod 755 "$@"
229
230 $(examples)/apache/eg.conf: Makefile $(examples)/apache/eg.conf.in
231         $(do_subst) $(examples)/apache/eg.conf.in > "$@"
232
233 $(examples)/apache/eg_vhost.conf: Makefile $(examples)/apache/eg_vhost.conf.in
234         $(do_subst) $(examples)/apache/eg_vhost.conf.in > "$@"
235
236 $(examples)/apache/eg_startup: Makefile $(examples)/apache/eg_startup.in
237         $(do_subst) $(examples)/apache/eg_startup.in > "$@"
238
239 #perl-install and string-templates-install      
240 ilscore-install:
241         @echo $@
242         $(MKDIR_P) $(DESTDIR)$(TEMPLATEDIR)
243         @echo "Installing templates to $(DESTDIR)$(TEMPLATEDIR)"
244         cp -r @srcdir@/templates/* $(DESTDIR)$(TEMPLATEDIR)
245         -@if test -d @srcdir@/data/locale; then \
246                 $(MKDIR_P) $(DESTDIR)$(datadir)/locale/ && \
247                 echo "Installing template data files to $(datadir)/locale/" && \
248                 cp @srcdir@/data/locale/* $(datadir)/locale/ ;\
249         fi;
250         $(MKDIR_P) $(DESTDIR)$(datadir)/overdue/
251         sed -i 's|LOCALSTATEDIR|@localstatedir@|g' '$(DESTDIR)@sysconfdir@/oils_sip.xml.example'
252         sed -i 's|SYSCONFDIR|@sysconfdir@|g' '$(DESTDIR)@sysconfdir@/oils_sip.xml.example'
253         sed -i 's|LIBDIR|@libdir@|g' '$(DESTDIR)@sysconfdir@/oils_sip.xml.example'
254         sed -i 's|LOCALSTATEDIR|@localstatedir@|g' '$(DESTDIR)@sysconfdir@/opensrf_core.xml.example'
255         sed -i 's|SYSCONFDIR|@sysconfdir@|g' '$(DESTDIR)@sysconfdir@/opensrf_core.xml.example'
256         sed -i 's|LOCALSTATEDIR|@localstatedir@|g' '$(DESTDIR)@sysconfdir@/opensrf.xml.example'
257         sed -i 's|SYSCONFDIR|@sysconfdir@|g' '$(DESTDIR)@sysconfdir@/opensrf.xml.example'
258         sed -i 's|LIBDIR|@libdir@|g' '$(DESTDIR)@sysconfdir@/opensrf.xml.example'
259         sed -i 's|BINDIR|@bindir@|g' '$(DESTDIR)@bindir@/autogen.sh'
260         sed -i 's|LOCALSTATEDIR|@localstatedir@|g' '$(DESTDIR)@bindir@/autogen.sh'
261         sed -i 's|SYSCONFDIR|@sysconfdir@|g' '$(DESTDIR)@bindir@/autogen.sh'
262         sed -i 's|BINDIR|@bindir@|g' '$(DESTDIR)@bindir@/reshelving_complete.srfsh'
263         sed -i 's|BINDIR|@bindir@|g' '$(DESTDIR)@bindir@/clear_expired_circ_history.srfsh'
264         sed -i 's|BINDIR|@bindir@|g' '$(DESTDIR)@bindir@/update_hard_due_dates.srfsh'
265         sed -i 's|BINDIR|@bindir@|g' '$(DESTDIR)@bindir@/juv_to_adult.srfsh'
266         sed -i 's|BINDIR|@bindir@|g' '$(DESTDIR)@bindir@/long-overdue-status-update.pl'
267         sed -i 's|SYSCONFDIR|@sysconfdir@|g' '$(DESTDIR)@bindir@/long-overdue-status-update.pl'
268         sed -i 's|BINDIR|@bindir@|g' '$(DESTDIR)@bindir@/thaw_expired_frozen_holds.srfsh'
269         sed -i 's|BINDIR|@bindir@|g' '$(DESTDIR)@bindir@/offline-blocked-list.pl'
270         sed -i 's|LOCALSTATEDIR|@localstatedir@|g' '$(DESTDIR)@bindir@/oils_ctl.sh'
271         sed -i 's|SYSCONFDIR|@sysconfdir@|g' '$(DESTDIR)@bindir@/oils_ctl.sh'
272
273 reporter-install:
274         sed -i 's|SYSCONFDIR|@sysconfdir@|g' '$(DESTDIR)@bindir@/clark-kent.pl'
275         sed -i 's|SYSCONFDIR|@sysconfdir@|g' '$(DESTDIR)@bindir@/find_orphaned_reports.pl'
276
277 docs-install: gen_docs
278         $(MKDIR_P) $(DESTDIR)$(docdir)