02a962ad665d9bb9b3a5b051f84dd535db815945
[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                 objson-install utils-install bin-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 stack: objson transport 
53         @echo -e "\n + stack"
54         make -C libstack
55
56
57 # --------------------------------------------------------------------------------
58 # BINARIES
59 # --------------------------------------------------------------------------------
60 router: stack 
61         @echo -e "\n + router"
62         make -C router 
63
64 srfsh: stack
65         @echo -e "\n + srfsh"
66         make -C srfsh
67
68 gateway:        stack 
69         @echo -e "\n + gateway"
70         make -C gateway
71
72 jserver: c_utils
73         @echo -e "\n + jserver"
74         make -C jserver
75
76
77 # --------------------------------------------------------------------------------
78 # INSTALL
79 # --------------------------------------------------------------------------------
80 install-prep:   install-prep
81         @echo "Creating install directories"
82         mkdir -p $(LIBDIR)
83         mkdir -p $(BINDIR)
84         mkdir -p $(PERLDIR)
85         mkdir -p $(INCLUDEDIR)
86         mkdir -p $(INCLUDEDIR)/$(OPENSRF)
87
88 transport-install:      install-prep utils-install
89         make -C libtransport install
90
91 utils-install:  install-prep
92         make -C utils install
93
94 objson-install: install-prep utils-install
95         make -C objson install
96
97 stack-install:  install-prep transport-install  objson-install
98         make -C libstack install
99
100 gateway-install:        install-prep stack-install      
101         make -C gateway install
102
103 router-install: install-prep stack-install
104         make -C router install
105
106 srfsh-install:  install-prep stack-install 
107         make -C srfsh install
108
109 jserver-install:        install-prep utils-install
110         make -C jserver install
111
112 perl-install:   install-prep
113         cp -r perlmods/* $(PERLDIR)/
114
115 bin-install: install-prep
116         cp ../bin/opensrf_ctl $(BINDIR)
117
118
119 # --------------------------------------------------------------------------------
120 # INFO
121 # --------------------------------------------------------------------------------
122 info:
123         @echo
124         @echo "OpenSRF is installed in $(PREFIX)"
125         @echo ""
126         @echo "It may be helpful to set some environment variables if the install "
127         @echo "was set to a non-standard location.  These include:"
128         @echo ""
129         @echo "export LD_LIBRARY_PATH=$(LIBDIR):\$$LD_LIBRARY_PATH"
130         @echo "export PERL5LIB=$(PERLDIR):\$$PERL5LIB"
131         @echo "export PATH=$(BINDIR):\$$PATH"
132         @echo ""
133
134
135 # --------------------------------------------------------------------------------
136 # CLEAN 
137 # --------------------------------------------------------------------------------
138 clean:
139         @echo "Cleaning..."
140         make -C libtransport clean
141         make -C libstack clean
142         make -C router clean
143         make -C gateway clean
144         make -C jserver clean
145         make -C utils clean
146         make -C objson clean
147         make -C srfsh clean
148         /bin/rm -rf $(TMPDIR)
149
150