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