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