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