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