ae10dd711a7b6cffd7e984eb81aabb03dcc09377
[openafs.git] / src / export / 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   EXPORTS = -bexport:export.exp
14   IMPORTS = /lib/kernex.exp /lib/syscalls.exp ${srcdir}/extras.exp
15      KOBJ = export.o symtab.o
16
17 EXPORTS32 = export.exp export.ext.nonfs export.ext cfgexport cfgafs
18 TOPEXP32  = ${TOP_LIBDIR}/export.exp
19 EXPORTS64 = export64.exp export64.ext.nonfs export64.ext cfgexport64 cfgafs64
20 TOPEXP64  = ${TOP_LIBDIR}/export64.exp
21
22 all: $(TOPEXP32) $(TOPEXP64) ${TOP_LIBDIR}/extras.exp
23         ${INSTALL} -d ${KERNELDIR}
24         ${INSTALL} -d ${UKERNELDIR}
25         ${INSTALL_DATA} ${srcdir}/export.h ${KERNELDIR}/export.h
26         ${INSTALL_DATA} ${srcdir}/export.h ${UKERNELDIR}/export.h
27         if [ "x$(AIX32)" = "xyes" ]; then  \
28           ${INSTALL_DATA} export.exp ${UKERNELDIR}/export.exp; \
29           ${INSTALL_DATA} export.exp ${KERNELDIR}/export.exp; \
30         fi
31         if [ "x$(AIX64)" = "xyes" ]; then  \
32           ${INSTALL_DATA} export64.exp ${KERNELDIR}/export64.exp; \
33           ${INSTALL_DATA} export64.exp ${UKERNELDIR}/export64.exp; \
34         fi
35
36 ${TOP_LIBDIR}/export.exp: export.exp
37         if [ "x$(AIX32)" = "xyes" ]; then  \
38           ${INSTALL_DATA} $? $@ ; \
39         fi
40
41 ${TOP_LIBDIR}/export64.exp: export64.exp
42         if [ "x$(AIX64)" = "xyes" ]; then  \
43           ${INSTALL_DATA} $? $@ ; \
44         fi
45
46 ${TOP_LIBDIR}/extras.exp: ${srcdir}/extras.exp
47         ${INSTALL_DATA} $? $@
48
49 noversion system: install
50
51 export.exp: ${srcdir}/export4.exp ${srcdir}/export5.exp
52         case ${SYS_NAME} in \
53         rs_aix4* ) \
54                 cp -p ${srcdir}/export4.exp export.exp ;; \
55         rs_aix5* ) \
56                 cp -p ${srcdir}/export5.exp export.exp ;; \
57         esac
58
59 export64.exp: ${srcdir}/export4-64.exp ${srcdir}/export5-64.exp
60         case ${SYS_NAME} in \
61         rs_aix4* ) \
62                 cp -p ${srcdir}/export4-64.exp export64.exp ;; \
63         rs_aix5* ) \
64                 cp -p ${srcdir}/export5-64.exp export64.exp ;; \
65         rs_aix6* ) \
66                 cp -p ${srcdir}/export5-64.exp export64.exp ;; \
67         esac
68
69 export.ext: ${KOBJ}
70         if [ "x$(AIX32)" = "xyes" ]; then  \
71           ${LD} -o export.ext -eexport ${IMPORTS} ${KOBJ} ${EXPORTS} -lcsys ; \
72         fi
73
74 export64.ext: export64.o symtab64.o
75         if [ "x$(AIX64)" = "xyes" ]; then  \
76           ${LD} -b64 -o export64.ext -eexport ${IMPORTS} export64.o symtab64.o \
77                 -bexport:export64.exp -lcsys ; \
78         fi
79
80 export.ext.nonfs: export.nonfs.o symtab.o
81         if [ "x$(AIX32)" = "xyes" ]; then  \
82           ${LD} -o export.ext.nonfs -eexport ${IMPORTS} export.nonfs.o \
83                 symtab.o ${EXPORTS} -lcsys ; \
84         fi
85
86 export64.ext.nonfs: export64.nonfs.o symtab64.o
87         if [ "x$(AIX64)" = "xyes" ]; then  \
88           ${LD} -b64 -o export64.ext.nonfs -eexport ${IMPORTS} export64.nonfs.o \
89                 symtab64.o -bexport:export64.exp -lcsys ; \
90         fi
91
92 symtab.o symtab64.o: ${srcdir}/symtab.c
93         case ${SYS_NAME} in \
94         rs_aix4* ) \
95                 $(CC) $(AFS_CPPFLAGS) $(AFS_CFLAGS) -c ${srcdir}/symtab.c ;; \
96         rs_aix5* ) \
97                 $(CC) $(AFS_CPPFLAGS) ${AFS_CFLAGS} -q64 -D__XCOFF64__ \
98                         -DAFS_64BIT_KERNEL -DAFS_AIX51_ENV \
99                         -c ${srcdir}/symtab.c ; \
100                 mv symtab.o symtab64.o ; \
101                 $(CC) $(AFS_CPPFLAGS) $(AFS_CFLAGS) -DAFS_AIX51_ENV \
102                         -c ${srcdir}/symtab.c ;; \
103         rs_aix6* ) \
104                 $(CC) $(AFS_CPPFLAGS) $(AFS_CFLAGS) -q64 -D__XCOFF64__ \
105                         -DAFS_64BIT_KERNEL -DAFS_AIX51_ENV \
106                         -c ${srcdir}/symtab.c ; \
107                 mv symtab.o symtab64.o ;; \
108         esac
109
110 export.o export64.o: ${srcdir}/export.c
111         case ${SYS_NAME} in \
112         rs_aix4* ) \
113                 $(CC) $(AFS_CPPFLAGS) $(AFS_CFLAGS) -c ${srcdir}/export.c ;; \
114         rs_aix5* ) \
115                 $(CC) $(AFS_CPPFLAGS) $(AFS_CFLAGS) -q64 -D__XCOFF64__ \
116                         -DAFS_64BIT_KERNEL -DAFS_AIX51_ENV \
117                         -c ${srcdir}/export.c ; \
118                 mv export.o export64.o ; \
119                 $(CC) $(AFS_CPPFLAGS) $(AFS_CFLAGS) -DAFS_AIX51_ENV \
120                         -c ${srcdir}/export.c ;; \
121         rs_aix6* ) \
122                 $(CC) $(AFS_CPPFLAGS) $(AFS_CFLAGS) -q64 \
123                         -D__XCOFF64__ -DAFS_64BIT_KERNEL -DAFS_AIX51_ENV \
124                         -c ${srcdir}/export.c ; \
125                 mv export.o export64.o ;; \
126         esac
127
128 export.nonfs.o export64.nonfs.o: ${srcdir}/export.c
129         case ${SYS_NAME} in \
130         rs_aix4* ) \
131                 $(CC) $(CPPFLAGS) $(CFLAGS) ${INCS} -DAFS_NONFSTRANS \
132                         -c ${srcdir}/export.c ; \
133                 mv export.o export.nonfs.o ;; \
134         rs_aix5* ) \
135                 $(CC) $(CPPFLAGS) $(CFLAGS) -q64 ${INCS} -D__XCOFF64__ \
136                         -DAFS_64BIT_KERNEL -DAFS_NONFSTRANS -DAFS_AIX51_ENV \
137                         -c ${srcdir}/export.c ; \
138                 mv export.o export64.nonfs.o ; \
139                 $(CC) $(CPPFLAGS) $(CFLAGS) ${INCS} -DAFS_NONFSTRANS \
140                         -DAFS_AIX51_ENV -c ${srcdir}/export.c ; \
141                 mv export.o export.nonfs.o ;; \
142         rs_aix6* ) \
143                 $(CC) $(CPPFLAGS) $(CFLAGS) -q64 ${INCS} -D__XCOFF64__ \
144                         -DAFS_64BIT_KERNEL -DAFS_NONFSTRANS -DAFS_AIX51_ENV \
145                         -c ${srcdir}/export.c ; \
146                 mv export.o export64.nonfs.o ;; \
147         esac
148
149 cfgexport: cfgexport.o
150         $(CC) $(LDFLAGS) -g ${INCS} -o cfgexport cfgexport.o
151
152 cfgexport64: cfgexport64.o
153         if [ "x$(AIX64)" = "xyes" ]; then  \
154           $(CC) $(LDFLAGS) -g ${INCS} -q64 -o cfgexport64 cfgexport64.o ; \
155         fi
156
157 cfgafs: cfgafs.o
158         $(CC) $(LDFLAGS) ${INCS} -o cfgafs cfgafs.o
159
160 cfgafs64: cfgafs64.o
161         if [ "x$(AIX64)" = "xyes" ]; then  \
162           $(CC) $(LDFLAGS) -g ${INCS} -q64 -o cfgafs64 cfgafs64.o ; \
163         fi
164
165 CFLAGS_cfgexport64.o = -g -q64 -D__XCOFF64__ 
166 cfgexport64.o: ${srcdir}/cfgexport.c AFS_component_version_number.c
167         if [ "x$(AIX64)" = "xyes" ]; then  \
168           $(AFS_CCRULE) $(srcdir)/cfgexport.c ; \
169         fi
170
171 cfgexport.o: ${srcdir}/cfgexport.c AFS_component_version_number.c
172 cfgafs.o: ${srcdir}/cfgafs.c AFS_component_version_number.c
173
174 CFLAGS_cfgafs64.o = -q64
175 cfgafs64.o: ${srcdir}/cfgafs.c AFS_component_version_number.c
176         if [ "x$(AIX64)" = "xyes" ]; then  \
177           $(AFS_CCRULE) $(srcdir)/cfgafs.c ; \
178         fi
179
180 clean:
181         $(RM) -f *.o *.Zlst *.map *.out AFS_component_version_number.c
182         $(RM) -f export.exp export64.exp
183         $(RM) -f cfgexport cfgexport64
184         $(RM) -f cfgafs cfgafs64
185         $(RM) -f *.ext *.ext.nonfs
186
187 install: $(EXPORTS32) $(EXPORTS64)
188         ${INSTALL} -d ${DESTDIR}${afskerneldir}
189         ${INSTALL} -d ${DESTDIR}${libdir}/afs
190         ${INSTALL_DATA} ${srcdir}/extras.exp ${DESTDIR}${libdir}/afs/extras.exp
191         if [ "xyes" = "x$(AIX32)" ]; then \
192           ${INSTALL_DATA} export.exp ${DESTDIR}${libdir}/afs/export.exp ; \
193           ${INSTALL_DATA} export.ext ${DESTDIR}${afskerneldir}/export.ext ; \
194           ${INSTALL_DATA} export.ext.nonfs ${DESTDIR}${afskerneldir}/export.ext.nonfs ; \
195           ${INSTALL_DATA} cfgexport ${DESTDIR}${afskerneldir}/cfgexport ; \
196           ${INSTALL_DATA} cfgafs ${DESTDIR}${afskerneldir}/cfgafs ; \
197         fi
198         if [ "xyes" = "x$(AIX64)" ]; then \
199           ${INSTALL_DATA} export64.exp ${DESTDIR}${libdir}/afs/export64.exp ; \
200           ${INSTALL_DATA} export64.ext ${DESTDIR}${afskerneldir}/export64.ext ; \
201           ${INSTALL_DATA} export64.ext.nonfs ${DESTDIR}${afskerneldir}/export64.ext.nonfs ; \
202           ${INSTALL_DATA} cfgexport64 ${DESTDIR}${afskerneldir}/cfgexport64 ; \
203           ${INSTALL_DATA} cfgafs64 ${DESTDIR}${afskerneldir}/cfgafs64 ; \
204         fi
205
206 dest: $(EXPORTS32) $(EXPORTS64)
207         ${INSTALL} -d ${DEST}/root.client/usr/vice/etc/dkload
208         ${INSTALL} -d ${DEST}/lib/afs
209         ${INSTALL_DATA} ${srcdir}/extras.exp ${DEST}/lib/afs/extras.exp
210         if [ "xyes" = "x$(AIX32)" ];then \
211           ${INSTALL_DATA} export.exp ${DEST}/lib/afs/export.exp ; \
212           ${INSTALL} export.ext ${DEST}/root.client/usr/vice/etc/dkload/export.ext ; \
213           ${INSTALL} export.ext.nonfs ${DEST}/root.client/usr/vice/etc/dkload/export.ext.nonfs ; \
214           ${INSTALL} cfgexport ${DEST}/root.client/usr/vice/etc/dkload/cfgexport ; \
215           ${INSTALL} cfgafs ${DEST}/root.client/usr/vice/etc/dkload/cfgafs ; \
216         fi
217         if [ "xyes" = "x$(AIX64)" ];then \
218           ${INSTALL_DATA} export64.exp ${DEST}/lib/afs/export64.exp ; \
219           ${INSTALL} export64.ext ${DEST}/root.client/usr/vice/etc/dkload/export64.ext ; \
220           ${INSTALL} export64.ext.nonfs ${DEST}/root.client/usr/vice/etc/dkload/export64.ext.nonfs ; \
221           ${INSTALL} cfgexport64 ${DEST}/root.client/usr/vice/etc/dkload/cfgexport64 ; \
222           ${INSTALL} cfgafs64 ${DEST}/root.client/usr/vice/etc/dkload/cfgafs64 ; \
223         fi
224
225 include ../config/Makefile.version