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