pull-prototypes-to-head-20020821
[openafs.git] / src / libafs / MakefileProto.SOLARIS.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
11
12 # OS specific object files:
13 AFS_OS_OBJS = \
14         osi_groups.o \
15         osi_inode.o \
16         osi_file.o \
17         osi_sleep.o \
18         osi_vm.o \
19         osi_vnodeops.o
20
21 AFS_OS_NFSOBJS = \
22         osi_vfsops_nfs.o
23
24 AFS_OS_NONFSOBJS = \
25         osi_vfsops.o
26
27 # System specific build commands and flags
28 DEFINES= -DAFSDEBUG -DKERNEL -DAFS -DVICE -DNFS -DUFS -DINET -DQUOTA -DGETMOUNT
29 #These are redundant
30 #LD = /usr/ccs/bin/ld
31 #LORDER = /usr/ccs/bin/lorder
32 #CC = /opt/SUNWspro/bin/cc
33 KDEFS= -Dsun4c -DSUN4C_60 -DNFSCLIENT -DSYSACCT -DOLDSCSI -DVDDRV -D_KERNEL \
34         -DSYSV -dn ${ARCH_DEFS}
35
36 <sun4x_57 sun4x_58 sun4x_59>
37 KDEFS_32 = 
38 KDEFS_64 = -xarch=v9 
39
40 <all>
41 CFLAGS=-I. -I.. -I${TOP_OBJDIR}/src/config ${FSINCLUDES} $(DEFINES) $(KDEFS) $(KOPTS) ${DBUG}
42
43 # Name of directory to hold object files and libraries.
44 <all -sun4x_57 -sun4x_58 -sun4x_59>
45 KOBJ = MODLOAD
46 <sun4x_57 sun4x_58 sun4x_59>
47 KOBJ = MODLOAD32 MODLOAD64
48
49
50 # This tells Makefile.common to use it's single directory build target.
51 <all -sun4x_57 -sun4x_58 -sun4x_59>
52 COMPDIRS = single_compdir
53 INSTDIRS = single_instdir
54 DESTDIRS = single_destdir
55
56 <sun4x_57 sun4x_58 sun4x_59>
57 COMPDIRS = solaris_compdirs
58 INSTDIRS = solaris_instdirs
59 DESTDIRS = solaris_destdirs
60
61 <all>
62 include Makefile.common
63
64
65 setup:
66         -$(RM) -f  h net netinet rpc ufs nfs  machine sys inet
67         -ln -fs /usr/include/sys h
68         -ln -fs /usr/include/net net
69         -ln -fs /usr/include/netinet netinet
70         -ln -fs /usr/include/rpc rpc
71         -ln -fs /usr/include/sys sys
72         -ln -fs /usr/include/nfs nfs
73         -ln -fs /usr/include/inet inet
74         -ln -fs /usr/include/ufs ufs
75         for t in ${KOBJ} ; do \
76                 echo Making directory: $$t; \
77                 mkdir -p $$t; \
78                 $(RM) -f $$t/Makefile.common $$t/Makefile $$t/config ; \
79                 ln -fs ../Makefile.common $$t/Makefile.common ; \
80                 ln -fs ../Makefile $$t/Makefile ;\
81                 ln -fs ../config $$t/config ;\
82         done
83
84
85 ## This is the target for a Solaris 7. Here we build both the 32 bit and
86 ## the 64 bit libafs in MODLOAD32 and MODLOAD64 directories respectively
87
88 <sun4x_57 sun4x_58 sun4x_59>
89 ${COMPDIRS} ${INSTDIRS} ${DESTDIRS}:
90         for t in ${KOBJ} ; do \
91                 echo Building directory: $$t ; \
92                 case $$t in \
93                         MODLOAD32) \
94                          ARCH_DEFS="${KDEFS_32}" ; \
95                          BITS="" ;; \
96                         MODLOAD64) \
97                          ARCH_DEFS="${KDEFS_64}" ; \
98                          BITS="64" ;; \
99                 esac ; \
100                 export ARCH_DEFS ; \
101                 export BITS ; \
102                 cd $$t  ; \
103                 $(MAKE) $@_libafs ; \
104                 cd ../ ;\
105         done
106
107 solaris_compdirs_libafs: libafs
108 solaris_instdirs_libafs: install_libafs
109 solaris_destdirs_libafs: dest_libafs
110
111 <all>
112
113 # Below this line are targets when in the COMMON directory:
114 LIBAFS = libafs.o
115 LIBAFSNONFS = libafs.nonfs.o
116
117 <all -sun4x_57 -sun4x_58 -sun4x_59>
118 INST_LIBAFS = ${DESTDIR}${afskerneldir}/${LIBAFS}
119 INST_LIBAFSNONFS = ${DESTDIR}${afskerneldir}/${LIBAFSNONFS}
120
121 DEST_LIBAFS = ${DEST}/root.client/usr/vice/etc/modload/${LIBAFS}
122 DEST_LIBAFSNONFS = ${DEST}/root.client/usr/vice/etc/modload/${LIBAFSNONFS}
123
124 libafs: $(LIBAFSNONFS)
125 install_libafs: $(INST_LIBAFSNONFS)
126 dest_libafs:    $(DEST_LIBAFSNONFS)
127
128
129 $(INST_LIBAFS): $(LIBAFS)
130         ${INSTALL} -f $? $@
131
132 $(INST_LIBAFSNONFS): $(LIBAFSNONFS)
133         ${INSTALL} -f $? $@
134
135 $(DEST_LIBAFS): $(LIBAFS)
136         ${INSTALL} -f $? $@
137
138 $(DEST_LIBAFSNONFS): $(LIBAFSNONFS)
139         ${INSTALL} -f $? $@
140
141 <all>
142 ${LIBAFS}: $(AFSAOBJS) $(AFSNFSOBJS)
143         $(RM) -f $@
144         $(LD) -r -o $@ $(AFSAOBJS) ${AFSNFSOBJS}
145
146 ${LIBAFSNONFS}:  $(AFSAOBJS) $(AFSNONFSOBJS)
147         $(RM) -f $@
148         $(LD) -r -o $@  $(AFSAOBJS) ${AFSNONFSOBJS}
149
150 <sun4x_57 sun4x_58 sun4x_59>
151
152 libafs: ${LIBAFSNONFS}
153
154 install_libafs: ${LIBAFSNONFS}
155         ${INSTALL} -f ${LIBAFSNONFS} ${DESTDIR}${afskerneldir}/libafs${BITS}.nonfs.o
156
157 dest_libafs: ${LIBAFSNONFS}
158         ${INSTALL} -f ${LIBAFSNONFS} ${DEST}/root.client/usr/vice/etc/modload/libafs${BITS}.nonfs.o
159
160 <all>
161
162 # Solaris specific objects
163 osi_groups.o: $(AFS)/osi_groups.c
164         $(CRULE1)
165 osi_inode.o: $(AFS)/osi_inode.c
166         $(CRULE1)
167 osi_file.o: $(AFS)/osi_file.c
168         $(CRULE1)
169 osi_sleep.o: $(AFS)/osi_sleep.c
170         $(CRULE1)
171 osi_vfsops_nfs.o: $(AFS)/osi_vfsops.c
172         $(CRULE1) -o osi_vfsops_nfs.o
173 osi_vfsops.o: $(AFS)/osi_vfsops.c
174         $(CRULE1) -DAFS_NONFSTRANS
175 osi_vm.o: $(AFS)/osi_vm.c
176         $(CRULE1)
177 osi_vnodeops.o: $(AFS)/osi_vnodeops.c
178         $(CRULE1)