added a settings server client and test. made the global config object wrapped in...
[OpenSRF.git] / src / Makefile
1 # TOP level 'src' makefile for OpenSRF
2
3
4 export TMPDIR                   = $(TMP)/opensrf
5 export OPENSRF                  = opensrf
6 export BINDIR                   = $(PREFIX)/bin
7 export LIBDIR                   = $(PREFIX)/lib
8 export PERLDIR                  = $(LIBDIR)/perl5
9 export INCLUDEDIR               = $(PREFIX)/include
10
11 export LDLIBS                   += 
12 export LDFLAGS                  += -L $(TMPDIR) -L . -L /opt/lib
13 export CFLAGS                   += -pipe -g -Wall -O2 -fPIC -I$(LIBXML2_HEADERS) -I$(APACHE2_HEADERS) \
14                                                                 -I$(LIBXML2_HEADERS)/libxml  -I$(TMP) \
15                                                                 -I$(APR_HEADERS) -I$(TMPDIR)
16
17 LIBOPENSRF                              = libopensrf.so
18
19 OPENSRF_TARGETS =       libtransport/transport_session.o \
20                         libtransport/transport_client.o \
21                         libtransport/transport_message.o \
22                         libstack/osrf_app_session.o \
23                         libstack/osrf_stack.o \
24                         libstack/osrfConfig.o \
25                         libstack/osrf_settings.o \
26                         libstack/osrf_message.o \
27                         libstack/osrf_prefork.o \
28                         libstack/osrf_system.o \
29                         libstack/osrf_application.o \
30                         libstack/osrf_cache.o \
31                         libstack/xml_utils.o \
32                         libstack/osrf_transgroup.o \
33                         libstack/osrf_list.o \
34                         libstack/osrf_hash.o \
35                         utils/socket_bundle.o \
36                         utils/string_array.o \
37                         utils/utils.o \
38                         utils/log.o \
39                         utils/md5.o \
40                         utils/sha.o 
41
42 OPENSRF_HEADERS =       libtransport/transport_session.h \
43                         libtransport/transport_client.h \
44                         libtransport/transport_message.h \
45                         libstack/osrf_app_session.h \
46                         libstack/osrf_stack.h \
47                         libstack/osrfConfig.h \
48                         libstack/osrf_settings.h \
49                         libstack/osrf_message.h \
50                         libstack/osrf_prefork.h \
51                         libstack/osrf_system.h \
52                         libstack/osrf_application.h \
53                         libstack/osrf_cache.h \
54                         libstack/xml_utils.h \
55                         libstack/osrf_transgroup.h \
56                         libstack/osrf_list.h \
57                         libstack/osrf_hash.h \
58                         utils/socket_bundle.h \
59                         utils/string_array.h \
60                         utils/utils.h \
61                         utils/log.h \
62                         utils/md5.h \
63                         utils/sha.h 
64
65 all:    prep \
66         libopensrf.so \
67         libstack/opensrf \
68         router \
69         srfsh \
70         jserver \
71         gateway
72
73 install:        install-prep \
74                 opensrf-install \
75                 gateway-install \
76                 router-install \
77                 srfsh-install \
78                 jserver-install \
79                 perl-install \
80                 objson-install
81
82 prep:
83         mkdir -p $(TMPDIR)
84
85 libopensrf.so:  objson/libobjson.so
86         @echo utils
87         make -C utils
88         @echo transport
89         make -C libtransport
90         @echo stack
91         make -C libstack
92         @echo $@
93         $(CC) -shared -W1 $(LDFLAGS) -lxml2 -lmemcache -lobjson $(OPENSRF_TARGETS) -o $(TMPDIR)/$(LIBOPENSRF)
94         @echo apps
95         make -C  c-apps
96
97
98 opensrf-install:        objson-install
99         @echo $@
100         cp $(TMPDIR)/$(LIBOPENSRF) $(LIBDIR)/$(LIBOPENSRF)
101         cp $(OPENSRF_HEADERS) $(INCLUDEDIR)/opensrf/
102         cp libstack/opensrf $(BINDIR)/opensrf-c
103         make -C c-apps install
104
105
106 objson/libobjson.so:    prep
107         @echo $@
108         make -C objson
109
110 # --------------------------------------------------------------------------------
111 # BINARIES
112 # --------------------------------------------------------------------------------
113 libstack/opensrf.o:     libstack/opensrf.c libopensrf.so
114 libstack/opensrf:       libstack/opensrf.o
115         @echo $@
116         $(CC) $(CFLAGS) $(LDFLAGS) -lxml2 -lopensrf -lobjson libstack/opensrf.o -o $@
117         
118
119 router: libopensrf.so
120         @echo $@
121         make -C router 
122
123 srfsh: libopensrf.so
124         @echo $@
125         make -C srfsh
126
127 gateway:        libopensrf.so
128         @echo $@
129         make -C gateway
130
131 jserver:        libopensrf.so
132         @echo $@
133         make -C jserver
134
135
136 # --------------------------------------------------------------------------------
137 # INSTALL
138 # --------------------------------------------------------------------------------
139 install-prep:   
140         @echo $@
141         mkdir -p $(LIBDIR)
142         mkdir -p $(BINDIR)
143         mkdir -p $(PERLDIR)
144         mkdir -p $(INCLUDEDIR)
145         mkdir -p $(INCLUDEDIR)/$(OPENSRF)
146         mkdir -p $(ETCDIR)
147         mkdir -p $(TEMPLATEDIR)
148
149 objson-install: install-prep 
150         @echo $@
151         make -C objson install
152
153 libopensrf-install:     install-prep
154         @echo $@
155         cp $(TMPDIR)/$(LIBOPENSRF) $(LIBDIR)
156
157 gateway-install:        install-prep opensrf-install    
158         @echo $@
159         make -C gateway install
160
161 router-install: install-prep opensrf-install
162         @echo $@
163         make -C router install
164
165 srfsh-install:  install-prep opensrf-install 
166         @echo $@
167         make -C srfsh install
168
169 jserver-install:        install-prep 
170         @echo $@
171         make -C jserver install
172
173 perl-install:   install-prep
174         @echo $@
175         cp -r perlmods/* $(PERLDIR)/
176         cp ../examples/bootstrap.conf.example $(ETCDIR)
177         cp ../bin/osrf_ctl.sh $(BINDIR)
178         cp ../examples/opensrf.xml.example $(ETCDIR)
179         cp ../examples/opensrf_core.xml.example $(ETCDIR)
180         cp ../examples/srfsh.xml.example $(ETCDIR)
181
182
183 # --------------------------------------------------------------------------------
184 # CLEAN 
185 # --------------------------------------------------------------------------------
186 clean:
187         @echo $@
188         make -C libtransport clean
189         make -C libstack clean
190         make -C router clean
191         make -C gateway clean
192         make -C jserver clean
193         make -C utils clean
194         make -C objson clean
195         make -C srfsh clean
196         make -C c-apps clean
197         echo "Removing directory [$(TMPDIR)]"
198         /bin/rm -rf $(TMPDIR) *.o
199
200