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