death-to-pinstall-20060801
[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 hp_ux1123>
25         hpux_mod_nfs.modmeta.o \
26 <all>
27         osi_vfsops_nfs.o
28
29 AFS_OS_NONFSOBJS = \
30 <ia64_hpux1123 hp_ux1123>
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 # 11.23 uses new compiler, with new options. The same compiler is on pa_risc and ia64 
61 #
62 <hp_ux110 hp_ux102 hp_ux11i>
63 KDEFS= +ES1.Xindirect_calls +XixdU +Hx0 +ESlit +ESsfc +ESssf -Wp,-H300000 -D_KERNEL -D_KERNEL_BUILD -D_UNSUPPORTED \
64         -DMP +R500 -Wl,+k $(CPU_KDEFS)
65 KDEFS_32 = +DA1.0 +DS1.0
66 # add +M2 to $(KDEFS_64) for 64-bit migration warnings
67 # warning 478: "+Z" and "+ES1.Xindirect_calls" are mutually exclusive. "+Z" ignored.
68 # warning 530: LP64 migration: Casting from loose to strict alignment: Resulting pointer may be misaligned.
69 KDEFS_64 = +DA2.0W +DS2.0 +M2 +W 478,530
70
71 <all>
72
73 <ia64_hpux1122>
74 KDEFS= +kernel -Wp,-H300000 -D_KERNEL -D_KERNEL_BUILD -D_UNSUPPORTED \
75   -DFINE_GRAINED_PROTO_FILES \
76   -DMP -Wl,+k $(CPU_KDEFS)
77 KDEFS_32 =
78 KDEFS_64 = +DD64
79
80 <ia64_hpux1123>
81 ARCH=ipf
82
83 <hp_ux1123>
84 ARCH=pa
85
86 <ia64_hpux1123 hp_ux1123>
87
88 CCOPTS_common= -Ae +DD64 +O2
89
90 IDENTS_common= -DACLS -DAUDIT -DHPONCPLUS -DIDDS -DIPSEC -DIVT_INTERCEPT \
91     -DLWSYSCALL -DPGPROF -DSTCP -D_CLEAN_BE -D_HPUX_SOURCE -D_KERNEL \
92     -D_LARGEFILE64_SOURCE -D_NO_USER_PROTOS -D_UNSUPPORTED \
93     -D__BIGMSGQUEUE_ENABLED -D__ROSE__ -U__hp9000s700 \
94     -D_XPG4_EXTENDED -D__STDC_EXT__
95
96 # Definitions which apply to IPF only
97
98 CCOPTS_ipf= +DSitanium2 +kernel +objstatvars +Olit=all +Oshortdata=0 +W863
99
100 IDENTS_ipf= -DKERNEL_DEBUGGER -DVARIABLE_UAREA -D_SYSCALL_64 -D__NO_PA_HDRS
101
102 LDOPTS_ipf= +noobjdebug
103
104 # Definitions which apply to PA only
105
106 CCOPTS_pa= +DS2.0 +ES1.Xindirect_calls +ESlit +ESsfc +ESssf \
107         +ordering_unaware +Oentrysched +Ofastaccess +Omultiprocessor \
108         -Wp,-H300000 +Xid
109
110 IDENTS_pa= -DCOMB_FLIPPER -DKGDB_ON -DLP64_TMP_NODBG -DNEW_MFCTL_W \
111         -DNEW_RDB -DPARISC -DRDB -DSPP_OBP_BOOT -DSPP_RUNWAY_ERR_ENABLED \
112         -D__NO_EM_HDRS -D__ROSEVILLE__ -D__TEMP64__ -D__hp9000s800
113
114 LDOPTS_pa=
115
116
117 # above from the Makefile.bld example
118
119 LDOPTS= ${LDOPTS_${ARCH}}
120 KDEFS= $(CCOPTS_common) $(IDENTS_common) $(CPU_KDEFS) 
121 KDEFS_64= ${CCOPTS_${ARCH}} ${IDENTS_${ARCH}}
122
123 MODLINK=/opt/ddk/11.23/BE/bin/modlink
124 MODMETA=/opt/ddk/11.23/BE/bin/modmeta
125
126 <all>
127
128 DEFINES= -DAFSDEBUG -DKERNEL -DAFS -DVICE -DNFS -DUFS -DINET -DQUOTA -DGETMOUNT -DHPONCPLUS
129 OPTF=${OPT} 
130 OPTF2=${OPT2} 
131 CFLAGS=-I. -I.. -I../h -I../nfs -I../conf -I${TOP_OBJDIR}/src/config ${FSINCLUDES} $(DEFINES) $(KDEFS) $(KOPTS) ${DBUG}
132
133 # Name of directory to hold object files and libraries.
134 KOBJ=STATIC
135
136 # This is the hpux multiple directory target.
137 COMPDIRS = hpux_compdirs
138 INSTDIRS = hpux_instdirs
139 DESTDIRS = hpux_destdirs
140
141 include Makefile.common
142
143 <hp_ux11i hp_ux110 hp_ux102>
144 BITS = 64 32
145 <ia64_hpux1122 ia64_hpux1123 hp_ux1123>
146 BITS = 64
147 <all>
148
149 setup:
150         -$(RM) -f  h conf net dux machine netinet nfs rpc s200 ufs sys
151 <hp_ux102>
152         ln -fs /usr/include/sys h
153 <hp_ux110 hp_ux11i ia64_hpux1122>
154         ln -fs /etc/conf/h h
155 <hp_ux102 hp_ux110 hp_ux11i ia64_hpux1122>
156         ln -fs /etc/conf conf
157         ln -fs /etc/conf/net net
158         ln -fs /etc/conf/dux dux
159         ln -fs /etc/conf/machine machine
160         ln -fs /etc/conf/netinet netinet
161         ln -fs /etc/conf/nfs nfs
162         ln -fs /usr/include/rpc rpc
163         ln -fs /etc/conf/machine s200
164 <hp_ux11i hp_ux110 hp_ux102>
165         ln -fs /etc/conf/ufs ufs
166 <ia64_hpux1122>
167         ln -fs /etc/conf/sys ufs
168 <ia64_hpux1123 hp_ux1123>
169         ln -fs /usr/include/sys h
170         ln -fs /usr/include/net net
171         ln -fs /usr/include/netinet netinet
172         ln -fs /usr/include/nfs nfs
173         ln -fs /usr/include/rpc rpc
174         ln -fs /usr/include/sys ufs
175 <all>
176         ln -fs /usr/include/sys sys
177         for b in $(BITS); do \
178             for t in $(KOBJ); do \
179                 dir=$$t.$$b; \
180                 echo Making directory: $$dir; \
181                 mkdir -p $$dir; \
182                 $(RM) -f $$dir/Makefile $$dir/Makefile.common $$dir/config; \
183                 ln -fs ../Makefile $$dir/Makefile; \
184                 ln -fs ../Makefile.common $$dir/Makefile.common; \
185                 ln -fs ../config $$dir/config; \
186             done; \
187         done
188         echo Setup complete.
189
190 # Compile the clients.
191 ${COMPDIRS} ${INSTDIRS} ${DESTDIRS}:
192         if true; then \
193         for b in $(BITS); do \
194             for t in $(KOBJ); do \
195                 dir=$$t.$$b; \
196                 echo Building directory: $$dir; \
197                 case $$b in \
198                 32)     bopts="$(KDEFS_32)"; bsuff="";; \
199                 64)     bopts="$(KDEFS_64)"; bsuff="64";; \
200                 esac; \
201                 cd $$dir; \
202                 $(MAKE) BITSUFFIX=$$bsuff CPU_KDEFS="$$bopts" $@_libafs || exit $$?; \
203                 cd ..; \
204             done; \
205         done; \
206         fi
207
208 hpux_compdirs_libafs: depsrcs libafs
209 hpux_instdirs_libafs: install_libafs
210 hpux_destdirs_libafs: dest_libafs
211
212
213 # Below this line are targets when in the static directory:
214 <all -ia64_hpux1123 -hp_ux1123>
215 LIBAFS = libafs$(BITSUFFIX).a
216 LIBAFSNONFS = libafs$(BITSUFFIX).nonfs.a
217 <ia64_hpux1123 hp_ux1123>
218 LIBAFS = afs$(BITSUFFIX)_nfs
219 LIBAFSNONFS =afs$(BITSUFFIX)
220 <all>
221
222 INST_LIBAFS = ${DESTDIR}${afskerneldir}/${LIBAFS}
223 INST_LIBAFSNONFS = ${DESTDIR}${afskerneldir}/${LIBAFSNONFS}
224
225 DEST_LIBAFS = ${DEST}/root.client/usr/bin/${LIBAFS}
226 DEST_LIBAFSNONFS = ${DEST}/root.client/usr/bin/${LIBAFSNONFS}
227
228
229 libafs: ${LIBAFSNONFS}
230
231 install_libafs: $(LIBAFSNONFS)
232         ${INSTALL} -d ${DESTDIR}${afskerneldir}
233         ${INSTALL} -m 644 $(LIBAFSNONFS) $(INST_LIBAFSNONFS)
234
235 dest_libafs: $(LIBAFSNONFS)
236         ${INSTALL} -d ${DEST}/root.client/usr/bin
237         ${INSTALL} -m 644 $(LIBAFSNONFS) $(DEST_LIBAFSNONFS)
238
239 ${LIBAFS}: $(AFSAOBJS) $(AFSNFSOBJS)
240 <all -ia64_hpux1123 -hp_ux1123>
241         $(AR) cru $@ $?
242         $(RANLIB) $@
243 <ia64_hpux1123 hp_ux1123>
244         $(MODLINK) -o $@ $(AFSAOBJS) $(AFSNFSOBJS)
245 <all>
246
247 ${LIBAFSNONFS}:  $(AFSAOBJS) $(AFSNONFSOBJS)
248 <all -ia64_hpux1123 -hp_ux1123>
249         $(AR) cru $@ $?
250         $(RANLIB) $@
251 <ia64_hpux1123 hp_ux1123>
252         $(MODLINK) -o $@ $(AFSAOBJS) $(AFSNONFSOBJS)
253 <all>
254
255 <ia64_hpux1123 hp_ux1123>
256 hpux_mod.modmeta.c: $(TOP_SRCDIR)/afs/$(MKAFS_OSTYPE)/hpux_mod.modmeta
257         $(MODMETA) ${IDENTS_common} ${IDENTS_ipf} \
258                 -DAFSLIB_NAME=${LIBAFSNONFS} \
259                 $(TOP_SRCDIR)/afs/$(MKAFS_OSTYPE)/hpux_mod.modmeta > hpux_mod.modmeta.c
260
261 hpux_mod_nfs.modmeta.c: $(TOP_SRCDIR)/afs/$(MKAFS_OSTYPE)/hpux_mod.modmeta
262         $(MODMETA) ${IDENTS_common} ${IDENTS_ipf} \
263                 -DAFSLIB_NAME=${LIBAFS} \
264                 $(TOP_SRCDIR)/afs/$(MKAFS_OSTYPE)/hpux_mod.modmeta > hpux_mod_nfs.modmeta.c
265 <all>