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