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