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