death-to-permit-xprt-h-20010327
[openafs.git] / src / config / Makefile
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 KERNELDIR=../libafs
9 UKERNELDIR=../libuafs
10 SHELL=/bin/sh
11 COMPONENT=config
12 include Makefile.${SYS_NAME}
13
14 MKDIR_IF_NEEDED=[ -d $$1 ] || mkdir -p $$1
15
16 CFLAGS=-g -I${DESTDIR}include ${XCFLAGS}
17
18 noversion: install.noversion
19
20 KDIRS = ${KERNELDIR}/afs ${KERNELDIR}/rx ${KERNELDIR}/afsint \
21         ${DESTDIR}include/afs ${KERNELDIR}/config
22
23 UKDIRS = ${UKERNELDIR}/afs ${UKERNELDIR}/rx ${UKERNELDIR}/afsint \
24          ${UKERNELDIR}/config
25
26 noversionMakef: $(KDIRS)
27         -if [ ! -f Makefile.version ] ; \
28         then \
29                 $(CP) Makefile.version-NOCML Makefile.version; \
30                 $(MAKE) -f Makefile.version  AFS_component_version_number.c; \
31         fi; 
32
33 version: ${DESTDIR}bin/mkvers Makefile.version
34         $(MAKE) -f Makefile.version  AFS_component_version_number.c
35
36 ${DESTDIR}bin/mkvers: mkvers.c
37         set ${DESTDIR}bin; $(MKDIR_IF_NEEDED)
38         $(CC) -o ${DESTDIR}bin/mkvers mkvers.c
39
40 Makefile.version: Makefile.version-CML Makefile.version-NOCML
41         $(RM) -f Makefile.version
42         set -x ; \
43         if      [ -r SRC/../CML/state ] ; \
44         then    $(CP) Makefile.version-CML Makefile.version ; \
45         else    $(CP) Makefile.version-NOCML Makefile.version ; \
46         fi
47
48 all: config
49
50 mc.o: mc.c
51
52 config.o: config.c AFS_component_version_number.c
53
54 config: config.o mc.o
55         $(SPEW) $(CC) $(CFLAGS) -o config config.o mc.o
56
57 param.xxx:
58
59 $(KDIRS): 
60         set $@; $(MKDIR_IF_NEEDED)
61
62 ${KERNELDIR}/afs/AFS_component_version_number.c: AFS_component_version_number.c
63         -$(RM) -f $@; $(CP) $? $@
64
65 ${KERNELDIR}/afs/param.h ${DESTDIR}include/afs/param.h :: param.${SYS_NAME}.h
66         -$(RM) -f $@; $(CP) $? $@
67
68 ${KERNELDIR}/afs/afs_sysnames.h ${DESTDIR}include/afs/afs_sysnames.h :: afs_sysnames.h
69         $(RM) -f $@; $(CP) $? $@
70
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 
72
73 ${KERNELDIR}/afs/stds.h ${DESTDIR}include/afs/stds.h :: stds.h
74         $(RM) -f $@; $(CP) $? $@
75
76 ${KERNELDIR}/config/Makefile.${SYS_NAME} :: Makefile.${SYS_NAME}
77         $(RM) -f $@; $(CP) $? $@
78
79 ${KERNELDIR}/afs/icl.h ${DESTDIR}include/afs/icl.h :: icl.h 
80         $(RM) -f $@; $(CP) $? $@
81
82 ${KERNELDIR}/afs/afs_args.h ${DESTDIR}include/afs/afs_args.h :: afs_args.h 
83         $(RM) -f $@; $(CP) $? $@
84
85 ${DESTDIR}include/afs/venus.h :: venus.h 
86         $(RM) -f $@; $(CP) $? $@
87
88 ${DESTDIR}include/afs/debug.h :: debug.h 
89         $(RM) -f $@; $(CP) $? $@
90
91 $(UKDIRS): 
92         set $@; $(MKDIR_IF_NEEDED)
93
94 ${UKERNELDIR}/afs/AFS_component_version_number.c: AFS_component_version_number.c
95         -$(RM) -f $@; $(CP) $? $@
96
97 ${UKERNELDIR}/afs/param.h :: param.${SYS_NAME}_usr.h
98         -$(RM) -f $@; $(CP) $? $@
99
100 ${UKERNELDIR}/afs/afs_sysnames.h :: afs_sysnames.h
101         $(RM) -f $@; $(CP) $? $@
102
103 ${UKERNELDIR}/afs/stds.h :: stds.h
104         $(RM) -f $@; $(CP) $? $@
105
106 ${UKERNELDIR}/config/Makefile.${SYS_NAME} :: Makefile.${SYS_NAME}
107         $(RM) -f $@; $(CP) $? $@
108
109 ${UKERNELDIR}/afs/icl.h :: icl.h 
110         $(RM) -f $@; $(CP) $? $@
111
112 ${UKERNELDIR}/afs/venus.h :: venus.h 
113         $(RM) -f $@; $(CP) $? $@
114
115 ${UKERNELDIR}/afs/afs_args.h :: afs_args.h 
116         $(RM) -f $@; $(CP) $? $@
117
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.
120 #
121 # To add AFS support to a new Linux kernel rev, see comments in the file
122 # ./linux-version.
123 #
124 lkversion:
125         case ${SYS_NAME} in \
126         *linux* ) \
127                 LINUX_SRCDIR="$(LINUX_SRCDIR)"; export LINUX_SRCDIR; \
128                 LINUX_VERS="$(LINUX_VERS)"; export LINUX_VERS; \
129                 sh ./linux-version ; \
130         esac
131
132 install.noversion: $(KDIRS) noversionMakef all $(DESTINCLS) venus.h
133
134 system: install
135 install: version install.noversion kinstall ukinstall
136
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.
141
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
149
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
157
158 clean:
159         $(RM) -f *.o config core xprt