f715b9eb7b812e7c81b4d8c995c176c0248c6994
[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= -D_KERNEL -DSYSV -dn ${ARCH_DEFS}
34
35 <sun4x_57 sun4x_58 sun4x_59 sun4x_510>
36 KDEFS_32 = 
37 KDEFS_64 = -xarch=v9 
38
39 <sunx86_57 sunx86_58 sunx86_59 sunx86_510>
40 KDEFS_32 = 
41 KDEFS_64 = -xarch=amd64 -xmodel=kernel
42
43 <all>
44 CFLAGS=-I. -I.. -I${TOP_OBJDIR}/src/config ${FSINCLUDES} $(DEFINES) $(KDEFS) $(KOPTS) ${DBUG}
45
46 # Name of directory to hold object files and libraries.
47 <all -sun4x_57 -sun4x_58 -sun4x_59 -sun4x_510 -sunx86_57 -sunx86_58 -sunx86_59 -sunx86_510>
48 KOBJ = MODLOAD
49 <sun4x_57 sun4x_58 sun4x_59 sunx86_57 sunx86_58 sunx86_59 sunx86_510>
50 KOBJ = MODLOAD32 MODLOAD64
51 <sun4x_510>
52 KOBJ = MODLOAD64
53
54 # This tells Makefile.common to use it's single directory build target.
55 <all -sun4x_57 -sun4x_58 -sun4x_59 -sun4x_510 -sunx86_57 -sunx86_58 -sunx86_59 -sunx86_510>
56 COMPDIRS = single_compdir
57 INSTDIRS = single_instdir
58 DESTDIRS = single_destdir
59
60 <sun4x_57 sun4x_58 sun4x_59 sun4x_510 sunx86_57 sunx86_58 sunx86_59 sunx86_510>
61 COMPDIRS = solaris_compdirs
62 INSTDIRS = solaris_instdirs
63 DESTDIRS = solaris_destdirs
64
65 <all>
66 include Makefile.common
67
68
69 setup:
70         -$(RM) -f  h net netinet rpc ufs nfs  machine sys inet
71         -ln -fs /usr/include/sys h
72         -ln -fs /usr/include/net net
73         -ln -fs /usr/include/netinet netinet
74         -ln -fs /usr/include/rpc rpc
75         -ln -fs /usr/include/sys sys
76         -ln -fs /usr/include/nfs nfs
77         -ln -fs /usr/include/inet inet
78         -ln -fs /usr/include/ufs ufs
79         for t in ${KOBJ} ; do \
80                 echo Making directory: $$t; \
81                 mkdir -p $$t; \
82                 $(RM) -f $$t/Makefile.common $$t/Makefile $$t/config ; \
83                 ln -fs ../Makefile.common $$t/Makefile.common ; \
84                 ln -fs ../Makefile $$t/Makefile ;\
85                 ln -fs ../config $$t/config ;\
86         done
87
88
89 ## This is the target for a Solaris 7. Here we build both the 32 bit and
90 ## the 64 bit libafs in MODLOAD32 and MODLOAD64 directories respectively
91
92 <sun4x_57 sun4x_58 sun4x_59 sun4x_510 sunx86_57 sunx86_58 sunx86_59 sunx86_510>
93 ${COMPDIRS} ${INSTDIRS} ${DESTDIRS}:
94         for t in ${KOBJ} ; do \
95                 echo Building directory: $$t ; \
96                 case $$t in \
97                         MODLOAD32) \
98                          ARCH_DEFS="${KDEFS_32}" ; \
99                          BITS="" ;; \
100                         MODLOAD64) \
101                          ARCH_DEFS="${KDEFS_64}" ; \
102                          BITS="64" ;; \
103                 esac ; \
104                 export ARCH_DEFS ; \
105                 export BITS ; \
106                 cd $$t  ; \
107                 $(MAKE) $@_libafs ; \
108                 cd ../ ;\
109         done
110
111 solaris_compdirs_libafs: depsrcs libafs
112 solaris_instdirs_libafs: install_libafs
113 solaris_destdirs_libafs: dest_libafs
114
115 <all>
116
117 # Below this line are targets when in the COMMON directory:
118 LIBAFS = libafs.o
119 LIBAFSNONFS = libafs.nonfs.o
120
121 <all -sun4x_57 -sun4x_58 -sun4x_59>
122 INST_LIBAFS = ${DESTDIR}${afskerneldir}/${LIBAFS}
123 INST_LIBAFSNONFS = ${DESTDIR}${afskerneldir}/${LIBAFSNONFS}
124
125 DEST_LIBAFS = ${DEST}/root.client/usr/vice/etc/modload/${LIBAFS}
126 DEST_LIBAFSNONFS = ${DEST}/root.client/usr/vice/etc/modload/${LIBAFSNONFS}
127
128 <sun4x_57 sun4x_58 sun4x_59 sun4x_510 sunx86_57 sunx86_58 sunx86_59 sunx86_510>
129 INST_LIBAFSNONFS = ${DESTDIR}${afskerneldir}/libafs${BITS}.nonfs.o
130 INST_LIBAFS = ${DESTDIR}${afskerneldir}/libafs${BITS}.o
131
132 DEST_LIBAFSNONFS = ${DEST}/root.client/usr/vice/etc/modload/libafs${BITS}.nonfs.o
133 DEST_LIBAFS = ${DEST}/root.client/usr/vice/etc/modload/libafs${BITS}.o
134
135 <all>
136
137 # Without this line, gmake tries to build libafs.o
138 .PHONY: libafs
139
140 libafs: $(LIBAFSNONFS) $(LIBAFS)
141 install_libafs: $(INST_LIBAFSNONFS) $(INST_LIBAFS)
142 dest_libafs:    $(DEST_LIBAFSNONFS) $(DEST_LIBAFS)
143
144
145 $(INST_LIBAFS): $(LIBAFS)
146         ${INSTALL} -f $? $@
147
148 $(INST_LIBAFSNONFS): $(LIBAFSNONFS)
149         ${INSTALL} -f $? $@
150
151 $(DEST_LIBAFS): $(LIBAFS)
152         ${INSTALL} -f $? $@
153
154 $(DEST_LIBAFSNONFS): $(LIBAFSNONFS)
155         ${INSTALL} -f $? $@
156
157 ${LIBAFS}: $(AFSAOBJS) $(AFSNFSOBJS)
158         $(RM) -f $@
159         $(LD) -r -o $@ $(AFSAOBJS) ${AFSNFSOBJS}
160
161 ${LIBAFSNONFS}:  $(AFSAOBJS) $(AFSNONFSOBJS)
162         $(RM) -f $@
163         $(LD) -r -o $@  $(AFSAOBJS) ${AFSNONFSOBJS}
164