fixed a problem in utils where I was using a va_list after calling va_end on the...
[OpenSRF.git] / src / Makefile
1 # TOP level 'src' makefile for OpenSRF
2 #
3 #
4
5 # Change to suit...
6 #export PREFIX                          = /usr
7 #export APXS2                                   = /pines/apps/apache2/bin/apxs
8 #export TMP                                     = /tmp/opensrf_build
9 #export APACHE2_HEADERS = /pines/apps/apache2/include 
10
11
12 export TMPDIR                   = $(TMP)/opensrf
13 export OPENSRF                  = opensrf
14 export BINDIR                   = $(PREFIX)/bin
15 export LIBDIR                   = $(PREFIX)/lib
16 export PERLDIR                  = $(LIBDIR)/perl5
17 export INCLUDEDIR               = $(PREFIX)/include
18 export CC                               = gcc
19 export LD_OPTS                  = -L $(TMPDIR) -L .
20 export CC_OPTS                  = -g -Wall -O2 -fPIC -I$(LIBXML2_HEADERS) -I$(APACHE2_HEADERS) \
21                                                                 -I$(LIBXML2_HEADERS)/libxml  -I$(TMP) -I$(TMPDIR)
22
23
24 all: prep router srfsh jserver gateway rest_gateway
25
26 install: install-prep transport-install stack-install gateway-install   \
27                 router-install srfsh-install jserver-install perl-install                       \
28                 objson-install utils-install info
29
30 prep:
31         mkdir -p $(TMPDIR)
32
33 # --------------------------------------------------------------------------------
34 # LIBS 
35 # --------------------------------------------------------------------------------
36 c_utils: prep
37         make -C utils
38
39 transport: c_utils
40         make -C libtransport
41
42 objson: c_utils
43         make -C objson
44
45 stack: objson transport 
46         make -C libstack
47
48
49 # --------------------------------------------------------------------------------
50 # BINARIES
51 # --------------------------------------------------------------------------------
52 router: stack 
53         make -C router 
54
55 srfsh: stack
56         make -C srfsh
57
58 gateway:        stack 
59         make -C gateway
60
61 rest_gateway:   stack 
62         make -e -C gateway rest_gateway
63
64 jserver: c_utils
65         make -C jserver
66
67
68 # --------------------------------------------------------------------------------
69 # INSTALL
70 # --------------------------------------------------------------------------------
71 install-prep:   
72         @echo "Creating install directories"
73         mkdir -p $(LIBDIR)
74         mkdir -p $(BINDIR)
75         mkdir -p $(PERLDIR)
76         mkdir -p $(INCLUDEDIR)
77         mkdir -p $(INCLUDEDIR)/$(OPENSRF)
78         mkdir -p $(ETCDIR)
79         mkdir -p $(TEMPLATEDIR)
80
81 transport-install:      install-prep utils-install
82         make -C libtransport install
83
84 utils-install:  install-prep
85         make -C utils install
86
87 objson-install: install-prep utils-install
88         make -C objson install
89
90 stack-install:  install-prep transport-install  objson-install
91         make -C libstack install
92
93 gateway-install:        install-prep stack-install      
94         make -C gateway install
95
96 router-install: install-prep stack-install
97         make -C router install
98
99 srfsh-install:  install-prep stack-install 
100         make -C srfsh install
101
102 jserver-install:        install-prep utils-install
103         make -C jserver install
104
105 perl-install:   install-prep
106         cp -r perlmods/* $(PERLDIR)/
107         cp ../examples/bootstrap.conf.example $(ETCDIR)
108         cp ../bin/opensrf_ctl $(BINDIR)
109         cp ../bin/opensrf_all $(BINDIR)
110         cp ../examples/opensrf.xml.example $(ETCDIR)
111
112
113 # --------------------------------------------------------------------------------
114 # INFO
115 # --------------------------------------------------------------------------------
116 info:
117         @echo
118         @echo "OpenSRF is installed in $(PREFIX)"
119         @echo ""
120         @echo "It may be helpful to set some environment variables if the install "
121         @echo "was set to a non-standard location.  These include:"
122         @echo ""
123         @echo "export LD_LIBRARY_PATH=$(LIBDIR):\$$LD_LIBRARY_PATH"
124         @echo "export PERL5LIB=$(PERLDIR):\$$PERL5LIB"
125         @echo "export PATH=$(BINDIR):\$$PATH"
126         @echo ""
127
128
129 # --------------------------------------------------------------------------------
130 # CLEAN 
131 # --------------------------------------------------------------------------------
132 clean:
133         make -C libtransport clean
134         make -C libstack clean
135         make -C router clean
136         make -C gateway clean
137         make -C jserver clean
138         make -C utils clean
139         make -C objson clean
140         make -C srfsh clean
141         /bin/rm -rf $(TMPDIR)
142
143