1 # Copyright 2000, International Business Machines Corporation and others.
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
9 include @TOP_OBJDIR@/src/config/Makefile.config
12 # OS specific object files:
25 hpux_mod_nfs.modmeta.o \
36 # System specific build commands and flags
38 # Note: the online document
40 # Developing Dynamically Loadable Kernel Modules
45 # mentioned on http://docs.hp.com/hpux/os/index.html
46 # with URL http://docs.hp.com/hpux/content/dlkm_v1.2.pdf
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.
57 # for 11.23, see the DDK BE/Sample_makefiles/Makefile.bld
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
72 KDEFS= +kernel -Wp,-H300000 -D_KERNEL -D_KERNEL_BUILD -D_UNSUPPORTED \
73 -DFINE_GRAINED_PROTO_FILES \
74 -DMP -Wl,+k $(CPU_KDEFS)
80 CCOPTS_common= -Ae +DD64 +O2
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__
88 # Definitions which apply to IPF only
90 CCOPTS_ipf= +DSitanium2 +kernel +objstatvars +Olit=all +Oshortdata=0 +W863
92 IDENTS_ipf= -DKERNEL_DEBUGGER -DVARIABLE_UAREA -D_SYSCALL_64 -D__NO_PA_HDRS
94 LDOPTS_ipf= +noobjdebug
96 # above from the Makefile.bld example
99 KDEFS= $(CCOPTS_common) $(IDENTS_common) $(CPU_KDEFS)
100 KDEFS_64= $(CCOPTS_ipf) $(IDENTS_ipf)
102 MODLINK=/opt/ddk/11.23/BE/bin/modlink
103 MODMETA=/opt/ddk/11.23/BE/bin/modmeta
107 DEFINES= -DAFSDEBUG -DKERNEL -DAFS -DVICE -DNFS -DUFS -DINET -DQUOTA -DGETMOUNT -DHPONCPLUS
110 CFLAGS=-I. -I.. -I../h -I../nfs -I../conf -I${TOP_OBJDIR}/src/config ${FSINCLUDES} $(DEFINES) $(KDEFS) $(KOPTS) ${DBUG}
112 # Name of directory to hold object files and libraries.
115 # This is the hpux multiple directory target.
116 COMPDIRS = hpux_compdirs
117 INSTDIRS = hpux_instdirs
118 DESTDIRS = hpux_destdirs
120 include Makefile.common
122 <hp_ux11i hp_ux110 hp_ux102>
124 <ia64_hpux1122 ia64_hpux1123>
129 -$(RM) -f h conf net dux machine netinet nfs rpc s200 ufs sys
131 ln -fs /usr/include/sys h
132 <hp_ux110 hp_ux11i ia64_hpux1122>
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
146 ln -fs /etc/conf/sys ufs
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
155 ln -fs /usr/include/sys sys
156 for b in $(BITS); do \
157 for t in $(KOBJ); do \
159 echo Making directory: $$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; \
169 # Compile the clients.
170 ${COMPDIRS} ${INSTDIRS} ${DESTDIRS}:
172 for b in $(BITS); do \
173 for t in $(KOBJ); do \
175 echo Building directory: $$dir; \
177 32) bopts="$(KDEFS_32)"; bsuff="";; \
178 64) bopts="$(KDEFS_64)"; bsuff="64";; \
181 $(MAKE) BITSUFFIX=$$bsuff CPU_KDEFS="$$bopts" $@_libafs || exit $$?; \
187 hpux_compdirs_libafs: depsrcs libafs
188 hpux_instdirs_libafs: install_libafs
189 hpux_destdirs_libafs: dest_libafs
192 # Below this line are targets when in the static directory:
194 LIBAFS = libafs$(BITSUFFIX).a
195 LIBAFSNONFS = libafs$(BITSUFFIX).nonfs.a
197 LIBAFS = afs$(BITSUFFIX)_nfs
198 LIBAFSNONFS =afs$(BITSUFFIX)
201 INST_LIBAFS = ${DESTDIR}${afskerneldir}/${LIBAFS}
202 INST_LIBAFSNONFS = ${DESTDIR}${afskerneldir}/${LIBAFSNONFS}
204 DEST_LIBAFS = ${DEST}/root.client/usr/bin/${LIBAFS}
205 DEST_LIBAFSNONFS = ${DEST}/root.client/usr/bin/${LIBAFSNONFS}
208 libafs: ${LIBAFSNONFS}
209 install_libafs: ${INST_LIBAFSNONFS}
210 dest_libafs: ${DEST_LIBAFSNONFS}
212 $(INST_LIBAFS): $(LIBAFS)
215 $(INST_LIBAFSNONFS): $(LIBAFSNONFS)
218 $(DEST_LIBAFS): $(LIBAFS)
221 $(DEST_LIBAFSNONFS): $(LIBAFSNONFS)
224 ${LIBAFS}: $(AFSAOBJS) $(AFSNFSOBJS)
229 $(MODLINK) -o $@ $(AFSAOBJS) $(AFSNFSOBJS)
232 ${LIBAFSNONFS}: $(AFSAOBJS) $(AFSNONFSOBJS)
237 $(MODLINK) -o $@ $(AFSAOBJS) $(AFSNONFSOBJS)
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
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