clark knows how to use custom widget filter code now
[Evergreen.git] / OpenSRF / 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
66 all:    prep \
67         libopensrf.so \
68         libstack/opensrf \
69         router \
70         srfsh \
71         jserver \
72         gateway
73
74 install:        install-prep \
75                 opensrf-install \
76                 gateway-install \
77                 router-install \
78                 srfsh-install \
79                 jserver-install \
80                 perl-install \
81                 objson-install
82
83 prep:
84         mkdir -p $(TMPDIR)
85
86 libopensrf.so:  objson/libobjson.so
87         @echo utils
88         make -C utils
89         @echo transport
90         make -C libtransport
91         @echo stack
92         make -C libstack
93         @echo $@
94         $(CC) -shared -W1 $(LDFLAGS) -lJudy -lxml2 -lmemcache -lobjson $(OPENSRF_TARGETS) -o $(TMPDIR)/$(LIBOPENSRF)
95         @echo apps
96         make -C  c-apps
97
98
99 opensrf-install:        objson-install
100         @echo $@
101         cp $(TMPDIR)/$(LIBOPENSRF) $(LIBDIR)/$(LIBOPENSRF)
102         cp $(OPENSRF_HEADERS) $(INCLUDEDIR)/opensrf/
103         cp libstack/opensrf $(BINDIR)/opensrf-c
104         make -C c-apps install
105
106
107 objson/libobjson.so:    prep
108         @echo $@
109         make -C objson
110
111 # --------------------------------------------------------------------------------
112 # BINARIES
113 # --------------------------------------------------------------------------------
114 libstack/opensrf.o:     libstack/opensrf.c libopensrf.so
115 libstack/opensrf:       libstack/opensrf.o
116         @echo $@
117         $(CC) $(CFLAGS) $(LDFLAGS) -lJudy -lxml2 -lopensrf -lobjson libstack/opensrf.o -o $@
118         
119
120 router: libopensrf.so
121         @echo $@
122         make -C router 
123
124 srfsh: libopensrf.so
125         @echo $@
126         make -C srfsh
127
128 gateway:        libopensrf.so
129         @echo $@
130         make -C gateway
131
132 jserver:        libopensrf.so
133         @echo $@
134         make -C jserver
135
136
137 # --------------------------------------------------------------------------------
138 # INSTALL
139 # --------------------------------------------------------------------------------
140 install-prep:   
141         @echo $@
142         mkdir -p $(LIBDIR)
143         mkdir -p $(BINDIR)
144         mkdir -p $(PERLDIR)
145         mkdir -p $(INCLUDEDIR)
146         mkdir -p $(INCLUDEDIR)/$(OPENSRF)
147         mkdir -p $(ETCDIR)
148         mkdir -p $(TEMPLATEDIR)
149
150 objson-install: install-prep 
151         @echo $@
152         make -C objson install
153
154 libopensrf-install:     install-prep
155         @echo $@
156         cp $(TMPDIR)/$(LIBOPENSRF) $(LIBDIR)
157
158 gateway-install:        install-prep opensrf-install    
159         @echo $@
160         make -C gateway install
161
162 router-install: install-prep opensrf-install
163         @echo $@
164         make -C router install
165
166 srfsh-install:  install-prep opensrf-install 
167         @echo $@
168         make -C srfsh install
169
170 jserver-install:        install-prep 
171         @echo $@
172         make -C jserver install
173
174 perl-install:   install-prep
175         @echo $@
176         cp -r perlmods/* $(PERLDIR)/
177         cp ../examples/bootstrap.conf.example $(ETCDIR)
178         cp ../bin/opensrf_ctl $(BINDIR)
179         cp ../bin/opensrf_all $(BINDIR)
180         cp ../examples/opensrf.xml.example $(ETCDIR)
181         cp ../examples/opensrf_core.xml.example $(ETCDIR)
182         cp ../examples/srfsh.xml.example $(ETCDIR)
183
184
185 # --------------------------------------------------------------------------------
186 # CLEAN 
187 # --------------------------------------------------------------------------------
188 clean:
189         @echo $@
190         make -C libtransport clean
191         make -C libstack clean
192         make -C router clean
193         make -C gateway clean
194         make -C jserver clean
195         make -C utils clean
196         make -C objson clean
197         make -C srfsh clean
198         make -C c-apps clean
199         echo "Removing directory [$(TMPDIR)]"
200         /bin/rm -rf $(TMPDIR) *.o
201
202