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