c0a6986aad87071a106f30af1deaa2df66af64f7
[Evergreen.git] / OpenSRF / 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: test prep router srfsh jserver gateway
25
26 test: test
27         echo "TEST TEST TEST"
28
29 install: install-prep transport-install stack-install gateway-install   \
30                 router-install srfsh-install jserver-install perl-install                       \
31                 libjson-install objson-install utils-install info
32
33 prep:
34         mkdir -p $(TMPDIR)
35
36 # --------------------------------------------------------------------------------
37 # LIBS 
38 # --------------------------------------------------------------------------------
39 c_utils: prep
40         echo APXS2=$(APXS2) PREFIX=$(PREFIX) TMP=$(TMP) APCHE2_HEADERS=$(APACHE2_HEADERS) LIBXML2_HEADERS=$(LIBXML2_HEADERS)
41         @echo -e "\n + c_utils"
42         make -C utils
43
44 transport: c_utils
45         @echo -e "\n + transport"
46         make -C libtransport
47
48 objson: c_utils
49         @echo -e "\n + objson"
50         make -C objson
51
52 json: prep
53         @echo -e "\n + libjson"
54         make -C libjson
55
56 stack: json objson transport 
57         @echo -e "\n + stack"
58         make -C libstack
59
60
61 # --------------------------------------------------------------------------------
62 # BINARIES
63 # --------------------------------------------------------------------------------
64 router: stack 
65         @echo -e "\n + router"
66         make -C router 
67
68 srfsh: stack
69         @echo -e "\n + srfsh"
70         make -C srfsh
71
72 gateway:        stack 
73         @echo -e "\n + gateway"
74         make -C gateway
75
76 jserver: c_utils
77         @echo -e "\n + jserver"
78         make -C jserver
79
80
81 # --------------------------------------------------------------------------------
82 # INSTALL
83 # --------------------------------------------------------------------------------
84 install-prep:   install-prep
85         @echo "Creating install directories"
86         mkdir -p $(LIBDIR)
87         mkdir -p $(BINDIR)
88         mkdir -p $(PERLDIR)
89         mkdir -p $(INCLUDEDIR)
90         mkdir -p $(INCLUDEDIR)/$(OPENSRF)
91
92 transport-install:      install-prep utils-install
93         make -C libtransport install
94
95 libjson-install:        install-prep
96         make -C libjson install
97
98 utils-install:  install-prep
99         make -C utils install
100
101 objson-install: install-prep utils-install
102         make -C objson install
103
104 stack-install:  install-prep transport-install libjson-install objson-install
105         make -C libstack install
106
107 gateway-install:        install-prep stack-install      
108         make -C gateway install
109
110 router-install: install-prep stack-install
111         make -C router install
112
113 srfsh-install:  install-prep stack-install 
114         make -C srfsh install
115
116 jserver-install:        install-prep utils-install
117         make -C jserver install
118
119 perl-install:   install-prep
120         cp -r perlmods/* $(PERLDIR)/
121
122
123 # --------------------------------------------------------------------------------
124 # INFO
125 # --------------------------------------------------------------------------------
126 info:
127         @echo
128         @echo "OpenSRF is installed in $(PREFIX)"
129         @echo ""
130         @echo "It may be helpful to set some environment variables if the install "
131         @echo "was set to a non-standard location.  These include:"
132         @echo ""
133         @echo "export LD_LIBRARY_PATH=\$$LD_LIBRARY_PATH:$(LIBDIR)"
134         @echo "export PERL5LIB=\$$PERL5LIB:$(PERLDIR)"
135         @echo "export PATH=\$$PATH:$(BINDIR)"
136         @echo ""
137
138
139 # --------------------------------------------------------------------------------
140 # CLEAN 
141 # --------------------------------------------------------------------------------
142 clean:
143         @echo "Cleaning..."
144         make -C libtransport clean
145         make -C libjson clean
146         make -C libstack clean
147         make -C router clean
148         make -C gateway clean
149         make -C jserver clean
150         make -C utils clean
151         make -C objson clean
152         make -C libjson clean
153         make -C srfsh clean
154         /bin/rm -rf $(TMPDIR)
155
156