7ebfb1687bc5205971176c0cbfa9c8c3ac9d0be0
[openafs.git] / src / libafs / MakefileProto.HPUX.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_debug.o \
15         osi_groups.o \
16         osi_inode.o \
17         osi_file.o \
18         osi_misc.o \
19         osi_sleep.o \
20         osi_vnodeops.o \
21         osi_vm.o
22
23 AFS_OS_NFSOBJS = \
24 <ia64_hpux1123>
25         hpux_mod_nfs.modmeta.o \
26 <all>
27         osi_vfsops_nfs.o
28
29 AFS_OS_NONFSOBJS = \
30 <ia64_hpux1123>
31         hpux_mod.modmeta.o \
32 <all>
33         osi_vfsops.o
34
35
36 # System specific build commands and flags
37 #
38 # Note: the online document
39 #
40 #       Developing Dynamically Loadable Kernel Modules
41 #       Issue 1.0
42 #       HP-UX 11.0
43 #       October 12, 1998
44 #
45 # mentioned on http://docs.hp.com/hpux/os/index.html
46 # with URL     http://docs.hp.com/hpux/content/dlkm_v1.2.pdf
47 #
48 # recommends the undocumented +ES1.Xindirect_calls option for both
49 # 32-bit and 64-bit kernel code, but it appears to be absolutely vital
50 # for compiling 64-bit kernel code.  In 64-bit mode, the ANSI C compiler
51 # has the +Z (PIC) option on by default, and there is no documented way
52 # to turn it off.  However, kernel code does not work properly when
53 # compiled with +Z (i.e. calling a function through a function pointer
54 # seems to hang).  When the compiler sees the +ES1.Xindirect_calls
55 # option, however, it issues a warning and turns off +Z.
56 #
57 # for 11.23, see the DDK BE/Sample_makefiles/Makefile.bld
58 # for mod drivers.
59 #
60 <hp_ux110 hp_ux102 hp_ux11i>
61 KDEFS= +ES1.Xindirect_calls +XixdU +Hx0 +ESlit +ESsfc +ESssf -Wp,-H300000 -D_KERNEL -D_KERNEL_BUILD -D_UNSUPPORTED \
62         -DMP +R500 -Wl,+k $(CPU_KDEFS)
63 KDEFS_32 = +DA1.0 +DS1.0
64 # add +M2 to $(KDEFS_64) for 64-bit migration warnings
65 # warning 478: "+Z" and "+ES1.Xindirect_calls" are mutually exclusive. "+Z" ignored.
66 # warning 530: LP64 migration: Casting from loose to strict alignment: Resulting pointer may be misaligned.
67 KDEFS_64 = +DA2.0W +DS2.0 +M2 +W 478,530
68
69 <all>
70
71 <ia64_hpux1122>
72 KDEFS= +kernel -Wp,-H300000 -D_KERNEL -D_KERNEL_BUILD -D_UNSUPPORTED \
73   -DFINE_GRAINED_PROTO_FILES \
74   -DMP -Wl,+k $(CPU_KDEFS)
75 KDEFS_32 =
76 KDEFS_64 = +DD64
77
78 <ia64_hpux1123>
79
80 CCOPTS_common= -Ae +DD64 +O2
81
82 IDENTS_common= -DACLS -DAUDIT -DHPONCPLUS -DIDDS -DIPSEC -DIVT_INTERCEPT \
83     -DLWSYSCALL -DPGPROF -DSTCP -D_CLEAN_BE -D_HPUX_SOURCE -D_KERNEL \
84     -D_LARGEFILE64_SOURCE -D_NO_USER_PROTOS -D_UNSUPPORTED \
85     -D__BIGMSGQUEUE_ENABLED -D__ROSE__ -U__hp9000s700 \
86     -D_XPG4_EXTENDED -D__STDC_EXT__
87
88 # Definitions which apply to IPF only
89
90 CCOPTS_ipf= +DSitanium2 +kernel +objstatvars +Olit=all +Oshortdata=0 +W863
91
92 IDENTS_ipf= -DKERNEL_DEBUGGER -DVARIABLE_UAREA -D_SYSCALL_64 -D__NO_PA_HDRS
93
94 LDOPTS_ipf= +noobjdebug
95
96 # above from the Makefile.bld example
97
98 LDOPTS= $(LDOPTS_ipf)
99 KDEFS= $(CCOPTS_common) $(IDENTS_common) $(CPU_KDEFS) 
100 KDEFS_64= $(CCOPTS_ipf) $(IDENTS_ipf)
101
102 MODLINK=/opt/ddk/11.23/BE/bin/modlink
103 MODMETA=/opt/ddk/11.23/BE/bin/modmeta
104
105 <all>
106
107 DEFINES= -DAFSDEBUG -DKERNEL -DAFS -DVICE -DNFS -DUFS -DINET -DQUOTA -DGETMOUNT -DHPONCPLUS
108 OPTF=${OPT} 
109 OPTF2=${OPT2} 
110 CFLAGS=-I. -I.. -I../h -I../nfs -I../conf -I${TOP_OBJDIR}/src/config ${FSINCLUDES} $(DEFINES) $(KDEFS) $(KOPTS) ${DBUG}
111
112 # Name of directory to hold object files and libraries.
113 KOBJ=STATIC
114
115 # This is the hpux multiple directory target.
116 COMPDIRS = hpux_compdirs
117 INSTDIRS = hpux_instdirs
118 DESTDIRS = hpux_destdirs
119
120 include Makefile.common
121
122 <hp_ux11i hp_ux110 hp_ux102>
123 BITS = 64 32
124 <ia64_hpux1122 ia64_hpux1123>
125 BITS = 64
126 <all>
127
128 setup:
129         -$(RM) -f  h conf net dux machine netinet nfs rpc s200 ufs sys
130 <hp_ux102>
131         ln -fs /usr/include/sys h
132 <hp_ux110 hp_ux11i ia64_hpux1122>
133         ln -fs /etc/conf/h h
134 <hp_ux102 hp_ux110 hp_ux11i ia64_hpux1122>
135         ln -fs /etc/conf conf
136         ln -fs /etc/conf/net net
137         ln -fs /etc/conf/dux dux
138         ln -fs /etc/conf/machine machine
139         ln -fs /etc/conf/netinet netinet
140         ln -fs /etc/conf/nfs nfs
141         ln -fs /usr/include/rpc rpc
142         ln -fs /etc/conf/machine s200
143 <hp_ux11i hp_ux110 hp_ux102>
144         ln -fs /etc/conf/ufs ufs
145 <ia64_hpux1122>
146         ln -fs /etc/conf/sys ufs
147 <ia64_hpux1123>
148         ln -fs /usr/include/sys h
149         ln -fs /usr/include/net net
150         ln -fs /usr/include/netinet netinet
151         ln -fs /usr/include/nfs nfs
152         ln -fs /usr/include/rpc rpc
153         ln -fs /usr/include/sys ufs
154 <all>
155         ln -fs /usr/include/sys sys
156         for b in $(BITS); do \
157             for t in $(KOBJ); do \
158                 dir=$$t.$$b; \
159                 echo Making directory: $$dir; \
160                 mkdir -p $$dir; \
161                 $(RM) -f $$dir/Makefile $$dir/Makefile.common $$dir/config; \
162                 ln -fs ../Makefile $$dir/Makefile; \
163                 ln -fs ../Makefile.common $$dir/Makefile.common; \
164                 ln -fs ../config $$dir/config; \
165             done; \
166         done
167         echo Setup complete.
168
169 # Compile the clients.
170 ${COMPDIRS} ${INSTDIRS} ${DESTDIRS}:
171         if true; then \
172         for b in $(BITS); do \
173             for t in $(KOBJ); do \
174                 dir=$$t.$$b; \
175                 echo Building directory: $$dir; \
176                 case $$b in \
177                 32)     bopts="$(KDEFS_32)"; bsuff="";; \
178                 64)     bopts="$(KDEFS_64)"; bsuff="64";; \
179                 esac; \
180                 cd $$dir; \
181                 $(MAKE) BITSUFFIX=$$bsuff CPU_KDEFS="$$bopts" $@_libafs || exit $$?; \
182                 cd ..; \
183             done; \
184         done; \
185         fi
186
187 hpux_compdirs_libafs: depsrcs libafs
188 hpux_instdirs_libafs: install_libafs
189 hpux_destdirs_libafs: dest_libafs
190
191
192 # Below this line are targets when in the static directory:
193 <all -ia64_hpux1123>
194 LIBAFS = libafs$(BITSUFFIX).a
195 LIBAFSNONFS = libafs$(BITSUFFIX).nonfs.a
196 <ia64_hpux1123>
197 LIBAFS = afs$(BITSUFFIX)_nfs
198 LIBAFSNONFS =afs$(BITSUFFIX)
199 <all>
200
201 INST_LIBAFS = ${DESTDIR}${afskerneldir}/${LIBAFS}
202 INST_LIBAFSNONFS = ${DESTDIR}${afskerneldir}/${LIBAFSNONFS}
203
204 DEST_LIBAFS = ${DEST}/root.client/usr/bin/${LIBAFS}
205 DEST_LIBAFSNONFS = ${DEST}/root.client/usr/bin/${LIBAFSNONFS}
206
207
208 libafs: ${LIBAFSNONFS}
209 install_libafs: ${INST_LIBAFSNONFS}
210 dest_libafs: ${DEST_LIBAFSNONFS}
211
212 $(INST_LIBAFS): $(LIBAFS)
213         ${INSTALL} -f $? $@
214
215 $(INST_LIBAFSNONFS): $(LIBAFSNONFS)
216         ${INSTALL} -f $? $@
217
218 $(DEST_LIBAFS): $(LIBAFS)
219         ${INSTALL} -f $? $@
220
221 $(DEST_LIBAFSNONFS): $(LIBAFSNONFS)
222         ${INSTALL} -f $? $@
223
224 ${LIBAFS}: $(AFSAOBJS) $(AFSNFSOBJS)
225 <all -ia64_hpux1123>
226         $(AR) cru $@ $?
227         $(RANLIB) $@
228 <ia64_hpux1123>
229         $(MODLINK) -o $@ $(AFSAOBJS) $(AFSNFSOBJS)
230 <all>
231
232 ${LIBAFSNONFS}:  $(AFSAOBJS) $(AFSNONFSOBJS)
233 <all -ia64_hpux1123>
234         $(AR) cru $@ $?
235         $(RANLIB) $@
236 <ia64_hpux1123>
237         $(MODLINK) -o $@ $(AFSAOBJS) $(AFSNONFSOBJS)
238 <all>
239
240 <ia64_hpux1123>
241 hpux_mod.modmeta.c: $(TOP_SRCDIR)/afs/$(MKAFS_OSTYPE)/hpux_mod.modmeta
242         $(MODMETA) ${IDENTS_common} ${IDENTS_ipf} \
243                 -DAFSLIB_NAME=${LIBAFSNONFS} \
244                 $(TOP_SRCDIR)/afs/$(MKAFS_OSTYPE)/hpux_mod.modmeta > hpux_mod.modmeta.c
245
246 hpux_mod_nfs.modmeta.c: $(TOP_SRCDIR)/afs/$(MKAFS_OSTYPE)/hpux_mod.modmeta
247         $(MODMETA) ${IDENTS_common} ${IDENTS_ipf} \
248                 -DAFSLIB_NAME=${LIBAFS} \
249                 $(TOP_SRCDIR)/afs/$(MKAFS_OSTYPE)/hpux_mod.modmeta > hpux_mod_nfs.modmeta.c
250 <all>