]>
Commit | Line | Data |
---|---|---|
1c79356b A |
1 | # |
2 | # Mach Operating System | |
3 | # Copyright (c) 1986 Carnegie-Mellon University | |
4 | # All rights reserved. The CMU software License Agreement specifies | |
5 | # the terms and conditions for use and redistribution. | |
6 | # | |
7 | ||
8 | # | |
9 | # Export IDENT for sub-makefiles | |
10 | # | |
11 | export IDENT | |
12 | ||
13 | # | |
14 | # XXX: INCFLAGS | |
15 | # | |
16 | INCFLAGS_MAKEFILE= | |
17 | ||
18 | ||
19 | export MakeInc_cmd=${SRCROOT}/makedefs/MakeInc.cmd | |
20 | export MakeInc_def=${SRCROOT}/makedefs/MakeInc.def | |
21 | export MakeInc_rule=${SRCROOT}/makedefs/MakeInc.rule | |
22 | export MakeInc_dir=${SRCROOT}/makedefs/MakeInc.dir | |
23 | ||
24 | include $(MakeInc_cmd) | |
25 | include $(MakeInc_def) | |
26 | ||
27 | # | |
28 | # XXX: CFLAGS | |
29 | # | |
0b4e3aa0 | 30 | CFLAGS+= -DKERNEL -DLIBKERN_KERNEL_PRIVATE \ |
1c79356b A |
31 | -Wall -Wno-four-char-constants -fno-common |
32 | ||
33 | SFLAGS+= -DKERNEL | |
34 | ||
35 | # | |
36 | # Directories for mig generated files | |
37 | # | |
38 | COMP_SUBDIRS = | |
39 | ||
40 | # | |
41 | # Make sure we don't remove this by accident if interrupted at the wrong | |
42 | # time. | |
43 | # | |
44 | .PRECIOUS: Makefile | |
45 | ||
46 | VERSION_FILES= \ | |
47 | $(SOURCE_DIR)/$(COMPONENT)/conf/version.major \ | |
48 | $(SOURCE_DIR)/$(COMPONENT)/conf/version.minor \ | |
49 | $(SOURCE_DIR)/$(COMPONENT)/conf/version.variant | |
50 | ||
51 | COPYRIGHT_FILES = \ | |
52 | $(SOURCE_DIR)/$(COMPONENT)/conf/copyright | |
53 | ||
54 | # | |
55 | # Theses macros are filled in by the config program depending on the | |
56 | # current configuration. The MACHDEP macro is replaced by the | |
57 | # contents of the machine dependent makefile template and the others | |
58 | # are replaced by the corresponding symbol definitions for the | |
59 | # configuration. | |
60 | # | |
61 | ||
62 | %OBJS | |
63 | ||
64 | %CFILES | |
65 | ||
66 | %MFILES | |
67 | ||
68 | %SFILES | |
69 | ||
70 | %BFILES | |
71 | ||
72 | %ORDERED | |
73 | %MACHDEP | |
74 | ||
75 | # | |
76 | # OBJSDEPS is the set of files (defined in the machine dependent | |
77 | # template if necessary) which all objects depend on (such as an | |
78 | # in-line assembler expansion filter) | |
79 | # | |
80 | ${OBJS}: ${OBJSDEPS} | |
81 | ||
82 | ||
83 | %LOAD | |
84 | ||
85 | LDOBJS = $(OBJS) | |
86 | ||
87 | $(COMPONENT).o: $(LDOBJS) | |
88 | @echo "creating $(COMPONENT).o" | |
89 | $(RM) $(RMFLAGS) vers.c | |
90 | $(OBJROOT)/$(KERNEL_CONFIG)_$(ARCH_CONFIG)/$(COMPONENT)/newvers \ | |
91 | `$(CAT) ${VERSION_FILES}` ${COPYRIGHT_FILES} | |
92 | ${KCC} $(CFLAGS) $(INCLUDES) -c vers.c | |
93 | @echo [ updating $(COMPONENT).o ${LIBKERN_KERNEL_CONFIG} ] | |
94 | $(LD) $(LDFLAGS_COMPONENT) -o $(COMPONENT).o ${LDOBJS} vers.o /usr/local/lib/libkld.a | |
95 | $(SEG_HACK) __KLD $(COMPONENT).o -o $(COMPONENT)_kld.o | |
96 | mv $(COMPONENT)_kld.o $(COMPONENT).o | |
97 | ||
98 | do_all: $(COMPONENT).o | |
99 | ||
100 | do_depend: do_all | |
101 | ${MD} -u Makedep -f -d `ls *.d` | |
102 | ||
103 | do_build_all: do_depend | |
104 | ||
105 | %RULES | |
106 | ||
1c79356b | 107 | include $(MakeInc_rule) |
1c79356b A |
108 | include $(MakeInc_dir) |
109 |