]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/src/Makefile.am
Fix in-transit hold retarget
[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/autogen.sh \
38         @srcdir@/support-scripts/offline-blocked-list.pl 
39
40 # Decide which entities to build
41
42 sysconf_DATA = $(examples)/action_trigger_filters.json.example \
43                $(examples)/opensrf.xml.example \
44                $(examples)/opensrf_core.xml.example \
45                $(examples)/fm_IDL.xml \
46                $(examples)/oils_sip.xml.example \
47                $(examples)/lib_ips.txt.example \
48                $(examples)/oils_yaz.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/openurl_map.pl \
76                  $(srcdir)/extras/import/marc_add_ids
77
78 installautojs = $(autojsbinscripts)
79
80 #circ-rules-install
81 circrules_SCRIPTS = $(jsbackend)/circ/circ_duration.js \
82                     $(jsbackend)/circ/circ_groups.js \
83                     $(jsbackend)/circ/circ_item_config.js \
84                     $(jsbackend)/circ/circ_lib.js \
85                     $(jsbackend)/circ/circ_permit_copy.js \
86                     $(jsbackend)/circ/circ_permit_hold.js \
87                     $(jsbackend)/circ/circ_permit_patron.js \
88                     $(jsbackend)/circ/circ_permit_renew.js 
89 penaltyrules_SCRIPTS = $(jsbackend)/penalty/patron_penalty.js
90 catalogscript_SCRIPTS = $(jsbackend)/catalog/biblio_descriptor.js \
91                         $(jsbackend)/catalog/biblio_fingerprint.js \
92                         $(jsbackend)/catalog/fixed_fields.js \
93                         $(jsbackend)/catalog/phys_char.js \
94                         $(jsbackend)/catalog/record_type.js
95
96 endif
97
98 #--------------------
99 # Build Apache modules
100 #--------------------
101
102 if BUILDAPACHEMODS
103 OILSWEB_DIR = apachemods
104 endif
105
106 #---------------------
107 # Build ILS Reporter
108 #---------------------
109
110 if BUILDILSREPORTER
111 OILSREP_INST = reporter-install
112 #reporter-install
113 reporter_scripts = @srcdir@/reporter/clark-kent.pl \
114                    @srcdir@/reporter/find_orphaned_reports.pl
115 reporter_data = @srcdir@/reporter/report-fail \
116                @srcdir@/reporter/report-success
117 endif
118
119 #------------------------------
120 # Build EVERGREEN PYTHON
121 #------------------------------
122
123 if BUILDEGPYTHON
124 OILSPYTHON_DIR = python
125 endif
126
127 #------------------------------
128 # Build EVERGREEN JAVA
129 #------------------------------
130
131 if BUILDEGJAVA
132 OILSJAVA_DIR = java
133 endif
134
135 gen_scripts = \
136         @srcdir@/extras/fast-extract \
137         @srcdir@/extras/import/marc2are.pl \
138         @srcdir@/extras/import/marc2bre.pl \
139         @srcdir@/extras/import/marc2sre.pl \
140         @srcdir@/extras/import/parallel_pg_loader.pl \
141         $(supportscr)/authority_control_fields.pl \
142         $(supportscr)/marc_export
143
144 bin_SCRIPTS = $(core_scripts) $(gen_scripts) $(reporter_scripts) $(installautojs)
145
146 CLEANFILES = $(gen_scripts)
147
148 data_DATA = $(core_data) $(reporter_data)
149
150 # Take care of which subdirectories to build, and which extra files to include in a distribution.
151
152 SUBDIRS = $(OILSCORE_DIRS) $(OILSWEB_DIR) $(OILSPYTHON_DIR) $(OILSJAVA_DIR)
153
154 EXTRA_DIST = @srcdir@/perlmods \
155         @srcdir@/templates \
156         @top_srcdir@/Open-ILS/xsl \
157         @srcdir@/cgi-bin \
158         $(gen_scripts) \
159         @srcdir@/extras/eg_config
160
161 do_subst = $(SED) \
162         -e 's,[@]bindir[@],$(bindir),g' \
163         -e 's,[@]datarootdir[@],$(datarootdir),g' \
164         -e 's,[@]docdir[@],$(docdir),g' \
165         -e 's,[@]exec_prefix[@],$(exec_prefix),g' \
166         -e 's,[@]includedir[@],$(includedir),g' \
167         -e 's,[@]libdir[@],$(libdir),g' \
168         -e 's,[@]prefix[@],$(prefix),g' \
169         -e 's,[@]sysconfdir[@],$(sysconfdir),g'
170
171 # Install header files
172
173 oilsincludedir = @includedir@/openils
174 headsdir = @top_srcdir@/Open-ILS/include/openils
175 oilsinclude_HEADERS = $(headsdir)/idl_fieldmapper.h $(headsdir)/oils_constants.h $(headsdir)/oils_event.h $(headsdir)/oils_idl.h $(headsdir)/oils_utils.h
176
177 # Install everything that did not get installed by autotools
178
179 install-data-hook: $(OILSCORE_INST) $(OILSWEB_INST) $(OILSUPDATES_INST) $(OILSREP_INST)
180
181 uninstall-hook:
182         rm -R $(TEMPLATEDIR)
183         rm -R $(XSLDIR)
184         rm -R $(CGIDIR)
185
186 @srcdir@/extras/fast-extract: Makefile @srcdir@/extras/fast-extract.in
187         $(do_subst) @srcdir@/extras/fast-extract.in > "$@"
188         chmod 755 "$@"
189
190 @srcdir@/extras/import/marc2are.pl: Makefile @srcdir@/extras/import/marc2are.pl.in
191         $(do_subst) @srcdir@/extras/import/marc2are.pl.in > "$@"
192         chmod 755 "$@"
193
194 @srcdir@/extras/import/marc2bre.pl: Makefile @srcdir@/extras/import/marc2bre.pl.in
195         $(do_subst) @srcdir@/extras/import/marc2bre.pl.in > "$@"
196         chmod 755 "$@"
197
198 @srcdir@/extras/import/marc2sre.pl: Makefile @srcdir@/extras/import/marc2sre.pl.in
199         $(do_subst) @srcdir@/extras/import/marc2sre.pl.in > "$@"
200         chmod 755 "$@"
201
202 @srcdir@/extras/import/parallel_pg_loader.pl: Makefile @srcdir@/extras/import/parallel_pg_loader.pl.in
203         $(do_subst) @srcdir@/extras/import/parallel_pg_loader.pl.in > "$@"
204         chmod 755 "$@"
205
206 $(supportscr)/authority_control_fields.pl: Makefile $(supportscr)/authority_control_fields.pl.in
207         $(do_subst) $(supportscr)/authority_control_fields.pl.in > "$@"
208         chmod 755 "$@"
209
210 $(supportscr)/marc_export: Makefile $(supportscr)/marc_export.in
211         $(do_subst) $(supportscr)/marc_export.in > "$@"
212         chmod 755 "$@"
213
214 #perl-install and string-templates-install      
215 ilscore-install:
216         @echo $@
217         $(MKDIR_P) $(DESTDIR)$(TEMPLATEDIR)
218         @echo "Installing templates to $(DESTDIR)$(TEMPLATEDIR)"
219         cp -r @srcdir@/templates/* $(DESTDIR)$(TEMPLATEDIR)
220         $(MKDIR_P) $(DESTDIR)$(datadir)/overdue/
221         sed -i 's|LOCALSTATEDIR|@localstatedir@|g' '$(DESTDIR)@sysconfdir@/oils_sip.xml.example'
222         sed -i 's|SYSCONFDIR|@sysconfdir@|g' '$(DESTDIR)@sysconfdir@/oils_sip.xml.example'
223         sed -i 's|LIBDIR|@libdir@|g' '$(DESTDIR)@sysconfdir@/oils_sip.xml.example'
224         sed -i 's|LOCALSTATEDIR|@localstatedir@|g' '$(DESTDIR)@sysconfdir@/opensrf_core.xml.example'
225         sed -i 's|SYSCONFDIR|@sysconfdir@|g' '$(DESTDIR)@sysconfdir@/opensrf_core.xml.example'
226         sed -i 's|LOCALSTATEDIR|@localstatedir@|g' '$(DESTDIR)@sysconfdir@/opensrf.xml.example'
227         sed -i 's|SYSCONFDIR|@sysconfdir@|g' '$(DESTDIR)@sysconfdir@/opensrf.xml.example'
228         sed -i 's|LIBDIR|@libdir@|g' '$(DESTDIR)@sysconfdir@/opensrf.xml.example'
229         sed -i 's|BINDIR|@bindir@|g' '$(DESTDIR)@bindir@/autogen.sh'
230         sed -i 's|LOCALSTATEDIR|@localstatedir@|g' '$(DESTDIR)@bindir@/autogen.sh'
231         sed -i 's|SYSCONFDIR|@sysconfdir@|g' '$(DESTDIR)@bindir@/autogen.sh'
232         sed -i 's|BINDIR|@bindir@|g' '$(DESTDIR)@bindir@/reshelving_complete.srfsh'
233         sed -i 's|BINDIR|@bindir@|g' '$(DESTDIR)@bindir@/clear_expired_circ_history.srfsh'
234         sed -i 's|BINDIR|@bindir@|g' '$(DESTDIR)@bindir@/update_hard_due_dates.srfsh'
235         sed -i 's|BINDIR|@bindir@|g' '$(DESTDIR)@bindir@/juv_to_adult.srfsh'
236         sed -i 's|BINDIR|@bindir@|g' '$(DESTDIR)@bindir@/long-overdue-status-update.pl'
237         sed -i 's|SYSCONFDIR|@sysconfdir@|g' '$(DESTDIR)@bindir@/long-overdue-status-update.pl'
238         sed -i 's|BINDIR|@bindir@|g' '$(DESTDIR)@bindir@/thaw_expired_frozen_holds.srfsh'
239         sed -i 's|BINDIR|@bindir@|g' '$(DESTDIR)@bindir@/offline-blocked-list.pl'
240         sed -i 's|LOCALSTATEDIR|@localstatedir@|g' '$(DESTDIR)@bindir@/oils_ctl.sh'
241         sed -i 's|SYSCONFDIR|@sysconfdir@|g' '$(DESTDIR)@bindir@/oils_ctl.sh'
242
243 reporter-install:
244         sed -i 's|SYSCONFDIR|@sysconfdir@|g' '$(DESTDIR)@bindir@/clark-kent.pl'
245         sed -i 's|SYSCONFDIR|@sysconfdir@|g' '$(DESTDIR)@bindir@/find_orphaned_reports.pl'
246
247