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