amd64-linux-port-20030428
[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         osi_vfsops_nfs.o
25
26 AFS_OS_NONFSOBJS = \
27         osi_vfsops.o
28
29
30 # System specific build commands and flags
31 #
32 # Note: the online document
33 #
34 #       Developing Dynamically Loadable Kernel Modules
35 #       Issue 1.0
36 #       HP-UX 11.0
37 #       October 12, 1998
38 #
39 # mentioned on http://docs.hp.com/hpux/os/index.html
40 # with URL     http://docs.hp.com/hpux/content/dlkm_v1.2.pdf
41 #
42 # recommends the undocumented +ES1.Xindirect_calls option for both
43 # 32-bit and 64-bit kernel code, but it appears to be absolutely vital
44 # for compiling 64-bit kernel code.  In 64-bit mode, the ANSI C compiler
45 # has the +Z (PIC) option on by default, and there is no documented way
46 # to turn it off.  However, kernel code does not work properly when
47 # compiled with +Z (i.e. calling a function through a function pointer
48 # seems to hang).  When the compiler sees the +ES1.Xindirect_calls
49 # option, however, it issues a warning and turns off +Z.
50 #
51 <hp_ux110 hp_ux102 hp_ux11i>
52 KDEFS= +ES1.Xindirect_calls +XixdU +Hx0 +ESlit +ESsfc +ESssf -Wp,-H300000 -D_KERNEL -D_KERNEL_BUILD -D_UNSUPPORTED \
53         -DMP +R500 -Wl,+k $(CPU_KDEFS)
54 KDEFS_32 = +DA1.0 +DS1.0
55 # add +M2 to $(KDEFS_64) for 64-bit migration warnings
56 # warning 478: "+Z" and "+ES1.Xindirect_calls" are mutually exclusive. "+Z" ignored.
57 # warning 530: LP64 migration: Casting from loose to strict alignment: Resulting pointer may be misaligned.
58 KDEFS_64 = +DA2.0W +DS2.0 +M2 +W 478,530
59
60 <all>
61
62 <ia64_hpux1122>
63 KDEFS= +kernel -Wp,-H300000 -D_KERNEL -D_KERNEL_BUILD -D_UNSUPPORTED \
64   -DFINE_GRAINED_PROTO_FILES \
65   -DMP -Wl,+k $(CPU_KDEFS)
66 KDEFS_32 =
67 KDEFS_64 = +DD64
68
69 <all>
70
71 DEFINES= -DAFSDEBUG -DKERNEL -DAFS -DVICE -DNFS -DUFS -DINET -DQUOTA -DGETMOUNT -DHPONCPLUS
72 OPTF=${OPT} 
73 OPTF2=${OPT2} 
74 CFLAGS=-I. -I.. -I../h -I../nfs -I../conf -I${TOP_OBJDIR}/src/config ${FSINCLUDES} $(DEFINES) $(KDEFS) $(KOPTS) ${DBUG}
75
76 # Name of directory to hold object files and libraries.
77 KOBJ=STATIC
78
79 # This is the hpux multiple directory target.
80 COMPDIRS = hpux_compdirs
81 INSTDIRS = hpux_instdirs
82 DESTDIRS = hpux_destdirs
83
84 include Makefile.common
85
86 <hp_ux11i hp_ux110 hp_ux102>
87 BITS = 64 32
88 <ia64_hpux1122>
89 BITS = 64
90 <all>
91
92 setup:
93         -$(RM) -f  h conf net dux machine netinet nfs rpc s200 ufs sys
94 <hp_ux102>
95         ln -fs /usr/include/sys h
96 <hp_ux110 hp_ux11i ia64_hpux1122>
97         ln -fs /etc/conf/h h
98 <all>
99         ln -fs /etc/conf conf
100         ln -fs /etc/conf/net net
101         ln -fs /etc/conf/dux dux
102         ln -fs /etc/conf/machine machine
103         ln -fs /etc/conf/netinet netinet
104         ln -fs /etc/conf/nfs nfs
105         ln -fs /usr/include/rpc rpc
106         ln -fs /etc/conf/machine s200
107 <hp_ux11i hp_ux110 hp_ux102>
108         ln -fs /etc/conf/ufs ufs
109 <ia64_hpux1122>
110         ln -fs /etc/conf/sys ufs
111 <all>
112         ln -fs /usr/include/sys sys
113         for b in $(BITS); do \
114             for t in $(KOBJ); do \
115                 dir=$$t.$$b; \
116                 echo Making directory: $$dir; \
117                 mkdir -p $$dir; \
118                 $(RM) -f $$dir/Makefile $$dir/Makefile.common $$dir/config; \
119                 ln -fs ../Makefile $$dir/Makefile; \
120                 ln -fs ../Makefile.common $$dir/Makefile.common; \
121                 ln -fs ../config $$dir/config; \
122             done; \
123         done
124         echo Setup complete.
125
126 # Compile the clients.
127 ${COMPDIRS} ${INSTDIRS} ${DESTDIRS}:
128         if true; then \
129         for b in $(BITS); do \
130             for t in $(KOBJ); do \
131                 dir=$$t.$$b; \
132                 echo Building directory: $$dir; \
133                 case $$b in \
134                 32)     bopts="$(KDEFS_32)"; bsuff="";; \
135                 64)     bopts="$(KDEFS_64)"; bsuff="64";; \
136                 esac; \
137                 cd $$dir; \
138                 $(MAKE) BITSUFFIX=$$bsuff CPU_KDEFS="$$bopts" $@_libafs || exit $$?; \
139                 cd ..; \
140             done; \
141         done; \
142         fi
143
144 hpux_compdirs_libafs: depsrcs libafs
145 hpux_instdirs_libafs: install_libafs
146 hpux_destdirs_libafs: dest_libafs
147
148
149 # Below this line are targets when in the static directory:
150 LIBAFS = libafs$(BITSUFFIX).a
151 LIBAFSNONFS = libafs$(BITSUFFIX).nonfs.a
152
153 INST_LIBAFS = ${DESTDIR}${afskerneldir}/${LIBAFS}
154 INST_LIBAFSNONFS = ${DESTDIR}${afskerneldir}/${LIBAFSNONFS}
155
156 DEST_LIBAFS = ${DEST}/root.client/usr/bin/${LIBAFS}
157 DEST_LIBAFSNONFS = ${DEST}/root.client/usr/bin/${LIBAFSNONFS}
158
159
160 libafs: ${LIBAFSNONFS}
161 install_libafs: ${INST_LIBAFSNONFS}
162 dest_libafs: ${DEST_LIBAFSNONFS}
163
164 $(INST_LIBAFS): $(LIBAFS)
165         ${INSTALL} -f $? $@
166
167 $(INST_LIBAFSNONFS): $(LIBAFSNONFS)
168         ${INSTALL} -f $? $@
169
170 $(DEST_LIBAFS): $(LIBAFS)
171         ${INSTALL} -f $? $@
172
173 $(DEST_LIBAFSNONFS): $(LIBAFSNONFS)
174         ${INSTALL} -f $? $@
175
176 ${LIBAFS}: $(AFSAOBJS) $(AFSNFSOBJS)
177         $(AR) cru $@ $?
178         $(RANLIB) $@
179
180 ${LIBAFSNONFS}:  $(AFSAOBJS) $(AFSNONFSOBJS)
181         $(AR) cru $@ $?
182         $(RANLIB) $@