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