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
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) $? $@
92 set $@; $(MKDIR_IF_NEEDED)
94 ${UKERNELDIR}/afs/AFS_component_version_number.c: AFS_component_version_number.c
95 -$(RM) -f $@; $(CP) $? $@
97 ${UKERNELDIR}/afs/param.h :: param.${SYS_NAME}_usr.h
98 -$(RM) -f $@; $(CP) $? $@
100 ${UKERNELDIR}/afs/afs_sysnames.h :: afs_sysnames.h
101 $(RM) -f $@; $(CP) $? $@
103 ${UKERNELDIR}/afs/stds.h :: stds.h
104 $(RM) -f $@; $(CP) $? $@
106 ${UKERNELDIR}/config/Makefile.${SYS_NAME} :: Makefile.${SYS_NAME}
107 $(RM) -f $@; $(CP) $? $@
109 ${UKERNELDIR}/afs/icl.h :: icl.h
110 $(RM) -f $@; $(CP) $? $@
112 ${UKERNELDIR}/afs/venus.h :: venus.h
113 $(RM) -f $@; $(CP) $? $@
115 ${UKERNELDIR}/afs/afs_args.h :: afs_args.h
116 $(RM) -f $@; $(CP) $? $@
118 # lkversion is the target the Linux build uses to verify the build machine
119 # has headers in the right place for the requested kernel builds.
121 # To add AFS support to a new Linux kernel rev, see comments in the file
125 case ${SYS_NAME} in \
127 LINUX_SRCDIR="$(LINUX_SRCDIR)"; export LINUX_SRCDIR; \
128 LINUX_VERS="$(LINUX_VERS)"; export LINUX_VERS; \
129 sh ./linux-version ; \
132 install.noversion: $(KDIRS) noversionMakef all $(DESTINCLS) venus.h
135 install: version install.noversion kinstall ukinstall
137 # these are needed to compile the kernel. Config is necessary to
138 # convert the MakefileProto in libafs and the kernel links provide the
139 # kernel include environment. param.h is, well, param.h. The afs_sysnames.h
140 # file is needed by param.h to create unique identifiers for each SYS_TYPE.
142 kinstall: lkversion config $(KDIRS) ${KERNELDIR}/afs/param.h \
143 ${KERNELDIR}/afs/stds.h \
144 ${KERNELDIR}/afs/afs_sysnames.h \
145 ${KERNELDIR}/config/Makefile.${SYS_NAME} \
146 ${KERNELDIR}/afs/afs_args.h \
147 ${KERNELDIR}/afs/icl.h \
148 ${KERNELDIR}/afs/AFS_component_version_number.c
150 ukinstall webinstall: $(DESTINCLS) config $(UKDIRS) ${UKERNELDIR}/afs/param.h ${UKERNELDIR}/afs/stds.h \
151 ${UKERNELDIR}/afs/afs_sysnames.h \
152 ${UKERNELDIR}/config/Makefile.${SYS_NAME} \
153 ${UKERNELDIR}/afs/afs_args.h \
154 ${UKERNELDIR}/afs/icl.h \
155 ${UKERNELDIR}/afs/venus.h \
156 ${UKERNELDIR}/afs/AFS_component_version_number.c
159 $(RM) -f *.o config core xprt