setgroups-return-errors-negative-20030515
[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 sunx86_57 sunx86_58 sunx86_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 -sunx86_57 -sunx86_58 -sunx86_59>
45 KOBJ = MODLOAD
46 <sun4x_57 sun4x_58 sun4x_59 sunx86_57 sunx86_58 sunx86_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 -sunx86_57 -sunx86_58 -sunx86_59>
52 COMPDIRS = single_compdir
53 INSTDIRS = single_instdir
54 DESTDIRS = single_destdir
55
56 <sun4x_57 sun4x_58 sun4x_59 sunx86_57 sunx86_58 sunx86_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 sunx86_57 sunx86_58 sunx86_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: depsrcs 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 <sun4x_57 sun4x_58 sun4x_59>
125
126 libafs: ${LIBAFSNONFS} ${LIBAFS}
127
128 install_libafs: ${LIBAFSNONFS} ${LIBAFS}
129         ${INSTALL} -f ${LIBAFSNONFS} ${DESTDIR}${afskerneldir}/libafs${BITS}.nonfs.o
130         ${INSTALL} -f ${LIBAFS} ${DESTDIR}${afskerneldir}/libafs${BITS}.o
131
132 dest_libafs: ${LIBAFSNONFS} ${LIBAFS}
133         ${INSTALL} -f ${LIBAFSNONFS} ${DEST}/root.client/usr/vice/etc/modload/libafs${BITS}.nonfs.o
134         ${INSTALL} -f ${LIBAFS} ${DEST}/root.client/usr/vice/etc/modload/libafs${BITS}.o
135
136 <all>
137
138 # Without this line, gmake tries to build libafs.o
139 .PHONY: libafs
140
141 libafs: $(LIBAFSNONFS) $(LIBAFS)
142 install_libafs: $(INST_LIBAFSNONFS) $(INST_LIBAFS)
143 dest_libafs:    $(DEST_LIBAFSNONFS) $(DEST_LIBAFS)
144
145
146 $(INST_LIBAFS): $(LIBAFS)
147         ${INSTALL} -f $? $@
148
149 $(INST_LIBAFSNONFS): $(LIBAFSNONFS)
150         ${INSTALL} -f $? $@
151
152 $(DEST_LIBAFS): $(LIBAFS)
153         ${INSTALL} -f $? $@
154
155 $(DEST_LIBAFSNONFS): $(LIBAFSNONFS)
156         ${INSTALL} -f $? $@
157
158 ${LIBAFS}: $(AFSAOBJS) $(AFSNFSOBJS)
159         $(RM) -f $@
160         $(LD) -r -o $@ $(AFSAOBJS) ${AFSNFSOBJS}
161
162 ${LIBAFSNONFS}:  $(AFSAOBJS) $(AFSNONFSOBJS)
163         $(RM) -f $@
164         $(LD) -r -o $@  $(AFSAOBJS) ${AFSNONFSOBJS}
165