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