config-makefile-further-cleanup-20010830
[openafs.git] / src / config / Makefile.in
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 DESTDIR=@DESTDIR@
9 SRCDIR=@SRCDIR@
10 TOP_SRCDIR=@TOP_SRCDIR@
11 SYS_NAME=@AFS_SYSNAME@
12
13 KERNELDIR=../libafs
14 UKERNELDIR=../libuafs
15 SHELL=/bin/sh
16
17 include Makefile.${SYS_NAME}
18
19 CFLAGS=-g -I${DESTDIR}/include ${XCFLAGS}
20
21 INST=$(RM) -f $@; $(CP) $? $@
22
23 all: install
24
25 Makefile.version: Makefile.version-CML Makefile.version-NOCML
26         $(RM) -f Makefile.version
27         if      [ -r SRC/../CML/state ] ; \
28         then    $(CP) Makefile.version-CML Makefile.version ; \
29         else    $(CP) Makefile.version-NOCML Makefile.version ; \
30         fi
31
32 #
33 # AFS component version string file generation targets
34 #
35 AFS_component_version_number.c: Makefile.version
36         $(MAKE) -f Makefile.version AFS_component_version_number.c
37
38 ${KERNELDIR}/afs/AFS_component_version_number.c: AFS_component_version_number.c
39         $(INST)
40
41 ${UKERNELDIR}/afs/AFS_component_version_number.c: AFS_component_version_number.c
42         $(INST)
43
44 #
45 # App build/install targets
46 #
47 config: config.o mc.o
48         $(CC) $(CFLAGS) -o config config.o mc.o
49
50 mkvers: mkvers.c
51         $(CC) $(CFLAGS) -o mkvers mkvers.c
52
53 mc.o: mc.c
54 config.o: config.c AFS_component_version_number.c
55
56 ${DESTDIR}/bin:
57         mkdir -p $@
58
59 ${DESTDIR}/bin/mkvers: mkvers
60         $(INST)
61
62 #
63 # Include installation targets
64 #
65 KDIRS = ${KERNELDIR}/afs \
66         ${KERNELDIR}/rx \
67         ${KERNELDIR}/afsint \
68         ${KERNELDIR}/config
69
70 $(KDIRS): 
71         mkdir -p $@
72
73 UKDIRS = ${UKERNELDIR}/afs \
74         ${UKERNELDIR}/rx \
75         ${UKERNELDIR}/afsint \
76         ${UKERNELDIR}/config
77
78 $(UKDIRS): 
79         mkdir -p $@
80
81 HDIRS = ${DESTDIR}/include/afs 
82
83 $(HDIRS): 
84         mkdir -p $@
85
86 ${KERNELDIR}/afs/param.h ${DESTDIR}/include/afs/param.h: param.${SYS_NAME}.h
87         -$(INST)
88
89 ${UKERNELDIR}/afs/afs_sysnames.h ${KERNELDIR}/afs/afs_sysnames.h ${DESTDIR}/include/afs/afs_sysnames.h: afs_sysnames.h
90         $(INST)
91
92 ${UKERNELDIR}/afs/stds.h ${KERNELDIR}/afs/stds.h ${DESTDIR}/include/afs/stds.h: stds.h
93         $(INST)
94
95 ${UKERNELDIR}/config/Makefile.${SYS_NAME} ${KERNELDIR}/config/Makefile.${SYS_NAME}: Makefile.${SYS_NAME}
96         $(INST)
97
98 ${UKERNELDIR}/afs/icl.h ${KERNELDIR}/afs/icl.h ${DESTDIR}/include/afs/icl.h: icl.h 
99         $(INST)
100
101 ${UKERNELDIR}/afs/afs_args.h ${KERNELDIR}/afs/afs_args.h ${DESTDIR}/include/afs/afs_args.h: afs_args.h 
102         $(INST)
103
104 ${UKERNELDIR}/afs/venus.h ${DESTDIR}/include/afs/venus.h: venus.h 
105         $(INST)
106
107 ${DESTDIR}/include/afs/debug.h: debug.h 
108         $(INST)
109
110 ${UKERNELDIR}/afs/param.h: param.${SYS_NAME}_usr.h
111         $(INST)
112
113 # these are needed to compile the kernel.  Config is necessary to
114 # convert the MakefileProto in libafs and the kernel links provide the
115 # kernel include environment.  param.h is, well, param.h.  The afs_sysnames.h
116 # file is needed by param.h to create unique identifiers for each SYS_TYPE.
117
118 install: config \
119         $(DESTDIR)/bin \
120         $(DESTDIR)/bin/mkvers \
121         hinstall \
122         ukinstall \
123         kinstall 
124
125 hinstall: \
126         $(HDIRS) \
127         ${DESTDIR}/include/afs/param.h \
128         ${DESTDIR}/include/afs/stds.h \
129         ${DESTDIR}/include/afs/afs_sysnames.h \
130         ${DESTDIR}/include/afs/afs_args.h \
131         ${DESTDIR}/include/afs/icl.h \
132         ${DESTDIR}/include/afs/venus.h \
133         ${DESTDIR}/include/afs/debug.h 
134
135 kinstall: \
136         $(KDIRS) \
137         ${KERNELDIR}/afs/param.h \
138         ${KERNELDIR}/afs/stds.h \
139         ${KERNELDIR}/afs/afs_sysnames.h \
140         ${KERNELDIR}/config/Makefile.${SYS_NAME} \
141         ${KERNELDIR}/afs/afs_args.h \
142         ${KERNELDIR}/afs/icl.h \
143         ${KERNELDIR}/afs/AFS_component_version_number.c
144
145 ukinstall: \
146         $(UKDIRS) \
147         ${UKERNELDIR}/afs/param.h \
148         ${UKERNELDIR}/afs/stds.h \
149         ${UKERNELDIR}/afs/afs_sysnames.h \
150         ${UKERNELDIR}/config/Makefile.${SYS_NAME} \
151         ${UKERNELDIR}/afs/afs_args.h \
152         ${UKERNELDIR}/afs/icl.h \
153         ${UKERNELDIR}/afs/venus.h \
154         ${UKERNELDIR}/afs/AFS_component_version_number.c
155
156 clean:
157         $(RM) -f *.o config core xprt AFS_component_version_number.c