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