initial-objdir-support-20011017
[openafs.git] / src / libafs / MakefileProto.FBSD.in
1 #/* Copyright (C) 1995, 1989 Transarc Corporation - All rights reserved */
2 #
3 # MakefileProto for FreeBSD systems
4 #
5 DEST=@DEST@
6 TOP_INCDIR=@TOP_INCDIR@
7 TOP_LIBDIR=@TOP_LIBDIR@
8 TOP_SRCDIR=@TOP_SRCDIR@
9 TOP_OBJDIR=@TOP_OBJDIR@
10 srcdir=@srcdir@
11 VPATH=${srcdir}
12 prefix=@prefix@
13 exec_prefix=@exec_prefix@
14 bindir=@bindir@
15 sbindir=@sbindir@
16 libexecdir=@libexecdir@
17 libdir=@libdir@
18 includedir=@includedir@
19 mandir=@mandir@
20 afssrvbindir=@afssrvbindir@
21 afssrvsbindir=@afssrvsbindir@
22 afssrvlibexecdir=@afssrvlibexecdir@
23 afskerneldir=@afskerneldir@
24 SYS_NAME=@AFS_SYSNAME@
25
26 # include config/Makefile.${SYS_NAME}
27
28 # OS specific object files:
29 AFS_OS_OBJS = \
30         osi_groups.o \
31         osi_file.o \
32         osi_inode.o \
33         osi_misc.o \
34         osi_sleep.o \
35         osi_vm.o \
36         osi_vnodeops.o \
37         xdr_int64.o
38
39 AFS_OS_NFSOBJS = \
40         osi_vfsops_nfs.o
41
42 AFS_OS_NONFSOBJS = \
43         osi_vfsops.o
44
45
46 # System specific build commands and flags
47 # KDEFS=-DLANGUAGE_C  -I/usr/sys/include -I../include \
48 #        -I/usr/src/sys/${HEADER_RT} -I/usr/src/sys/sys \
49 #       -DSWAPTYPE=1 -DUERF -DOSF -DCOMPAT_43 -DUFS \
50 #       -DRT -DKERNEL -D_KERNEL
51 KDEFS=-Wall -fformat-extensions -ansi -nostdinc -I/usr/include -D_KERNEL \
52         -elf -mpreferred-stack-boundary=2 -I/usr/src/sys/sys -I../afs
53 DBUG = -O2
54 DEFINES= -DAFSDEBUG -DKERNEL -DAFS -DVICE -DNFS -DUFS -DINET -DQUOTA -DGETMOUNT
55 OPTF=${OPT} 
56 OPTF2=${OPT2} 
57 CFLAGS=-I. -I.. -I${TOP_OBJDIR}/src/config ${FSINCLUDES} $(DEFINES) $(KDEFS) $(KOPTS) ${DBUG}
58
59
60 # Name of directory to hold object files and libraries.
61 KOBJ = STATIC
62
63 # This tells Makefile.common to use it's single directory build target.
64 COMPDIRS = single_compdir
65 INSTDIRS = single_instdir
66 DESTDIRS = single_destdir
67
68 include Makefile.common
69
70 setup:
71         -mkdir $(KOBJ)
72         -$(RM) $(KOBJ)/Makefile $(KOBJ)/Makefile.common $(KOBJ)/config
73         ln -s ../Makefile $(KOBJ)/Makefile
74         ln -s ../Makefile.common $(KOBJ)/Makefile.common
75         ln -s ../config $(KOBJ)/config
76         -$(RM) -f  h net netinet rpc ufs nfs  machine sys vm
77         -ln -s /usr/src/sys/net net
78         -ln -s /usr/src/sys/i386/include machine
79         -ln -s /usr/src/sys/netinet netinet
80         -ln -s /usr/src/sys/nfs nfs
81         -ln -s /usr/include/rpc rpc
82         -ln -s /usr/src/sys/sys sys
83         -ln -s /usr/src/sys/ufs/ufs ufs
84         -ln -s /usr/src/sys/sys h
85         -ln -s /usr/src/sys/vm vm
86         -touch $(KOBJ)/sec_net.h
87
88
89 # Below this line are targets when in the COMMON directory:
90 LIBAFS = libafs.o
91 LIBAFSNONFS = libafs.nonfs.o
92
93 INST_LIBAFS = ${DESTDIR}${afskerneldir}/${LIBAFS}
94 INST_LIBAFSNONFS = ${DESTDIR}${afskerneldir}/${LIBAFSNONFS}
95
96 DEST_LIBAFS = ${DEST}/root.client/bin/${LIBAFS}
97 DEST_LIBAFSNONFS = ${DEST}/root.client/bin/${LIBAFSNONFS}
98
99
100 # libafs:       $(LIBAFS) $(LIBAFSNONFS)
101 # libafs:       $(LIBAFSNONFS)
102 # install_libafs:       $(INST_LIBAFS) $(INST_LIBAFSNONFS)
103 # install_libafs:       $(INST_LIBAFSNONFS)
104 # dest_libafs:  $(DEST_LIBAFS) $(DEST_LIBAFSNONFS)
105 # dest_libafs:  $(DEST_LIBAFSNONFS)
106 libafs:
107         echo WARNING: No kernel module for ${SYS_NAME}
108
109 install_libafs:
110         echo WARNING: No kernel module for ${SYS_NAME}
111
112 dest_libafs:
113         echo WARNING: No kernel module for ${SYS_NAME}
114
115
116 $(INST_LIBAFS): $(LIBAFS)
117         $(INSTALL) -f $? $@
118
119 $(INST_LIBAFSNONFS): $(LIBAFSNONFS)
120         $(INSTALL) -f $? $@
121
122 $(DEST_LIBAFS): $(LIBAFS)
123         $(INSTALL) -f $? $@
124
125 $(DEST_LIBAFSNONFS): $(LIBAFSNONFS)
126         $(INSTALL) -f $? $@
127
128 ${LIBAFS}: $(AFSAOBJS) $(AFSNFSOBJS)
129         $(LD) -r -o ${LIBAFS} ${AFSAOBJS} ${AFSNFSOBJS}
130
131 ${LIBAFSNONFS}:  $(AFSAOBJS) $(AFSNONFSOBJS)
132         $(LD) -r -o ${LIBAFSNONFS} ${AFSAOBJS} ${AFSNONFSOBJS}
133
134
135 # Object build rules:
136 osi_groups.o: $(AFS)/osi_groups.c
137         $(CRULE1)
138 osi_file.o: $(AFS)/osi_file.c
139         $(CRULE1)
140 osi_inode.o: $(AFS)/osi_inode.c
141         $(CRULE1)
142 osi_misc.o: $(AFS)/osi_misc.c
143         $(CRULE1)
144 osi_sleep.o: $(AFS)/osi_sleep.c
145         $(CRULE1)
146 osi_vfsops_nfs.o: $(AFS)/osi_vfsops.c
147         $(CRULE1) -o osi_vfsops_nfs.o
148 osi_vfsops.o: $(AFS)/osi_vfsops.c
149         $(CRULE1) -DAFS_NONFSTRANS
150 osi_vm.o: $(AFS)/osi_vm.c
151         $(CRULE1)
152 osi_vnodeops.o: $(AFS)/osi_vnodeops.c
153         $(CRULE1)
154 xdr_int64.o: $(RX)/xdr_int64.c
155         $(CRULE1)