Build system: Move install definitions to include
[openafs.git] / src / afsweb / Makefile.in
1 # Copyright 2000, International Business Machines Corporation and others.
2 # All Rights Reserved.
3
4 # This software has been released under the terms of the IBM Public
5 # License.  For details, see the LICENSE file in the top-level source
6 # directory or online at http://www.openafs.org/dl/license10.html
7
8 srcdir=@srcdir@
9 include @TOP_OBJDIR@/src/config/Makefile.config
10 include @TOP_OBJDIR@/src/config/Makefile.lwp
11
12
13
14
15 UKSRCS=nsafs.h nsafs.c securehash.c
16
17 #
18 # Targets for Apache AFS Web Secure
19 #
20 APACHE_AFS_LIB=libapacheafs.a
21 APACHE_AFS_COMMON_LIB=libcommon.a
22
23 BINARIES=weblog weblog_starter
24 SRC_MODULE=afs_module.c
25 ## This module is made compatible with Apache 1.3.1 by including a file called
26 ## ap_compat.h provided by Apache (basically all they do is #define all the old API calls
27 ## as the new ones with ap_ prepended to the old API calls. The makefile takes care of this
28 ## while building afs_module.c and adding the AFS_component_version_number.c file's contents 
29 ## in comments. 
30
31 APACHEAFS_DOC=README
32 APACHE_INSTALL_SCRIPT=afswsApache_config.sh 
33 NETSCAPE_INSTALL_SCRIPT=afswsNetscape_config.sh
34
35 system apache_afs_web_secure:
36         case "${SYS_NAME}" in \
37                 rs_aix* ) \
38                         echo Clean, make, and install the lib for 1.2 ; \
39                         $(MAKE) libclean ; \
40                         $(MAKE) AUX_CFLAGS=-DAIX $(APACHE_AFS_LIB) ; \
41                         ${INSTALL} -d ${DEST}/root.afsweb/lib/apache_1.2 ; \
42                         ${INSTALL_DATA} ${APACHE_AFS_LIB} ${DEST}/root.afsweb/lib/apache_1.2/${APACHE_AFS_LIB} ; \
43                         echo Make and install source for 1.2 ; \
44                         /bin/rm -f $(SRC_MODULE) ; \
45                         $(MAKE) $(SRC_MODULE) VERSION_CFLAG=-DAPACHE_1_2 ; \
46                         ${INSTALL} -d ${DEST}/root.afsweb/src/apache_1.2 ; \
47                         ${INSTALL_DATA} $(SRC_MODULE) ${DEST}/root.afsweb/src/apache_1.2/$(SRC_MODULE) ; \
48                         echo Make and install the lib for 1.3.1 ; \
49                         $(MAKE) libclean ; \
50                         $(MAKE) AUX_CFLAGS=-DAIX $(APACHE_AFS_LIB) VERSION_CFLAG="-DAPACHE_1_3 -DAPACHE_1_3_1" ; \
51                         ${INSTALL} -d ${DEST}/root.afsweb/lib/apache_1.3.1 ; \
52                         ${INSTALL_DATA} $(APACHE_AFS_LIB) ${DEST}/root.afsweb/lib/apache_1.3.1/$(APACHE_AFS_LIB) ; \
53                         echo Make and install source for 1.3.1 ; \
54                         /bin/rm -f $(SRC_MODULE) ; \
55                         $(MAKE) $(SRC_MODULE) VERSION_CFLAG="-DAPACHE_1_3 -DAPACHE_1_3_1" ; \
56                         ${INSTALL} -d ${DEST}/root.afsweb/src/apache_1.3.1 ; \
57                         ${INSTALL_DATA} $(SRC_MODULE) ${DEST}/root.afsweb/src/apache_1.3.1/$(SRC_MODULE) ; \
58                         echo Clean, make, and install the lib for 1.3.6 ; \
59                         $(MAKE) libclean ; \
60                         $(MAKE) AUX_CFLAGS=-DAIX $(APACHE_AFS_LIB) VERSION_CFLAG="-DAPACHE_1_3 -DAPACHE_1_3_6"; \
61                         ${INSTALL} -d ${DEST}/root.afsweb/lib/apache_1.3.6 ; \
62                         ${INSTALL_DATA} $(APACHE_AFS_LIB) ${DEST}/root.afsweb/lib/apache_1.3.6/$(APACHE_AFS_LIB) ; \
63                         /bin/rm -f $(SRC_MODULE) ; \
64                         echo Make and install source for 1.3.1 ; \
65                         $(MAKE) $(SRC_MODULE) VERSION_CFLAG="-DAPACHE_1_3 -DAPACHE_1_3_6" ; \
66                         ${INSTALL} -d ${DEST}/root.afsweb/src/apache_1.3.6 ; \
67                         ${INSTALL_DATA} $(SRC_MODULE) ${DEST}/root.afsweb/src/apache_1.3.6 ; \
68                         echo Do the binaries ; \
69                         $(MAKE) AUX_CFLAGS=-DAIX $(BINARIES) ;; \
70                 sun*) \
71                         $(MAKE) libclean ; \
72                         $(MAKE) AUX_FLAGS=-DSOLARIS $(APACHE_AFS_LIB) ; \
73                         ${INSTALL} -d ${DEST}/root.afsweb/lib/apache_1.2 ; \
74                         ${INSTALL_DATA} $(APACHE_AFS_LIB) ${DEST}/root.afsweb/lib/apache_1.2/$(APACHE_AFS_LIB) ; \
75                         $(MAKE) libclean ; \
76                         $(MAKE) AUX_FLAGS=-DSOLARIS $(APACHE_AFS_LIB) VERSION_CFLAG="-DAPACHE_1_3 -DAPACHE_1_3_1" ; \
77                         ${INSTALL} -d ${DEST}/root.afsweb/lib/apache_1.3.1 ; \
78                         ${INSTALL_DATA} $(APACHE_AFS_LIB) ${DEST}/root.afsweb/lib/apache_1.3.1/$(APACHE_AFS_LIB) ; \
79                         $(MAKE) libclean ; \
80                         $(MAKE) AUX_FLAGS=-DSOLARIS $(APACHE_AFS_LIB) VERSION_CFLAG="-DAPACHE_1_3 -DAPACHE_1_3_6" ; \
81                         ${INSTALL} -d ${DEST}/root.afsweb/lib/apache_1.3.6 ; \
82                         ${INSTALL_DATA} $(APACHE_AFS_LIB) ${DEST}/root.afsweb/lib/apache_1.3.6/$(APACHE_AFS_LIB) ; \
83                         /bin/rm -f $(SRC_MODULE) ; \
84                         $(MAKE) $(SRC_MODULE) VERSION_CFLAG=-DAPACHE_1_2 ; \
85                         ${INSTALL} -d ${DEST}/root.afsweb/src/apache_1.2 ; \
86                         ${INSTALL_DATA} $(SRC_MODULE) ${DEST}/root.afsweb/src/apache_1.2/$(SRC_MODULE) ; \
87                         /bin/rm -f $(SRC_MODULE) ; \
88                         $(MAKE) $(SRC_MODULE) VERSION_CFLAG="-DAPACHE_1_3 -DAPACHE_1_3_1" ; \
89                         ${INSTALL} -d ${DEST}/root.afsweb/src/apache_1.3.1 ; \
90                         ${INSTALL_DATA} $(SRC_MODULE) ${DEST}/root.afsweb/src/apache_1.3.1/$(SRC_MODULE) ; \
91                         /bin/rm -f $(SRC_MODULE) ; \
92                         $(MAKE) $(SRC_MODULE) VERSION_CFLAG="-DAPACHE_1_3 -DAPACHE_1_3_6" ; \
93                         ${INSTALL} -d ${DEST}/root.afsweb/src/apache_1.3.6 ; \
94                         ${INSTALL_DATA} $(SRC_MODULE) ${DEST}/root.afsweb/src/apache_1.3.6/$(SRC_MODULE) ; \
95                         $(MAKE) AUX_CFLAGS=-DSOLARIS "XLIBS=-lsocket -lnsl" $(BINARIES) ;; \
96                 *linux*) \
97                         $(MAKE) libclean ; \
98                         $(MAKE) AUX_FLAGS=-DLINUX $(APACHE_AFS_LIB) ; \
99                         ${INSTALL} -d ${DEST}/root.afsweb/lib/apache_1.2 ; \
100                         ${INSTALL_DATA} $(APACHE_AFS_LIB) ${DEST}/root.afsweb/lib/apache_1.2/$(APACHE_AFS_LIB) ; \
101                         $(MAKE) libclean ; \
102                         $(MAKE) AUX_FLAGS=-DLINUX $(APACHE_AFS_LIB) VERSION_CFLAG="-DAPACHE_1_3 -DAPACHE_1_3_1" ; \
103                         ${INSTALL} -d ${DEST}/root.afsweb/lib/apache_1.3.1 ; \
104                         ${INSTALL_DATA} $(APACHE_AFS_LIB) ${DEST}/root.afsweb/lib/apache_1.3.1/$(APACHE_AFS_LIB) ; \
105                         $(MAKE) libclean ; \
106                         $(MAKE) AUX_FLAGS=-DLINUX $(APACHE_AFS_LIB) VERSION_CFLAG="-DAPACHE_1_3 -DAPACHE_1_3_6" ; \
107                         ${INSTALL} -d ${DEST}/root.afsweb/lib/apache_1.3.6 ; \
108                         ${INSTALL_DATA} $(APACHE_AFS_LIB) ${DEST}/root.afsweb/lib/apache_1.3.6/$(APACHE_AFS_LIB) ; \
109                         /bin/rm -f $(SRC_MODULE) ; \
110                         $(MAKE) $(SRC_MODULE) VERSION_CFLAG=-DAPACHE_1_2 ; \
111                         ${INSTALL} -d ${DEST}/root.afsweb/src/apache_1.2 ; \
112                         ${INSTALL_DATA} $(SRC_MODULE) ${DEST}/root.afsweb/src/apache_1.2/$(SRC_MODULE) ; \
113                         /bin/rm -f $(SRC_MODULE) ; \
114                         $(MAKE) $(SRC_MODULE) VERSION_CFLAG="-DAPACHE_1_3 -DAPACHE_1_3_1" ; \
115                         ${INSTALL} -d ${DEST}/root.afsweb/src/apache_1.3.1 ; \
116                         ${INSTALL_DATA} $(SRC_MODULE) ${DEST}/root.afsweb/src/apache_1.3.1/$(SRC_MODULE) ; \
117                         /bin/rm -f $(SRC_MODULE) ; \
118                         $(MAKE) $(SRC_MODULE) VERSION_CFLAG="-DAPACHE_1_3 -DAPACHE_1_3_6" ; \
119                         ${INSTALL} -d ${DEST}/root.afsweb/src/apache_1.3.6 ; \
120                         ${INSTALL_DATA} $(SRC_MODULE) ${DEST}/root.afsweb/src/apache_1.3.6/$(SRC_MODULE) ; \
121                         $(MAKE) AUX_CFLAGS=-DLINUX "XLIBS=-lnsl" $(BINARIES) ;; \
122                 * ) \
123                          echo "NOT BUILT FOR ${SYS_NAME}"; ;; \
124         esac
125         ${INSTALL} -d ${DEST}/root.afsweb/doc
126         ${INSTALL_DATA} ${APACHEAFS_DOC} ${DEST}/root.afsweb/doc/${APACHEAFS_DOC}
127         ${INSTALL} -d ${DEST}/root.afsweb/install
128         ${INSTALL_SCRIPT} ${APACHE_INSTALL_SCRIPT} ${DEST}/root.afsweb/install/${APACHE_INSTALL_SCRIPT}
129         ${INSTALL} -d ${DEST}/root.afsweb/bin
130         ${INSTALL_PROGRAM} $(BINARIES) ${DEST}/root.afsweb/bin
131
132 netscape_afs_web_secure:
133         ${INSTALL} -d ${DEST}/root.afsweb/install
134         ${INSTALL} -m 755 ${NETSCAPE_INSTALL_SCRIPT} ${DEST}/root.afsweb/install
135
136 all: 
137
138 install:  
139
140 ##
141 ## For Apache Afs Web Secure libraries and binaries
142 ## NOTE: APACHE_INCLUDES should point to the Apache src directory where 
143 ## httpd.h and all it's included files reside which right now is src/afsweb/include
144 ## and we have Apache versions as subdirectories but these are taken care of by the
145 ## code. Be sure to compile with the VERSION_CFLAG=-DAPACHE_1_3 option for Apache 1.3
146 ##
147 APACHE_INCLUDES=-Iapache_includes
148
149 XLIBS=
150 DEFINES=-DSTATUS
151 OPTF=
152 DEBUG_FLAG=
153 AUX_CFLAGS=
154 VERSION_CFLAG=
155 AFS_INCL=-I${TOP_INCDIR} -I.. -I../config
156 XCFLAGS= $(CFLAGS) $(OPTF) $(DEFINES) -I. -I.. $(VERSION_CFLAG) $(DEBUG_FLAG)
157 INCLS=${TOP_INCDIR}/ubik.h \
158              ${TOP_INCDIR}/lwp.h \
159              ${TOP_INCDIR}/lock.h  \
160              ${TOP_INCDIR}/rx/rx.h \
161              ${TOP_INCDIR}/rx/xdr.h \
162              ${TOP_INCDIR}/rx/rxkad.h \
163              ${TOP_INCDIR}/afs/com_err.h \
164              weblog_errors.h $(DCE_DLOG_INCLUDES)
165 deslib=${TOP_LIBDIR}/libdes.a
166 rxkadlib=${TOP_LIBDIR}/librxkad.a
167 authlib=${TOP_LIBDIR}/libauth.a
168 cmdlib=${TOP_LIBDIR}/libcmd.a
169 utilib=${TOP_LIBDIR}/util.a
170 auditlib=${TOP_LIBDIR}/libaudit.a
171 kauthlib=${TOP_LIBDIR}/libkauth.a
172
173 LIBS=${kauthlib} ${TOP_LIBDIR}/libubik.a ${TOP_LIBDIR}/libprot.a \
174        ${authlib} ${rxkadlib} ${TOP_LIBDIR}/libsys.a ${TOP_LIBDIR}/librx.a \
175        ${TOP_LIBDIR}/libsys.a  \
176        ${TOP_LIBDIR}/liblwp.a ${deslib} ${cmdlib} \
177        ${TOP_LIBDIR}/libafscom_err.a ${utilib} \
178        $(DBM) $(XLIBS)
179
180 AR=ar
181 ARFLAGS=rv
182 LIBCOMMON_OBJS=apache_afs_utils.o apache_afs_cache.o
183 LIBAPACHE_OBJS=apache_afs_client.o apache_afs_plugin.o
184 LIBOBJS=$(LIBCOMMON_OBJS) $(LIBAPACHE_OBJS)
185 OBJS=$(LIBOBJS) apache_afs_weblog.o weblog.o
186
187 .c.o:
188         $(CCOBJ) -c $(XCFLAGS) $(AFS_INCL) $(AUX_CFLAGS) $<
189
190
191 weblog: weblog.o $(APACHE_AFS_COMMON_LIB)
192         $(CC) -o $@ weblog.o $(APACHE_AFS_COMMON_LIB) $(LIBS) $(XLIBS)
193
194 weblog_starter: apache_afs_weblog.o weblog_errors.h 
195         $(CC) -o $@ apache_afs_weblog.o 
196
197 $(APACHE_AFS_COMMON_LIB):$(LIBCOMMON_OBJS)
198         - /bin/rm -f $@
199         $(AR) $(ARFLAGS) $@ $(LIBCOMMON_OBJS)
200
201 $(APACHE_AFS_LIB): $(LIBOBJS) AFS_component_version_number.o
202         - /bin/rm -f $@
203         $(AR) $(ARFLAGS) $@ $(LIBOBJS) 
204
205 afs_module.c: apache_afs_module.c 
206         -/bin/rm -f afs_module.c \
207         ; echo "/*" > afs_module.c \
208         ; cat AFS_component_version_number.c >> afs_module.c \
209         ; echo "*/" >> afs_module.c \
210         ; case "${VERSION_CFLAG}" in \
211                 -DAPACHE_1_3*)  echo '#include "ap_compat.h"' >> afs_module.c ;; \
212           esac \
213         ; cat apache_afs_module.c >> afs_module.c
214
215 ##
216 ##Dependencies
217 ##
218
219 $(OBJS): Makefile
220
221 apache_afs_weblog.o: apache_afs_weblog.c weblog_errors.h AFS_component_version_number.o
222 apache_afs_utils.o: apache_afs_utils.c apache_afs_utils.h
223 apache_afs_cache.o: apache_afs_cache.c apache_afs_cache.h
224 weblog.o: weblog.c weblog_errors.h $(APACHE_AFS_COMMON_LIB)
225 apache_afs_client.o: apache_api.h apache_afs_client.c apache_afs_utils.o apache_afs_cache.o AFS_component_version_number.o
226         $(CC) -c $(XCFLAGS) $(AFS_INCL) $(APACHE_INCLUDES) $(AUX_CFLAGS) apache_afs_client.c
227 apache_afs_plugin.o: apache_api.h apache_afs_plugin.c apache_afs_client.o apache_afs_utils.o apache_afs_cache.o
228         $(CC) -c $(XCFLAGS) $(APACHE_INCLUDES) $(AUX_CFLAGS) apache_afs_plugin.c
229
230
231 clean:
232         -/bin/rm -f *.o $(BINARIES) $(APACHE_AFS_LIB) $(APACHE_AFS_COMMON_LIB)
233
234 libclean:
235         -/bin/rm -f $(APACHE_AFS_LIB) $(LIBOBJS)
236
237 include ../config/Makefile.version
238
239 dest:  
240