]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/src/Makefile.am
LP#1776954 Avoid empty string for tcn_source
[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 examples = @top_srcdir@/Open-ILS/examples
28 supportscr = @srcdir@/support-scripts
29
30 # Collect files to be used by multiple targets
31
32 autojsbinscripts = @srcdir@/extras/autogen.sh
33
34 # Decide which entities to build
35
36 sysconf_DATA = $(examples)/action_trigger_filters.json.example \
37                $(examples)/opensrf.xml.example \
38                $(examples)/opensrf_core.xml.example \
39                $(examples)/fm_IDL.xml \
40                $(examples)/oils_sip.xml.example \
41                $(examples)/lib_ips.txt.example \
42                $(examples)/oils_yaz.xml.example \
43                $(examples)/kpac.xml.example \
44                $(examples)/oils_z3950.xml.example \
45                $(examples)/marc_stream_importer.conf.example
46
47 #----------------------------
48 # Build ILS CORE
49 #----------------------------
50
51 if BUILDILSCORE
52
53 #Add directories to build
54 OILSCORE_DIRS = c-apps extras perlmods
55 #Add manual (non-automake) install targets for simplicity of installing.
56 OILSCORE_INST = ilscore-install
57
58 core_data = @srcdir@/extras/ils_events.xml \
59             $(examples)/hold_notification_template.example
60
61 core_scripts =   $(examples)/oils_ctl.sh \
62                  $(supportscr)/fine_generator.pl \
63                  $(supportscr)/hold_targeter.pl \
64                  $(supportscr)/hold_targeter_legacy.pl \
65                  $(supportscr)/reshelving_complete.srfsh \
66                  $(supportscr)/clear_expired_circ_history.srfsh \
67                  $(supportscr)/update_hard_due_dates.srfsh \
68                  $(supportscr)/refresh_carousels.srfsh \
69                  $(supportscr)/juv_to_adult.srfsh \
70                  $(supportscr)/thaw_expired_frozen_holds.srfsh \
71                  $(supportscr)/long-overdue-status-update.pl \
72                  $(supportscr)/oils_header.pl \
73                  $(supportscr)/badge_score_generator.pl \
74                  $(supportscr)/purge_at_events.srfsh \
75                  $(supportscr)/purge_holds.srfsh \
76                  $(supportscr)/purge_circulations.srfsh \
77                  $(supportscr)/purge_pending_users.srfsh \
78                  $(supportscr)/clear_cc_number.srfsh \
79                  $(supportscr)/age_money.srfsh \
80                  $(supportscr)/sitemap_generator \
81                  $(srcdir)/extras/eg_config \
82                  $(srcdir)/extras/openurl_map.pl \
83                  $(srcdir)/extras/import/marc_add_ids \
84                  $(supportscr)/pingest.pl
85
86 installautojs = $(autojsbinscripts)
87
88 endif
89
90 #--------------------
91 # Build Apache modules
92 #--------------------
93
94 if BUILDAPACHEMODS
95 OILSWEB_DIR = apachemods
96 endif
97
98 #---------------------
99 # Build ILS Reporter
100 #---------------------
101
102 if BUILDILSREPORTER
103 OILSREP_INST = reporter-install
104 #reporter-install
105 reporter_scripts = @srcdir@/reporter/clark-kent.pl \
106                    @srcdir@/reporter/find_orphaned_reports.pl
107 reporter_data = @srcdir@/reporter/report-fail \
108                @srcdir@/reporter/report-success
109 endif
110
111 #------------------------------
112 # Build EVERGREEN PYTHON
113 #------------------------------
114
115 if BUILDEGPYTHON
116 OILSPYTHON_DIR = python
117 endif
118
119 #------------------------------
120 # Build EVERGREEN JAVA
121 #------------------------------
122
123 if BUILDEGJAVA
124 OILSJAVA_DIR = java
125 endif
126
127 # scripts that are generated from *.in files and can
128 # be deleted by a make clean
129 gen_scripts = \
130         @srcdir@/extras/fast-extract \
131         @srcdir@/extras/import/marc2are.pl \
132         @srcdir@/extras/import/marc2bre.pl \
133         @srcdir@/extras/import/marc2sre.pl \
134         @srcdir@/extras/import/parallel_pg_loader.pl \
135         $(supportscr)/action_trigger_aggregator.pl \
136         $(supportscr)/action_trigger_runner.pl \
137         $(supportscr)/authority_control_fields.pl \
138         $(supportscr)/authority_authority_linker.pl \
139         $(supportscr)/eg_db_config \
140         $(supportscr)/marc_export \
141         $(supportscr)/marc_stream_importer.pl \
142         $(supportscr)/offline-blocked-list.pl
143
144 # config files that are generated from *.in files and can
145 # be deleted by a make clean
146 gen_docs = \
147         $(examples)/apache_24/eg_startup \
148         $(examples)/apache_24/eg_24.conf \
149         $(examples)/apache_24/eg_vhost_24.conf
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 $(BOOTSTRAPTEMPLATEDIR)
196         rm -R $(XSLDIR)
197         rm -R $(CGIDIR)
198
199 @srcdir@/extras/fast-extract: Makefile @srcdir@/extras/fast-extract.in
200         $(do_subst) @srcdir@/extras/fast-extract.in > "$@"
201         chmod 755 "$@"
202
203 @srcdir@/extras/import/marc2are.pl: Makefile @srcdir@/extras/import/marc2are.pl.in
204         $(do_subst) @srcdir@/extras/import/marc2are.pl.in > "$@"
205         chmod 755 "$@"
206
207 @srcdir@/extras/import/marc2bre.pl: Makefile @srcdir@/extras/import/marc2bre.pl.in
208         $(do_subst) @srcdir@/extras/import/marc2bre.pl.in > "$@"
209         chmod 755 "$@"
210
211 @srcdir@/extras/import/marc2sre.pl: Makefile @srcdir@/extras/import/marc2sre.pl.in
212         $(do_subst) @srcdir@/extras/import/marc2sre.pl.in > "$@"
213         chmod 755 "$@"
214
215 @srcdir@/extras/import/parallel_pg_loader.pl: Makefile @srcdir@/extras/import/parallel_pg_loader.pl.in
216         $(do_subst) @srcdir@/extras/import/parallel_pg_loader.pl.in > "$@"
217         chmod 755 "$@"
218
219 $(supportscr)/action_trigger_aggregator.pl: Makefile $(supportscr)/action_trigger_aggregator.pl.in
220         $(do_subst) $(supportscr)/action_trigger_aggregator.pl.in > "$@"
221         chmod 755 "$@"
222
223 $(supportscr)/action_trigger_runner.pl: Makefile $(supportscr)/action_trigger_runner.pl.in
224         $(do_subst) $(supportscr)/action_trigger_runner.pl.in > "$@"
225         chmod 755 "$@"
226
227 $(supportscr)/authority_authority_linker.pl: Makefile $(supportscr)/authority_authority_linker.pl.in
228         $(do_subst) $(supportscr)/authority_authority_linker.pl.in > "$@"
229         chmod 755 "$@"
230
231 $(supportscr)/authority_control_fields.pl: Makefile $(supportscr)/authority_control_fields.pl.in
232         $(do_subst) $(supportscr)/authority_control_fields.pl.in > "$@"
233         chmod 755 "$@"
234
235 $(supportscr)/eg_db_config: Makefile $(supportscr)/eg_db_config.in
236         $(do_subst) $(supportscr)/eg_db_config.in > "$@"
237         chmod 755 "$@"
238
239 $(supportscr)/marc_export: Makefile $(supportscr)/marc_export.in
240         $(do_subst) $(supportscr)/marc_export.in > "$@"
241         chmod 755 "$@"
242
243 $(supportscr)/marc_stream_importer.pl: Makefile $(supportscr)/marc_stream_importer.pl.in
244         $(do_subst) $(supportscr)/marc_stream_importer.pl.in > "$@"
245         chmod 755 "$@"
246
247 $(supportscr)/offline-blocked-list.pl: Makefile $(supportscr)/offline-blocked-list.pl.in
248         $(do_subst) $(supportscr)/offline-blocked-list.pl.in > "$@"
249         chmod 755 "$@"
250
251 $(examples)/apache_24/eg_startup: Makefile $(examples)/apache_24/eg_startup.in
252         $(do_subst) $(examples)/apache_24/eg_startup.in > "$@"
253
254 $(examples)/apache_24/eg_24.conf: Makefile $(examples)/apache_24/eg.conf.in
255         $(do_subst) $(examples)/apache_24/eg.conf.in > "$@"
256
257 $(examples)/apache_24/eg_vhost_24.conf: Makefile $(examples)/apache_24/eg_vhost.conf.in
258         $(do_subst) $(examples)/apache_24/eg_vhost.conf.in > "$@"
259
260 #perl-install and string-templates-install      
261 ilscore-install:
262         @echo $@
263         $(MKDIR_P) $(DESTDIR)$(TEMPLATEDIR)
264         @echo "Installing templates to $(DESTDIR)$(TEMPLATEDIR)"
265         cp -r @srcdir@/templates/* $(DESTDIR)$(TEMPLATEDIR)
266         $(MKDIR_P) $(DESTDIR)$(BOOTSTRAPTEMPLATEDIR)
267         @echo "Installing Bootstrap templates to $(DESTDIR)$(BOOTSTRAPTEMPLATEDIR)"
268         cp -r @srcdir@/templates-bootstrap/* $(DESTDIR)$(BOOTSTRAPTEMPLATEDIR)
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 -r @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|LOCALSTATEDIR|@localstatedir@|g' '$(DESTDIR)@sysconfdir@/marc_stream_importer.conf.example'
284         sed -i 's|SYSCONFDIR|@sysconfdir@|g' '$(DESTDIR)@sysconfdir@/marc_stream_importer.conf.example'
285         sed -i 's|BINDIR|@bindir@|g' '$(DESTDIR)@bindir@/autogen.sh'
286         sed -i 's|LOCALSTATEDIR|@localstatedir@|g' '$(DESTDIR)@bindir@/autogen.sh'
287         sed -i 's|SYSCONFDIR|@sysconfdir@|g' '$(DESTDIR)@bindir@/autogen.sh'
288         sed -i 's|BINDIR|@bindir@|g' '$(DESTDIR)@bindir@/reshelving_complete.srfsh'
289         sed -i 's|BINDIR|@bindir@|g' '$(DESTDIR)@bindir@/clear_expired_circ_history.srfsh'
290         sed -i 's|BINDIR|@bindir@|g' '$(DESTDIR)@bindir@/update_hard_due_dates.srfsh'
291         sed -i 's|BINDIR|@bindir@|g' '$(DESTDIR)@bindir@/refresh_carousels.srfsh'
292         sed -i 's|BINDIR|@bindir@|g' '$(DESTDIR)@bindir@/juv_to_adult.srfsh'
293         sed -i 's|BINDIR|@bindir@|g' '$(DESTDIR)@bindir@/long-overdue-status-update.pl'
294         sed -i 's|SYSCONFDIR|@sysconfdir@|g' '$(DESTDIR)@bindir@/long-overdue-status-update.pl'
295         sed -i 's|BINDIR|@bindir@|g' '$(DESTDIR)@bindir@/thaw_expired_frozen_holds.srfsh'
296         sed -i 's|BINDIR|@bindir@|g' '$(DESTDIR)@bindir@/clear_cc_number.srfsh'
297         sed -i 's|BINDIR|@bindir@|g' '$(DESTDIR)@bindir@/age_money.srfsh'
298         sed -i 's|BINDIR|@bindir@|g' '$(DESTDIR)@bindir@/purge_at_events.srfsh'
299         sed -i 's|BINDIR|@bindir@|g' '$(DESTDIR)@bindir@/purge_circulations.srfsh'
300         sed -i 's|BINDIR|@bindir@|g' '$(DESTDIR)@bindir@/purge_holds.srfsh'
301         sed -i 's|BINDIR|@bindir@|g' '$(DESTDIR)@bindir@/purge_pending_users.srfsh'
302         sed -i 's|LOCALSTATEDIR|@localstatedir@|g' '$(DESTDIR)@bindir@/oils_ctl.sh'
303         sed -i 's|SYSCONFDIR|@sysconfdir@|g' '$(DESTDIR)@bindir@/oils_ctl.sh'
304
305 reporter-install:
306         sed -i 's|SYSCONFDIR|@sysconfdir@|g' '$(DESTDIR)@bindir@/clark-kent.pl'
307         sed -i 's|SYSCONFDIR|@sysconfdir@|g' '$(DESTDIR)@bindir@/find_orphaned_reports.pl'
308
309 docs-install: gen_docs
310         $(MKDIR_P) $(DESTDIR)$(docdir)