more-makefiles-cleanup-20010829
[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 DESTDIR=@DESTDIR@
11 SRCDIR=@SRCDIR@
12 TOP_SRCDIR=@TOP_SRCDIR@
13 SYS_NAME=@AFS_SYSNAME@
14
15 include config/Makefile.${SYS_NAME}
16
17 # OS specific object files:
18 AFS_OS_OBJS = \
19         osi_groups.o \
20         osi_inode.o \
21         osi_file.o \
22         osi_sleep.o \
23         osi_vm.o \
24         osi_vnodeops.o \
25         xdr_int64.o
26
27 AFS_OS_NFSOBJS = \
28         osi_vfsops_nfs.o
29
30 AFS_OS_NONFSOBJS = \
31         osi_vfsops.o
32
33 # System specific build commands and flags
34 DEFINES= -DAFSDEBUG -DKERNEL -DAFS -DVICE -DNFS -DUFS -DINET -DQUOTA -DGETMOUNT
35 #These are redundant
36 #LD = /usr/ccs/bin/ld
37 #LORDER = /usr/ccs/bin/lorder
38 #CC = /opt/SUNWspro/bin/cc
39 KDEFS= -Dsun4c -DSUN4C_60 -DNFSCLIENT -DSYSACCT -DOLDSCSI -DVDDRV -D_KERNEL \
40         -DSYSV -dn ${ARCH_DEFS}
41
42 <sun4x_57 sun4x_58>
43 KDEFS_32 = 
44 KDEFS_64 = -xarch=v9
45
46 <all>
47 CFLAGS=-I. -I.. -I${TOP_SRCDIR}/config ${FSINCLUDES} $(DEFINES) $(KDEFS) $(KOPTS) ${DBUG}
48
49 # Name of directory to hold object files and libraries.
50 <all -sun4x_57 -sun4x_58>
51 KOBJ = MODLOAD
52 <sun4x_57 sun4x_58>
53 KOBJ = MODLOAD32 MODLOAD64
54
55
56 # This tells Makefile.common to use it's single directory build target.
57 <all -sun4x_57 -sun4x_58>
58 COMPDIRS = single_compdir
59 INSTDIRS = single_instdir
60
61 <sun4x_57 sun4x_58>
62 COMPDIRS = solaris_compdirs
63 INSTDIRS = solaris_instdirs
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 -s /usr/include/sys h
72         -ln -s /usr/include/net net
73         -ln -s /usr/include/netinet netinet
74         -ln -s /usr/include/rpc rpc
75         -ln -s /usr/include/sys sys
76         -ln -s /usr/include/nfs nfs
77         -ln -s /usr/include/inet inet
78         -ln -s /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 -s ../Makefile.common $$t/Makefile.common ; \
84                 ln -s ../Makefile $$t/Makefile ;\
85                 ln -s ../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>
93 ${COMPDIRS} ${INSTDIRS}:
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: libafs
112 solaris_instdirs_libafs: install_libafs
113
114 <all>
115
116 # Below this line are targets when in the COMMON directory:
117 LIBAFS = libafs.o
118 LIBAFSNONFS = libafs.nonfs.o
119
120 <all -sun4x_57 -sun4x_58>
121 DEST_LIBAFS = ${DESTDIR}/root.client/usr/vice/etc/modload/${LIBAFS}
122 DEST_LIBAFSNONFS = ${DESTDIR}/root.client/usr/vice/etc/modload/${LIBAFSNONFS}
123
124 # Without this line, gmake tries to build libafs.o
125 .PHONY: libafs
126
127 # libafs:       $(DEST_LIBAFS) $(DEST_LIBAFSNONFS)
128 libafs: $(LIBAFSNONFS)
129 install_libafs: $(DEST_LIBAFSNONFS)
130
131
132 $(DEST_LIBAFS): $(LIBAFS)
133         ${INSTALL} -f $? $@
134
135 $(DEST_LIBAFSNONFS): $(LIBAFSNONFS)
136         ${INSTALL} -f $? $@
137
138 <all>
139 ${LIBAFS}: $(AFSAOBJS) $(AFSNFSOBJS)
140         $(RM) -f $@
141         $(LD) -r -o $@ $(AFSAOBJS) ${AFSNFSOBJS}
142
143 ${LIBAFSNONFS}:  $(AFSAOBJS) $(AFSNONFSOBJS)
144         $(RM) -f $@
145         $(LD) -r -o $@  $(AFSAOBJS) ${AFSNONFSOBJS}
146
147 <sun4x_57 sun4x_58>
148 MODLOADDIR = ${DESTDIR}/root.client/usr/vice/etc/modload
149
150 libafs: ${LIBAFSNONFS}
151 install_libafs: ${LIBAFSNONFS}
152         ${INSTALL} -f ${LIBAFSNONFS} ${MODLOADDIR}/libafs${BITS}.nonfs.o
153
154 <all>
155
156 # Solaris specific objects
157 osi_groups.o: $(AFS)/osi_groups.c
158         $(CRULE1);
159 osi_inode.o: $(AFS)/osi_inode.c
160         $(CRULE1);
161 osi_file.o: $(AFS)/osi_file.c
162         $(CRULE1);
163 osi_sleep.o: $(AFS)/osi_sleep.c
164         $(CRULE1);
165 osi_vfsops_nfs.o: $(AFS)/osi_vfsops.c
166         $(CRULE1) -o osi_vfsops_nfs.o;
167 osi_vfsops.o: $(AFS)/osi_vfsops.c
168         $(CRULE1) -DAFS_NONFSTRANS;
169 osi_vm.o: $(AFS)/osi_vm.c
170         $(CRULE1);
171 osi_vnodeops.o: $(AFS)/osi_vnodeops.c
172         $(CRULE1);
173 xdr_int64.o: $(RX)/xdr_int64.c
174         $(CRULE1);