]> git.evergreen-ils.org Git - OpenSRF.git/blob - src/Makefile.am
74227f6bf9d5d27e1a0a7464eec52e1763046b66
[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 OPENSRF  = opensrf
18 export BINDIR   = @bindir@
19 export LIBDIR   = @libdir@
20 export OSRF_JAVA_DEPSDIR = @OSRF_JAVA_DEPSDIR@
21 etcdir = $(ETCDIR)
22
23 DISTCLEANFILES = Makefile.in Makefile
24
25 AM_LDFLAGS = $(DEF_LDFLAGS)
26 AM_CFLAGS = $(DEF_CFLAGS)
27
28 if BUILDPYTHON
29 MAYBE_PY = python
30 endif 
31
32 if BUILDJAVA
33 MAYBE_JA = java
34 endif
35
36 if INSTALLJAVASCRIPT
37 MAYBE_JAVASCRIPT = javascript
38 jsdir = $(prefix)/lib/javascript
39 js_SCRIPTS = javascript/DojoSRF.js javascript/JSON_v0.js javascript/JSON_v1.js javascript/md5.js javascript/opensrf.js javascript/opensrf_xhr.js javascript/opensrf_xmpp.js
40 endif
41
42 if BUILDCORE
43 MAYBE_CORE = libopensrf c-apps router srfsh gateway perl
44 if BUILDPYTHON
45 dist_bin_SCRIPTS = @top_srcdir@/bin/opensrf-perl.pl @top_srcdir@/src/python/opensrf.py @top_srcdir@/src/python/srfsh.py
46 else
47 dist_bin_SCRIPTS = @top_srcdir@/bin/opensrf-perl.pl
48 endif
49 bin_SCRIPTS = @top_srcdir@/bin/osrf_config @top_srcdir@/bin/osrf_ctl.sh 
50 dist_sysconf_DATA = @top_srcdir@/examples/opensrf.xml.example @top_srcdir@/examples/opensrf_core.xml.example @top_srcdir@/examples/srfsh.xml.example 
51 endif
52
53 if BUILDCHOPCHOP
54 MAYBE_CHOPCHOP = jserver
55 endif
56
57 SUBDIRS = $(MAYBE_CORE) $(MAYBE_PY) $(MAYBE_JA)
58
59 install-exec-local:
60         $(MKDIR_P) $(DESTDIR)$(VAR)
61         $(MKDIR_P) $(DESTDIR)$(PID)
62         $(MKDIR_P) $(DESTDIR)$(LOG)
63         $(MKDIR_P) $(DESTDIR)$(SOCK)
64         $(MKDIR_P) $(DESTDIR)$(jsdir)
65
66 install-exec-hook:
67         if [ "$(MAYBE_CORE)" ]; then \
68                 for f in opensrf.xml.example opensrf_core.xml.example srfsh.xml.example ; do \
69                         mv "$(DESTDIR)@sysconfdir@/$${f}" "$(DESTDIR)@sysconfdir@/$${f}.bak" ; \
70                         sed -e 's|LOCALSTATEDIR|$(VAR)|g' -e 's|SYSCONFDIR|$(ETCDIR)|g' \
71                                 "$(DESTDIR)@sysconfdir@/$${f}.bak" > "$(DESTDIR)@sysconfdir@/$${f}" ; \
72                         rm "$(DESTDIR)@sysconfdir@/$${f}.bak" ; \
73                 done; \
74         fi
75         cp -r @srcdir@/javascript/* $(DESTDIR)$(jsdir)/
76
77 uninstall-hook:
78         rm -f @includedir@/opensrf/apachetools.h
79