FreeBSD/Linux Kernel Cross Reference
sys/conf/Makefile
1 #
2 # Mach Operating System
3 # Copyright (c) 1993,1992 Carnegie Mellon University
4 # All Rights Reserved.
5 #
6 # Permission to use, copy, modify and distribute this software and its
7 # documentation is hereby granted, provided that both the copyright
8 # notice and this permission notice appear in all copies of the
9 # software, derivative works or modified versions, and any portions
10 # thereof, and that both notices appear in supporting documentation.
11 #
12 # CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
13 # CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
14 # ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
15 #
16 # Carnegie Mellon requests users of this software to return to
17 #
18 # Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
19 # School of Computer Science
20 # Carnegie Mellon University
21 # Pittsburgh PA 15213-3890
22 #
23 # any improvements or extensions that they make and grant Carnegie Mellon
24 # the rights to redistribute these changes.
25 #
26 #
27 # HISTORY
28 # $Log: Makefile,v $
29 # Revision 2.2 93/02/04 17:10:57 mrt
30 # Created for ODE make.
31 # [92/12/26 mrt]
32 #
33
34
35 MASTER = MASTER
36 MASTER_TM = ${target_cpu}/MASTER
37 MASTER_LOCAL = MASTER.local
38 MASTER_TM_LOCAL = ${target_cpu}/MASTER.local
39
40 # We want the MK version & configuration to be part of this name.
41 # Makeconf defined KERNEL_CONFIG, KERNEL_VERSION and VERSION
42
43 CONFIG ?= ${KERNEL_${TARGET_MACHINE}_CONFIG:U${KERNEL_CONFIG:UDEFAULT}}
44 VERSION ?= ${KERNEL_VERSION}
45
46 OTHERS = ../${CONFIG}/Makefile
47
48 MACH_KERNEL = mach_kernel.${VERSION}.${CONFIG}
49 MACH_BOOT = mach.boot.${VERSION}.${CONFIG}
50 BOOTSTRAP = bootstrap.${VERSION}
51
52
53 .include <${RULES_MK}>
54
55
56 # The doconf process produces a configuration file in the object subdirectory.
57 # The configuration file has the same name as the subdirectory, ie ${CONFIG}.
58 # As input it uses the various MASTER files from the conf subdirectory.
59
60
61 ${CONFIG}: ${MASTER} ${MASTER_TM} \
62 ${MASTER_LOCAL} ${MASTER_TM_LOCAL}
63 @echo "[ generating ${.TARGET} from {,${target_cpu}/}MASTER{,.local} ]"
64 @doconf="`wh -q doconf`"; \
65 echo "${.TARGET}: $${doconf}" >> ${.TARGET}.d; \
66 $${doconf} ${CONFIG}\
67 ${${MASTER}:P}\
68 ${${MASTER_TM}:P}\
69 ${${MASTER_LOCAL}:P}\
70 ${${MASTER_TM_LOCAL}:P} >${CONFIG}.tmp
71 @-if [ -s ${CONFIG}.tmp ]; then \
72 if [ -f ${CONFIG} ]; then \
73 diff ${CONFIG} ${CONFIG}.tmp; \
74 mv ${CONFIG} ${CONFIG}.old; \
75 fi; \
76 mv ${CONFIG}.tmp ${CONFIG}; \
77 else \
78 ${RM} -f ${CONFIG}.tmp; \
79 fi
80
81
82 # The config process produces Makefile in the object subdirectory.
83 # As input it uses the configuration file from doconf and some files
84 # from the conf subdirectory.
85 #
86 # We generate a dependency on config.
87 #
88 # We save the current configuration in vers.config, so that if the
89 # object directory is renamed we will know to reconfigure. We remove
90 # the ${MACH_KERNEL} binary, to guarantee that it is at least relinked.
91 # (For example, the current configuration might contain a subset of
92 # the .o files in the previous configuration.)
93
94 ../${CONFIG}/Makefile: ${CONFIG} \
95 files \
96 ${target_cpu}/files \
97 template.mk \
98 ${target_cpu}/template.mk
99 @echo "[ configuring ${CONFIG} ]"
100 @-if [ -d ../${CONFIG} ]; then true; else mkdir ../${CONFIG}; fi
101 @config="`wh -q config`"; \
102 echo "${.TARGET}: $${config}" >> ${.TARGET}.d; \
103 $${config} `genpath -I.` -c . ${CONFIG}
104 @${RM} -f ../${CONFIG}/Makefile
105 @ln -s Makefile.internal ../${CONFIG}/Makefile
106 @echo ${CONFIG} >../${CONFIG}/vers.config
107 @${RM} -f ../${CONFIG}/${MACH_KERNEL}
108
109
Cache object: 0087ddd2f24136232bda5d40c31dd727
|