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