1adb4d5de6a5dca03ed48fee7a2d2ad035f85980
[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 KDEFS= +ES1.Xindirect_calls +XixdU +Hx0 +ESlit +ESsfc +ESssf -Wp,-H300000 -D_KERNEL -D_KERNEL_BUILD -D_UNSUPPORTED \
52         -DMP +R500 -Wl,+k $(CPU_KDEFS)
53 KDEFS_32 = +DA1.0 +DS1.0
54 # add +M2 to $(KDEFS_64) for 64-bit migration warnings
55 # warning 478: "+Z" and "+ES1.Xindirect_calls" are mutually exclusive. "+Z" ignored.
56 # warning 530: LP64 migration: Casting from loose to strict alignment: Resulting pointer may be misaligned.
57 KDEFS_64 = +DA2.0W +DS2.0 +M2 +W 478,530
58 DEFINES= -DAFSDEBUG -DKERNEL -DAFS -DVICE -DNFS -DUFS -DINET -DQUOTA -DGETMOUNT -DHPONCPLUS
59 OPTF=${OPT} 
60 OPTF2=${OPT2} 
61 CFLAGS=-I. -I.. -I../h -I../nfs -I../conf -I${TOP_OBJDIR}/src/config ${FSINCLUDES} $(DEFINES) $(KDEFS) $(KOPTS) ${DBUG}
62
63 # Name of directory to hold object files and libraries.
64 KOBJ=STATIC
65
66 # This is the hpux multiple directory target.
67 COMPDIRS = hpux_compdirs
68 INSTDIRS = hpux_instdirs
69 DESTDIRS = hpux_destdirs
70
71 include Makefile.common
72
73 BITS = 64 32
74
75 setup:
76         -$(RM) -f  h conf net dux machine netinet nfs rpc s200 ufs sys
77         ln -fs /usr/include/sys h
78         ln -fs /etc/conf conf
79         ln -fs /etc/conf/net net
80         ln -fs /etc/conf/dux dux
81         ln -fs /etc/conf/machine machine
82         ln -fs /etc/conf/netinet netinet
83         ln -fs /etc/conf/nfs nfs
84         ln -fs /usr/include/rpc rpc
85         ln -fs /etc/conf/machine s200
86         ln -fs /etc/conf/ufs ufs
87         ln -fs /usr/include/sys sys
88         for b in $(BITS); do \
89             for t in $(KOBJ); do \
90                 dir=$$t.$$b; \
91                 echo Making directory: $$dir; \
92                 mkdir -p $$dir; \
93                 $(RM) -f $$dir/Makefile $$dir/Makefile.common $$dir/config; \
94                 ln -fs ../Makefile $$dir/Makefile; \
95                 ln -fs ../Makefile.common $$dir/Makefile.common; \
96                 ln -fs ../config $$dir/config; \
97             done; \
98         done
99         echo Setup complete.
100
101 # Compile the clients.
102 ${COMPDIRS} ${INSTDIRS} ${DESTDIRS}:
103         if true; then \
104         for b in $(BITS); do \
105             for t in $(KOBJ); do \
106                 dir=$$t.$$b; \
107                 echo Building directory: $$dir; \
108                 case $$b in \
109                 32)     bopts="$(KDEFS_32)"; bsuff="";; \
110                 64)     bopts="$(KDEFS_64)"; bsuff="64";; \
111                 esac; \
112                 cd $$dir; \
113                 $(MAKE) BITSUFFIX=$$bsuff CPU_KDEFS="$$bopts" $@_libafs || exit $$?; \
114                 cd ..; \
115             done; \
116         done; \
117         fi
118
119 hpux_compdirs_libafs: depsrcs libafs
120 hpux_instdirs_libafs: install_libafs
121 hpux_destdirs_libafs: dest_libafs
122
123
124 # Below this line are targets when in the static directory:
125 LIBAFS = libafs$(BITSUFFIX).a
126 LIBAFSNONFS = libafs$(BITSUFFIX).nonfs.a
127
128 INST_LIBAFS = ${DESTDIR}${afskerneldir}/${LIBAFS}
129 INST_LIBAFSNONFS = ${DESTDIR}${afskerneldir}/${LIBAFSNONFS}
130
131 DEST_LIBAFS = ${DEST}/root.client/usr/bin/${LIBAFS}
132 DEST_LIBAFSNONFS = ${DEST}/root.client/usr/bin/${LIBAFSNONFS}
133
134
135 libafs: ${LIBAFSNONFS}
136 install_libafs: ${INST_LIBAFSNONFS}
137 dest_libafs: ${DEST_LIBAFSNONFS}
138
139 $(INST_LIBAFS): $(LIBAFS)
140         ${INSTALL} -f $? $@
141
142 $(INST_LIBAFSNONFS): $(LIBAFSNONFS)
143         ${INSTALL} -f $? $@
144
145 $(DEST_LIBAFS): $(LIBAFS)
146         ${INSTALL} -f $? $@
147
148 $(DEST_LIBAFSNONFS): $(LIBAFSNONFS)
149         ${INSTALL} -f $? $@
150
151 ${LIBAFS}: $(AFSAOBJS) $(AFSNFSOBJS)
152         $(AR) cru $@ $?
153         $(RANLIB) $@
154
155 ${LIBAFSNONFS}:  $(AFSAOBJS) $(AFSNONFSOBJS)
156         $(AR) cru $@ $?
157         $(RANLIB) $@