make-install-support-for-transarc-and-prefix-style-universes-20010907
[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 # MakefileProto for HP systems
9 #
10 DEST=@DEST@
11 TOP_INCDIR=@TOP_INCDIR@
12 TOP_LIBDIR=@TOP_LIBDIR@
13 TOP_SRCDIR=@TOP_SRCDIR@
14 prefix=@prefix@
15 exec_prefix=@exec_prefix@
16 bindir=@bindir@
17 sbindir=@sbindir@
18 libexecdir=@libexecdir@
19 libdir=@libdir@
20 includedir=@includedir@
21 mandir=@mandir@
22 afssrvbindir=@afssrvbindir@
23 afssrvsbindir=@afssrvsbindir@
24 afssrvlibexecdir=@afssrvlibexecdir@
25 afskerneldir=@afskerneldir@
26 SYS_NAME=@AFS_SYSNAME@
27
28 include config/Makefile.${SYS_NAME}
29
30 # OS specific object files:
31 AFS_OS_OBJS = \
32         osi_debug.o \
33         osi_groups.o \
34         osi_inode.o \
35         osi_file.o \
36         osi_misc.o \
37         osi_sleep.o \
38         osi_vnodeops.o \
39         osi_vm.o \
40         xdr_int64.o
41
42 AFS_OS_NFSOBJS = \
43         osi_vfsops_nfs.o
44
45 AFS_OS_NONFSOBJS = \
46         osi_vfsops.o
47
48
49 # System specific build commands and flags
50 #
51 # Note: the online document
52 #
53 #       Developing Dynamically Loadable Kernel Modules
54 #       Issue 1.0
55 #       HP-UX 11.0
56 #       October 12, 1998
57 #
58 # mentioned on http://docs.hp.com/hpux/os/index.html
59 # with URL     http://docs.hp.com/hpux/content/dlkm_v1.2.pdf
60 #
61 # recommends the undocumented +ES1.Xindirect_calls option for both
62 # 32-bit and 64-bit kernel code, but it appears to be absolutely vital
63 # for compiling 64-bit kernel code.  In 64-bit mode, the ANSI C compiler
64 # has the +Z (PIC) option on by default, and there is no documented way
65 # to turn it off.  However, kernel code does not work properly when
66 # compiled with +Z (i.e. calling a function through a function pointer
67 # seems to hang).  When the compiler sees the +ES1.Xindirect_calls
68 # option, however, it issues a warning and turns off +Z.
69 #
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 DEFINES= -DAFSDEBUG -DKERNEL -DAFS -DVICE -DNFS -DUFS -DINET -DQUOTA -DGETMOUNT -DHPONCPLUS
78 OPTF=${OPT} 
79 OPTF2=${OPT2} 
80 CFLAGS=-I. -I.. -I../h -I../nfs -I${TOP_SRCDIR}/config ${FSINCLUDES} $(DEFINES) $(KDEFS) $(KOPTS) ${DBUG}
81
82 # Name of directory to hold object files and libraries.
83 KOBJ=STATIC
84
85 # This tells Makefile.common to use its single directory build target.
86 #COMPDIRS = single_compdir
87 # This is the hpux multiple directory target.
88 COMPDIRS = hpux_compdirs
89 INSTDIRS = hpux_instdirs
90 DESTDIRS = hpux_destdirs
91
92 include Makefile.common
93
94 BITS = 64 32
95
96 setup:
97         -$(RM) -f  h net dux machine netinet nfs rpc s200 ufs sys
98         ln -s /usr/include/sys h
99         ln -s /etc/conf/net net
100         ln -s /etc/conf/dux dux
101         ln -s /etc/conf/machine machine
102         ln -s /etc/conf/netinet netinet
103         ln -s /etc/conf/nfs nfs
104         ln -s /usr/include/rpc rpc
105         ln -s /etc/conf/machine s200
106         ln -s /etc/conf/ufs ufs
107         ln -s /usr/include/sys sys
108         for b in $(BITS); do \
109             for t in $(KOBJ); do \
110                 dir=$$t.$$b; \
111                 echo Making directory: $$dir; \
112                 mkdir -p $$dir; \
113                 $(RM) -f $$dir/Makefile $$dir/Makefile.common $$dir/config; \
114                 ln -s ../Makefile $$dir/Makefile; \
115                 ln -s ../Makefile.common $$dir/Makefile.common; \
116                 ln -s ../config $$dir/config; \
117             done; \
118         done
119         echo Setup complete.
120
121 # Compile the clients.
122 ${COMPDIRS} ${INSTDIRS} ${DESTDIRS}:
123         if false; then \
124         for b in $(BITS); do \
125             for t in $(KOBJ); do \
126                 dir=$$t.$$b; \
127                 echo Building directory: $$dir; \
128                 case $$b in \
129                 32)     bopts="$(KDEFS_32)"; bsuff="";; \
130                 64)     bopts="$(KDEFS_64)"; bsuff="64";; \
131                 esac; \
132                 cd $$dir; \
133                 $(MAKE) BITSUFFIX=$$bsuff CPU_KDEFS="$$bopts" $@_libafs || exit $$?; \
134                 cd ..; \
135             done; \
136         done; \
137         fi
138
139 hpux_compdirs_libafs: libafs
140 hpux_instdirs_libafs: install_libafs
141 hpux_destdirs_libafs: dest_libafs
142
143
144 # Below this line are targets when in the static directory:
145 LIBAFS = libafs$(BITSUFFIX).a
146 LIBAFSNONFS = libafs$(BITSUFFIX).nonfs.a
147
148 INST_LIBAFS = ${DESTDIR}${afskerneldir}/${LIBAFS}
149 INST_LIBAFSNONFS = ${DESTDIR}${afskerneldir}/${LIBAFSNONFS}
150
151 DEST_LIBAFS = ${DEST}/root.client/bin/${LIBAFS}
152 DEST_LIBAFSNONFS = ${DEST}/root.client/bin/${LIBAFSNONFS}
153
154
155 libafs: ${LIBAFSNONFS}
156 install_libafs: ${INST_LIBAFSNONFS}
157 dest_libafs: ${DEST_LIBAFSNONFS}
158
159 $(INST_LIBAFS): $(LIBAFS)
160         ${INSTALL} -f $? $@
161
162 $(INST_LIBAFSNONFS): $(LIBAFSNONFS)
163         ${INSTALL} -f $? $@
164
165 $(DEST_LIBAFS): $(LIBAFS)
166         ${INSTALL} -f $? $@
167
168 $(DEST_LIBAFSNONFS): $(LIBAFSNONFS)
169         ${INSTALL} -f $? $@
170
171 ${LIBAFS}: $(AFSAOBJS) $(AFSNFSOBJS)
172         $(AR) cru $@ $?
173         $(RANLIB) $@
174
175 ${LIBAFSNONFS}:  $(AFSAOBJS) $(AFSNONFSOBJS)
176         $(AR) cru $@ $?
177         $(RANLIB) $@
178
179
180 # HP specific objects
181 osi_groups.o: $(AFS)/osi_groups.c
182         $(CRULE1)
183 osi_inode.o: $(AFS)/osi_inode.c
184         $(CRULE1)
185 osi_file.o: $(AFS)/osi_file.c
186         $(CRULE1)
187 osi_misc.o: $(AFS)/osi_misc.c
188         $(CRULE1)
189 osi_sleep.o: $(AFS)/osi_sleep.c
190         $(CRULE1)
191 osi_vfsops_nfs.o: $(AFS)/osi_vfsops.c
192         $(CRULE1) -o osi_vfsops_nfs.o
193 osi_vfsops.o: $(AFS)/osi_vfsops.c
194         $(CRULE1) -DAFS_NONFSTRANS
195 osi_vm.o: $(AFS)/osi_vm.c
196         $(CRULE1)
197 osi_vnodeops.o: $(AFS)/osi_vnodeops.c
198         $(CRULE1)
199 xdr_int64.o: $(RX)/xdr_int64.c
200         $(CRULE1)
201
202 # This is a list of header files compiled with the -g option. It allows
203 # examination of AFS structures in a dump.
204 osi_debug.o: $(AFS)/osi_debug.c
205         $(CRULE4)
206