apply-modversions-so-nothing-has-first-been-included-20010623
[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 include ../config/Makefile.${SYS_NAME}
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= -Dsun4c -DSUN4C_60 -DNFSCLIENT -DSYSACCT -DOLDSCSI -DVDDRV -D_KERNEL \
34         -DSYSV -dn ${ARCH_DEFS}
35
36 <sun4x_57 sun4x_58>
37 KDEFS_32 = 
38 KDEFS_64 = -xarch=v9
39
40 <all>
41 CFLAGS=-I. -I.. -I${TOP_SRCDIR}/config ${FSINCLUDES} $(DEFINES) $(KDEFS) $(KOPTS) ${DBUG}
42
43 # Name of directory to hold object files and libraries.
44 <all -sun4x_57 -sun4x_58>
45 KOBJ = MODLOAD
46 <sun4x_57 sun4x_58>
47 KOBJ = MODLOAD32 MODLOAD64
48
49
50 # This tells Makefile.common to use it's single directory build target.
51 <all -sun4x_57 -sun4x_58>
52 COMPDIRS = single_compdir
53
54 <sun4x_57 sun4x_58>
55 COMPDIRS = solaris_compdirs
56
57 <all>
58 include Makefile.common
59
60
61 setup:
62         -rm -f  h net netinet rpc ufs nfs  machine sys inet
63         -ln -s /usr/include/sys h
64         -ln -s /usr/include/net net
65         -ln -s /usr/include/netinet netinet
66         -ln -s /usr/include/rpc rpc
67         -ln -s /usr/include/sys sys
68         -ln -s /usr/include/nfs nfs
69         -ln -s /usr/include/inet inet
70         -ln -s /usr/include/ufs ufs
71         for t in ${KOBJ} ; do \
72                 echo Making directory: $$t; \
73                 mkdir -p $$t; \
74                 rm -f $$t/Makefile.common $$t/Makefile ; \
75                 ln -s ../Makefile.common $$t/Makefile.common ; \
76                 ln -s ../Makefile $$t/Makefile ;\
77         done
78
79
80 ## This is the target for a Solaris 7. Here we build both the 32 bit and
81 ## the 64 bit libafs in MODLOAD32 and MODLOAD64 directories respectively
82
83 <sun4x_57 sun4x_58>
84 ${COMPDIRS}:
85         for t in ${KOBJ} ; do \
86                 echo Building directory: $$t ; \
87                 case $$t in \
88                         MODLOAD32) \
89                          ARCH_DEFS="${KDEFS_32}" ; \
90                          BITS="" ;; \
91                         MODLOAD64) \
92                          ARCH_DEFS="${KDEFS_64}" ; \
93                          BITS="64" ;; \
94                 esac ; \
95                 export ARCH_DEFS ; \
96                 export BITS ; \
97                 cd $$t  ; \
98                 $(MAKE) DESTDIR=${DESTDIR}  libafs ; \
99                 cd ../ ;\
100         done
101
102 <all>
103
104 # Below this line are targets when in the COMMON directory:
105 LIBAFS = libafs.o
106 LIBAFSNONFS = libafs.nonfs.o
107
108 <all -sun4x_57 -sun4x_58>
109 DEST_LIBAFS = ${DESTDIR}/root.client/usr/vice/etc/modload/${LIBAFS}
110 DEST_LIBAFSNONFS = ${DESTDIR}/root.client/usr/vice/etc/modload/${LIBAFSNONFS}
111
112 # Without this line, gmake tries to build libafs.o
113 .PHONY: libafs
114
115 # libafs:       $(DEST_LIBAFS) $(DEST_LIBAFSNONFS)
116 libafs: $(DEST_LIBAFSNONFS)
117
118
119 $(DEST_LIBAFS): $(LIBAFS)
120         ${INSTALL} -f $? $@
121
122 $(DEST_LIBAFSNONFS): $(LIBAFSNONFS)
123         ${INSTALL} -f $? $@
124
125 <all>
126 ${LIBAFS}: $(AFSAOBJS) $(AFSNFSOBJS)
127         $(RM) -f $@
128         $(LD) -r -o $@ $(AFSAOBJS) ${AFSNFSOBJS}
129
130 ${LIBAFSNONFS}:  $(AFSAOBJS) $(AFSNONFSOBJS)
131         $(RM) -f $@
132         $(LD) -r -o $@  $(AFSAOBJS) ${AFSNONFSOBJS}
133
134 <sun4x_57 sun4x_58>
135 MODLOADDIR = ${DESTDIR}root.client/usr/vice/etc/modload
136
137 libafs: ${LIBAFSNONFS}
138         ${INSTALL} -f ${LIBAFSNONFS} ${MODLOADDIR}/libafs${BITS}.nonfs.o
139
140 <all>
141
142 # Solaris specific objects
143 osi_groups.o: $(AFS)/osi_groups.c
144         $(CRULE1);
145 osi_inode.o: $(AFS)/osi_inode.c
146         $(CRULE1);
147 osi_file.o: $(AFS)/osi_file.c
148         $(CRULE1);
149 osi_sleep.o: $(AFS)/osi_sleep.c
150         $(CRULE1);
151 osi_vfsops_nfs.o: $(AFS)/osi_vfsops.c
152         $(CRULE1) -o osi_vfsops_nfs.o;
153 osi_vfsops.o: $(AFS)/osi_vfsops.c
154         $(CRULE1) -DAFS_NONFSTRANS;
155 osi_vm.o: $(AFS)/osi_vm.c
156         $(CRULE1);
157 osi_vnodeops.o: $(AFS)/osi_vnodeops.c
158         $(CRULE1);