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
12 include Makefile.${SYS_NAME}
14 MKDIR_IF_NEEDED=[ -d $$1 ] || mkdir -p $$1
16 CFLAGS=-g -I${DESTDIR}include ${XCFLAGS}
18 noversion: install.noversion
20 KDIRS = ${KERNELDIR}/afs ${KERNELDIR}/rx ${KERNELDIR}/afsint \
21 ${DESTDIR}include/afs ${KERNELDIR}/config
23 UKDIRS = ${UKERNELDIR}/afs ${UKERNELDIR}/rx ${UKERNELDIR}/afsint \
26 noversionMakef: $(KDIRS)
27 -if [ ! -f Makefile.version ] ; \
29 $(CP) Makefile.version-NOCML Makefile.version; \
30 $(MAKE) -f Makefile.version AFS_component_version_number.c; \
33 version: ${DESTDIR}bin/mkvers Makefile.version
34 $(MAKE) -f Makefile.version AFS_component_version_number.c
36 ${DESTDIR}bin/mkvers: mkvers.c
37 set ${DESTDIR}bin; $(MKDIR_IF_NEEDED)
38 $(CC) -o ${DESTDIR}bin/mkvers mkvers.c
40 Makefile.version: Makefile.version-CML Makefile.version-NOCML
41 $(RM) -f Makefile.version
43 if [ -r SRC/../CML/state ] ; \
44 then $(CP) Makefile.version-CML Makefile.version ; \
45 else $(CP) Makefile.version-NOCML Makefile.version ; \
52 config.o: config.c AFS_component_version_number.c
55 $(SPEW) $(CC) $(CFLAGS) -o config config.o mc.o
60 set $@; $(MKDIR_IF_NEEDED)
62 ${KERNELDIR}/afs/AFS_component_version_number.c: AFS_component_version_number.c
63 -$(RM) -f $@; $(CP) $? $@
65 ${KERNELDIR}/afs/param.h ${DESTDIR}include/afs/param.h :: param.${SYS_NAME}.h
66 -$(RM) -f $@; $(CP) $? $@
68 ${KERNELDIR}/afs/afs_sysnames.h ${DESTDIR}include/afs/afs_sysnames.h :: afs_sysnames.h
69 $(RM) -f $@; $(CP) $? $@
71 DESTINCLS = ${DESTDIR}include/afs/afs_args.h ${DESTDIR}include/afs/venus.h ${DESTDIR}include/afs/debug.h ${DESTDIR}include/afs/afs_sysnames.h ${DESTDIR}include/afs/param.h ${DESTDIR}include/afs/stds.h ${DESTDIR}include/afs/icl.h ../permit_xprt.h
73 ${KERNELDIR}/afs/stds.h ${DESTDIR}include/afs/stds.h :: stds.h
74 $(RM) -f $@; $(CP) $? $@
76 ${KERNELDIR}/config/Makefile.${SYS_NAME} :: Makefile.${SYS_NAME}
77 $(RM) -f $@; $(CP) $? $@
79 ${KERNELDIR}/afs/icl.h ${DESTDIR}include/afs/icl.h :: icl.h
80 $(RM) -f $@; $(CP) $? $@
82 ${KERNELDIR}/afs/afs_args.h ${DESTDIR}include/afs/afs_args.h :: afs_args.h
83 $(RM) -f $@; $(CP) $? $@
85 ${DESTDIR}include/afs/venus.h :: venus.h
86 $(RM) -f $@; $(CP) $? $@
88 ${DESTDIR}include/afs/debug.h :: debug.h
89 $(RM) -f $@; $(CP) $? $@
91 ${KERNELDIR}/afs/permit_xprt.h ../permit_xprt.h:
92 $(RM) -f ${KERNELDIR}/afs/permit_xprt.h ../permit_xprt.h
93 if [ -f SRC/../xprt/permit_xprt.h ] ; then \
95 perm_src=`pwd`/../xprt ; \
96 echo "perm_src='$$perm_src'" ; \
98 ln -s $$perm_src/permit_export.h ${KERNELDIR}/afs/permit_xprt.h ; \
99 ln -s $$perm_src/permit_xprt.h ../permit_xprt.h ; \
103 echo "perm_src='$$perm_src'" ; \
105 ln -s $$perm_src/permit_xprt.h ${KERNELDIR}/afs/permit_xprt.h ; \
106 ln -s $$perm_src/permit_xprt.h ../permit_xprt.h ; \
110 set $@; $(MKDIR_IF_NEEDED)
112 ${UKERNELDIR}/afs/AFS_component_version_number.c: AFS_component_version_number.c
113 -$(RM) -f $@; $(CP) $? $@
115 ${UKERNELDIR}/afs/param.h :: param.${SYS_NAME}_usr.h
116 -$(RM) -f $@; $(CP) $? $@
118 ${UKERNELDIR}/afs/afs_sysnames.h :: afs_sysnames.h
119 $(RM) -f $@; $(CP) $? $@
121 ${UKERNELDIR}/afs/stds.h :: stds.h
122 $(RM) -f $@; $(CP) $? $@
124 ${UKERNELDIR}/config/Makefile.${SYS_NAME} :: Makefile.${SYS_NAME}
125 $(RM) -f $@; $(CP) $? $@
127 ${UKERNELDIR}/afs/icl.h :: icl.h
128 $(RM) -f $@; $(CP) $? $@
130 ${UKERNELDIR}/afs/venus.h :: venus.h
131 $(RM) -f $@; $(CP) $? $@
133 ${UKERNELDIR}/afs/afs_args.h :: afs_args.h
134 $(RM) -f $@; $(CP) $? $@
136 ${UKERNELDIR}/afs/permit_xprt.h:
137 $(RM) -f ${UKERNELDIR}/afs/permit_xprt.h
138 if [ -f SRC/../xprt/permit_xprt.h ] ; then \
140 perm_src=`pwd`/../xprt ; \
143 perm_src=`pwd`/../config ; \
145 echo "perm_src='$$perm_src'" ; \
147 ln -s $$perm_src/permit_xprt.h ${UKERNELDIR}/afs/permit_xprt.h
149 # lkversion is the target the Linux build uses to verify the build machine
150 # has headers in the right place for the requested kernel builds.
152 # To add AFS support to a new Linux kernel rev, see comments in the file
156 case ${SYS_NAME} in \
158 LINUX_SRCDIR="$(LINUX_SRCDIR)"; export LINUX_SRCDIR; \
159 LINUX_VERS="$(LINUX_VERS)"; export LINUX_VERS; \
160 sh ./linux-version ; \
163 install.noversion: $(KDIRS) noversionMakef all $(DESTINCLS) venus.h
164 $(RM) -f ${DESTDIR}/include/afs/permit_xprt.h
165 $(CP) permit_xprt.h ${DESTDIR}/include/afs/
168 install: version install.noversion kinstall ukinstall
170 # these are needed to compile the kernel. Config is necessary to
171 # convert the MakefileProto in libafs and the kernel links provide the
172 # kernel include environment. param.h is, well, param.h. The afs_sysnames.h
173 # file is needed by param.h to create unique identifiers for each SYS_TYPE.
175 kinstall: lkversion config $(KDIRS) ${KERNELDIR}/afs/param.h \
176 ${KERNELDIR}/afs/stds.h \
177 ${KERNELDIR}/afs/permit_xprt.h ${KERNELDIR}/afs/afs_sysnames.h \
178 ${KERNELDIR}/config/Makefile.${SYS_NAME} \
179 ${KERNELDIR}/afs/afs_args.h \
180 ${KERNELDIR}/afs/icl.h \
181 ${KERNELDIR}/afs/AFS_component_version_number.c
183 ukinstall webinstall: $(DESTINCLS) config $(UKDIRS) ${UKERNELDIR}/afs/param.h ${UKERNELDIR}/afs/stds.h \
184 ${UKERNELDIR}/afs/permit_xprt.h ${UKERNELDIR}/afs/afs_sysnames.h \
185 ${UKERNELDIR}/config/Makefile.${SYS_NAME} \
186 ${UKERNELDIR}/afs/afs_args.h \
187 ${UKERNELDIR}/afs/icl.h \
188 ${UKERNELDIR}/afs/venus.h \
189 ${UKERNELDIR}/afs/AFS_component_version_number.c
192 $(RM) -f *.o config core xprt