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