SOLARIS: update convert from ancient _depends_on
[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 INSTALL = @INSTALL@
11 INSTALL_DATA = @INSTALL_DATA@
12 INSTALL_PROGRAM = @INSTALL_PROGRAM@
13 INSTALL_SCRIPT = @INSTALL_SCRIPT@
14
15
16 # OS specific object files:
17 AFS_OS_OBJS = \
18         osi_crypto.o \
19         osi_gcpags.o \
20         osi_groups.o \
21         osi_inode.o \
22 <sunx86_511 sun4x_511>
23         osi_ioctl.o \
24 <all>
25         osi_file.o \
26         osi_sleep.o \
27         osi_vcache.o \
28         osi_vm.o \
29         osi_vnodeops.o
30
31 AFS_OS_NFSOBJS = \
32         osi_vfsops_nfs.o
33
34 AFS_OS_NONFSOBJS = \
35         osi_vfsops.o
36
37 # System specific build commands and flags
38 DEFINES= -DAFSDEBUG -DKERNEL -DAFS -DVICE -DNFS -DUFS -DINET -DQUOTA -DGETMOUNT
39 #These are redundant
40 #LD = /usr/ccs/bin/ld
41 #LORDER = /usr/ccs/bin/lorder
42 #CC = /opt/SUNWspro/bin/cc
43 KDEFS= -D_KERNEL -DSYSV -dn ${ARCH_DEFS}
44
45 <sun4x_58 sun4x_59 sun4x_510 sun4x_511>
46 KDEFS_32 = -xarch=v8
47 KDEFS_64 = -xarch=v9 
48
49 <sunx86_58 sunx86_59 sunx86_510 sunx86_511>
50 KDEFS_32 = 
51 KDEFS_64 = -xarch=amd64 -xmodel=kernel
52
53 <all>
54 CFLAGS=-I. -I.. -I${TOP_OBJDIR}/src/config ${FSINCLUDES} $(DEFINES) $(KDEFS) $(KOPTS) ${DBUG}
55
56 <sun4x_58 sunx86_58 sun4x_59 sunx86_59>
57 LDFLAGS=-r -dy -N drv/ip -N drv/udp -N strmod/rpcmod
58
59 <all -sun4x_58 -sunx86_58 -sun4x_59 -sunx86_59>
60 LDFLAGS=-r -dy -N drv/ip -N drv/udp -N strmod/rpcmod -N fs/ufs
61
62 # Name of directory to hold object files and libraries.
63 <all -sun4x_510 sun4x_511 sunx86_511>
64 KOBJ = MODLOAD32 MODLOAD64
65 <sun4x_510 sun4x_511 sunx86_511>
66 KOBJ = MODLOAD64
67
68 # This tells Makefile.common to use it's single directory build target.
69 <all>
70 COMPDIRS = solaris_compdirs
71 INSTDIRS = solaris_instdirs
72 DESTDIRS = solaris_destdirs
73
74 include Makefile.common
75
76
77 setup:
78         -$(RM) -f  h net netinet rpc ufs nfs  machine sys inet
79         -ln -fs /usr/include/sys h
80         -ln -fs /usr/include/net net
81         -ln -fs /usr/include/netinet netinet
82         -ln -fs /usr/include/rpc rpc
83         -ln -fs /usr/include/sys sys
84         -ln -fs /usr/include/nfs nfs
85         -ln -fs /usr/include/inet inet
86         -ln -fs /usr/include/ufs ufs
87         for t in ${KOBJ} ; do \
88                 echo Making directory: $$t; \
89                 mkdir -p $$t; \
90                 $(RM) -f $$t/Makefile.common $$t/Makefile $$t/config ; \
91                 ln -fs ../Makefile.common $$t/Makefile.common ; \
92                 ln -fs ../Makefile $$t/Makefile ;\
93                 ln -fs ../config $$t/config ;\
94         done
95
96
97 ## This is the target for a Solaris 7. Here we build both the 32 bit and
98 ## the 64 bit libafs in MODLOAD32 and MODLOAD64 directories respectively
99
100 ${COMPDIRS} ${INSTDIRS} ${DESTDIRS}:
101         for t in ${KOBJ} ; do \
102                 echo Building directory: $$t ; \
103                 case $$t in \
104                         MODLOAD32) \
105                          ARCH_DEFS="${KDEFS_32}" ; \
106                          BITS="" ;; \
107                         MODLOAD64) \
108                          ARCH_DEFS="${KDEFS_64}" ; \
109                          BITS="64" ;; \
110                 esac ; \
111                 export ARCH_DEFS ; \
112                 export BITS ; \
113                 cd $$t  ; \
114                 $(MAKE) $@_libafs || exit $$? ; \
115                 cd ../ ;\
116         done
117
118 solaris_compdirs_libafs: depsrcs libafs
119 solaris_instdirs_libafs: install_libafs
120 solaris_destdirs_libafs: dest_libafs
121
122 # Below this line are targets when in the COMMON directory:
123 LIBAFS = libafs.o
124 LIBAFSNONFS = libafs.nonfs.o
125
126 INST_LIBAFSNONFS = ${DESTDIR}${afskerneldir}/libafs${BITS}.nonfs.o
127 INST_LIBAFS = ${DESTDIR}${afskerneldir}/libafs${BITS}.o
128
129 DEST_LIBAFSNONFS = ${DEST}/root.client/usr/vice/etc/modload/libafs${BITS}.nonfs.o
130 DEST_LIBAFS = ${DEST}/root.client/usr/vice/etc/modload/libafs${BITS}.o
131
132 # Without this line, gmake tries to build libafs.o
133 .PHONY: libafs
134
135 libafs: $(LIBAFSNONFS) $(LIBAFS)
136
137 install_libafs: $(LIBAFS) $(LIBAFSNONFS)
138         ${INSTALL} -d ${DESTDIR}${afskerneldir}
139         ${INSTALL} -m 644 $(LIBAFS) $(INST_LIBAFS)
140         ${INSTALL} -m 644 $(LIBAFSNONFS) $(INST_LIBAFSNONFS)
141
142 dest_libafs: $(LIBAFS) $(LIBAFSNONFS)
143         ${INSTALL} -d ${DEST}/root.client/usr/vice/etc/modload
144         ${INSTALL} -m 644 $(LIBAFS) $(DEST_LIBAFS)
145         ${INSTALL} -m 644 $(LIBAFSNONFS) $(DEST_LIBAFSNONFS)
146
147 ${LIBAFS}: $(AFSAOBJS) $(AFSNFSOBJS)
148         $(RM) -f $@
149         $(LD) $(LDFLAGS) -o $@ $(AFSAOBJS) ${AFSNFSOBJS}
150
151 ${LIBAFSNONFS}:  $(AFSAOBJS) $(AFSNONFSOBJS)
152         $(RM) -f $@
153         $(LD) $(LDFLAGS) -o $@ $(AFSAOBJS) ${AFSNONFSOBJS}
154