60419b430a162ee1171ad9687e4e7cbc812bc27c
[openafs.git] / src / libafs / MakefileProto.OBSD.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 # OpenBSD version by Jim Rees
9
10 srcdir=@srcdir@
11 include @TOP_OBJDIR@/src/config/Makefile.config
12 INSTALL = @INSTALL@
13 INSTALL_DATA = @INSTALL_DATA@
14 INSTALL_PROGRAM = @INSTALL_PROGRAM@
15 INSTALL_SCRIPT = @INSTALL_SCRIPT@
16
17 # System specific build commands and flags
18 KSRC = @BSD_KERNEL_PATH@
19 KFLAGS= -Wall -march=i486 -fno-builtin-printf -fno-builtin-log -nostdinc
20 <i386_obsd33>
21 KFLAGS+= -fno-stack-protector
22 <all>
23 KDEFS= \
24     ${KFLAGS} \
25     -I/usr/include -I${KSRC}/sys \
26     -DLKM -DDIAGNOSTIC -DFIFO -DNFSCLIENT -DMFS -DFFS -D_KERNEL -DI586_CPU \
27     -DI686_CPU
28 DBUG= -O2
29 DEFINES= -DAFSDEBUG -DKERNEL -DAFS -DVICE -DNFS -DUFS -DINET -DQUOTA -DGETMOUNT
30 OPTF= ${OPT}
31 OPTF2= ${OPT2}
32 CFLAGS= ${FSINCLUDES} ${DEFINES} ${KDEFS} ${KOPTS} ${DBUG}
33
34 # Name of directory to hold object files and libraries.
35 KOBJ = MODLOAD
36
37 # OS specific object files:
38 AFS_OS_OBJS = \
39         osi_gcpags.o \
40         osi_groups.o \
41         osi_file.o \
42         osi_misc.o \
43         osi_sleep.o \
44         osi_vm.o \
45         osi_vnodeops.o
46
47 #AFS_OS_NFSOBJS = osi_vfsops_nfs.o
48
49 AFS_OS_NONFSOBJS = osi_vfsops.o
50
51 # This tells Makefile.common to use its single directory build target.
52 COMPDIRS = single_compdir
53 INSTDIRS = single_instdir
54 DESTDIRS = single_destdir
55
56 TOP_SRCDIR = ../..
57
58 include Makefile.common
59
60 COMMON_INCLUDE = \
61         -I.. \
62         -I../nfs \
63         -I${TOP_SRCDIR} \
64         -I${TOP_SRCDIR}/afs \
65         -I${TOP_SRCDIR}/afs/${MKAFS_OSTYPE} \
66         -I${TOP_SRCDIR}/config \
67         -I${TOP_SRCDIR}/rx \
68         -I${TOP_SRCDIR}/rx/${MKAFS_OSTYPE} \
69         -I${TOP_SRCDIR}/rxkad \
70         -I${TOP_SRCDIR}/domestic \
71         -I${TOP_SRCDIR}/util \
72         -I${TOP_SRCDIR}/../include \
73         -I${TOP_SRCDIR}/../include/afs
74
75 setup:
76         -mkdir $(KOBJ)
77         -$(RM) -f  $(KOBJ)/Makefile $(KOBJ)/Makefile.common $(KOBJ)/config
78         ln -fs ../Makefile $(KOBJ)/Makefile
79         ln -fs ../Makefile.common $(KOBJ)/Makefile.common
80         -$(RM) -f  h lib
81         -ln -fs ${KSRC}/sys h
82         -ln -fs ${KSRC}/lib .
83         -touch $(KOBJ)/sec_net.h
84
85
86 # Below this line are targets when in the COMMON directory:
87 LIBAFS = libafs.nfs.o
88 LIBAFSNONFS = libafs.o
89
90 INST_LIBAFS = ${DESTDIR}${afskerneldir}/${LIBAFS}
91 INST_LIBAFSNONFS = ${DESTDIR}${afskerneldir}/${LIBAFSNONFS}
92
93 DEST_LIBAFS = ${DEST}/root.client/bin/${LIBAFS}
94 DEST_LIBAFSNONFS = ${DEST}/root.client/bin/${LIBAFSNONFS}
95
96
97 libafs: $(LIBAFSNONFS)
98         ls -l libafs.o
99
100 install_libafs: $(LIBAFS)
101         ${INSTALL} -d ${DESTDIR}${afskerneldir}
102         ${INSTALL} -m 644 $(LIBAFS) $(INST_LIBAFSNONFS)
103
104 dest_libafs: $(LIBAFS)
105         ${INSTALL} -d ${DEST}/root.client/bin
106         $(INSTALL) -m 644 $(LIBAFS) $(DEST_LIBAFSNONFS)
107
108 ${LIBAFS}: $(AFSAOBJS) $(AFSNFSOBJS)
109         $(LD) -r -o ${LIBAFS} ${AFSAOBJS} ${AFSNFSOBJS}
110
111 ${LIBAFSNONFS}:  $(AFSAOBJS) $(AFSNONFSOBJS)
112         $(LD) -r -o ${LIBAFSNONFS} ${AFSAOBJS} ${AFSNONFSOBJS}