]> git.evergreen-ils.org Git - OpenSRF.git/blob - src/Makefile.am
Cheap hack to enable kbeswick's cheap hack to get opensrf-c
[OpenSRF.git] / 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
15 # Declare some directory variables
16
17 export TMPDIR   = $(TMP)
18 export OPENSRF  = opensrf
19 export BINDIR   = @bindir@
20 export LIBDIR   = @libdir@
21 perldir = $(LIBDIR)/perl5
22 jsdir = $(LIBDIR)/javascript
23 export INCLUDEDIR= @includedir@
24 export OSRF_JAVA_DEPSDIR = @OSRF_JAVA_DEPSDIR@
25 etcdir = $(ETCDIR)
26
27
28 AM_LDFLAGS = $(DEF_LDFLAGS)
29 AM_CFLAGS = $(DEF_CFLAGS)
30
31 if BUILDJSON
32 LDADD = -lobjson
33 BJSON=1
34 endif
35
36 if BUILDPYTHON
37 MAYBE_PY = python
38 endif 
39
40 if BUILDJAVA
41 MAYBE_JA = java
42 endif
43
44 SUBDIRS = libopensrf c-apps router srfsh jserver gateway $(MAYBE_PY) $(MAYBE_JA)
45
46 dist_bin_SCRIPTS = ../bin/osrf_ctl.sh
47 bin_SCRIPTS = ../bin/osrf_config
48
49 dist_etc_DATA = @top_srcdir@/examples/opensrf.xml.example @top_srcdir@/examples/opensrf_core.xml.example @top_srcdir@/examples/srfsh.xml.example 
50
51 install-exec-local:
52         mkdir -p $(VAR)
53         mkdir -p $(PID)
54         mkdir -p $(LOG)
55         mkdir -p $(SOCK)
56         mkdir -p $(ETCDIR)
57         mkdir -p $(jsdir)
58         mkdir -p $(perldir)
59
60 install-data-hook:
61         ln -sf $(BINDIR)/opensrf $(BINDIR)/opensrf-c
62         sed -i 's|LOCALSTATEDIR|$(VAR)|g' '$(ETCDIR)/opensrf.xml.example'
63         sed -i 's|SYSCONFDIR|$(ETCDIR)|g' '$(ETCDIR)/opensrf.xml.example'
64         sed -i 's|LOCALSTATEDIR|$(VAR)|g' '$(ETCDIR)/opensrf_core.xml.example'
65         sed -i 's|SYSCONFDIR|$(ETCDIR)|g' '$(ETCDIR)/opensrf_core.xml.example'
66         sed -i 's|LOCALSTATEDIR|$(VAR)|g' '$(ETCDIR)/srfsh.xml.example'
67         sed -i 's|SYSCONFDIR|$(ETCDIR)|g' '$(ETCDIR)/srfsh.xml.example'
68         sed -i 's|SYSCONFDIR|$(ETCDIR)|g' '@abs_top_srcdir@/examples/math_bench.pl'
69         sed -i 's|LIBDIR|$(LIBDIR)|g' '@abs_top_srcdir@/examples/multisession-test.pl'
70         sed -i 's|SYSCONFDIR|$(ETCDIR)|g' '@abs_top_srcdir@/doc/dokuwiki-doc-stubber.pl'
71         cp -r @srcdir@/javascript/* $(jsdir)/
72         sed -i 's|LOCALSTATEDIR|$(VAR)|g' '@srcdir@/perlmods/OpenSRF/Utils/Config.pm'
73         cp -r @srcdir@/perlmods/* $(perldir)/
74
75
76 uninstall-hook:
77         rm $(INCLUDEDIR)/opensrf/apachetools.h
78         rm $(bindir)/opensrf-c