1 # Copyright 2000, International Business Machines Corporation and others.
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
9 include @TOP_OBJDIR@/src/config/Makefile.config
11 INSTALL_DATA = @INSTALL_DATA@
12 INSTALL_PROGRAM = @INSTALL_PROGRAM@
13 INSTALL_SCRIPT = @INSTALL_SCRIPT@
16 # OS specific object files:
36 # System specific build commands and flags
37 KSRC = @BSD_KERNEL_PATH@
38 KBLD = @BSD_KERNEL_BUILD@
39 <amd64_fbsd_70 amd64_fbsd_71 amd64_fbsd_80 amd64_fbsd_81 amd64_fbsd_90>
42 KOPTS += -mno-red-zone
45 KDEFS=-Wall -nostdinc -I/usr/include -D_KERNEL -DKLD_MODULE \
48 -mno-mmx -mno-3dnow -mno-sse -mno-sse2 \
50 -mno-align-long-strings -fno-common -ffreestanding \
51 -I${KBLD} -include opt_global.h -fno-strict-aliasing
55 DEFINES= -DAFSDEBUG -DKERNEL -DAFS -DVICE -DNFS -DUFS -DINET -DQUOTA -DGETMOUNT
56 CFLAGS=-I. -I.. -I${TOP_OBJDIR}/src/config ${FSINCLUDES} $(DEFINES) $(KDEFS) $(KOPTS) ${DBUG}
59 # Name of directory to hold object files and libraries.
62 # This tells Makefile.common to use it's single directory build target.
63 COMPDIRS = single_compdir
64 INSTDIRS = single_instdir
65 DESTDIRS = single_destdir
67 include Makefile.common
71 -$(RM) $(KOBJ)/Makefile $(KOBJ)/Makefile.common
72 ln -fs ../Makefile $(KOBJ)/Makefile
73 ln -fs ../Makefile.common $(KOBJ)/Makefile.common
74 -$(RM) -f h net netinet rpc ufs nfs machine sys vm
75 -ln -fs ${KSRC}/net net
76 -ln -fs ${KSRC}/@HOST_CPU@/include machine
77 -ln -fs ${KSRC}/netinet netinet
78 -ln -fs ${KSRC}/nfs nfs
79 <all -fbsd_71 -fbsd_80 -fbsd_81 -fbsd_90>
80 -ln -fs /usr/include/rpc rpc
81 <fbsd_71 fbsd_80 fbsd_81 fbsd_90>
82 -ln -fs ${KSRC}/rpc rpc
84 -ln -fs ${KSRC}/sys sys
85 -ln -fs ${KSRC}/ufs/ufs ufs
88 -touch $(KOBJ)/sec_net.h
93 # Below this line are targets when in the COMMON directory:
95 LIBAFSNONFS = libafs.ko
97 INST_LIBAFS = ${DESTDIR}${afskerneldir}/${LIBAFS}
98 INST_LIBAFSNONFS = ${DESTDIR}${afskerneldir}/${LIBAFSNONFS}
100 DEST_LIBAFS = ${DEST}/root.client/bin/${LIBAFS}
101 DEST_LIBAFSNONFS = ${DEST}/root.client/bin/${LIBAFSNONFS}
104 # Without this line, gmake tries to build libafs
107 # libafs: $(LIBAFS) $(LIBAFSNONFS)
108 libafs: $(LIBAFSNONFS)
110 install_libafs: $(LIBAFSNONFS)
111 ${INSTALL} -d ${DESTDIR}${afskerneldir}
112 ${INSTALL} -m 644 $(LIBAFSNONFS) $(INST_LIBAFSNONFS)
114 dest_libafs: $(LIBAFSNONFS)
115 ${INSTALL} -d ${DEST}/root.client/bin
116 ${INSTALL} -m 644 $(LIBAFSNONFS) $(DEST_LIBAFSNONFS)
118 ${LIBAFS}: $(AFSAOBJS) $(AFSNFSOBJS)
119 $(LD) -r -o ${LIBAFS}.kld ${AFSAOBJS} ${AFSNFSOBJS}
120 gensetdefs ${LIBAFS}.kld
121 $(MAKE) setdef0.o setdef1.o
122 $(LD) -Bshareable -o ${LIBAFS} setdef0.o ${LIBAFS}.kld setdef1.o
124 ${LIBAFSNONFS}: $(AFSAOBJS) $(AFSNONFSOBJS)
125 $(LD) -r -d -warn-common -o libafs.kld ${AFSAOBJS} ${AFSNONFSOBJS}
127 awk -f ${KSRC}/conf/kmod_syms.awk libafs.kld export_syms | xargs -J% objcopy % libafs.kld
128 $(LD) -Bshareable -d -warn-common -o ${LIBAFSNONFS} libafs.kld
131 # Object build rules:
137 # vnode_if.h build rules:
138 vnode_if.h: ${KSRC}/kern/vnode_if.src
139 awk -f ${KSRC}/tools/vnode_if.awk ${KSRC}/kern/vnode_if.src -h
140 awk -f ${KSRC}/tools/vnode_if.awk ${KSRC}/kern/vnode_if.src -q
141 awk -f ${KSRC}/tools/vnode_if.awk ${KSRC}/kern/vnode_if.src -p