Rev 1774 | Rev 1802 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1774 | Rev 1787 | ||
---|---|---|---|
1 | # |
1 | # |
2 | # Copyright (C) 2005 Martin Decky |
2 | # Copyright (C) 2005 Martin Decky |
3 | # All rights reserved. |
3 | # All rights reserved. |
4 | # |
4 | # |
5 | # Redistribution and use in source and binary forms, with or without |
5 | # Redistribution and use in source and binary forms, with or without |
6 | # modification, are permitted provided that the following conditions |
6 | # modification, are permitted provided that the following conditions |
7 | # are met: |
7 | # are met: |
8 | # |
8 | # |
9 | # - Redistributions of source code must retain the above copyright |
9 | # - Redistributions of source code must retain the above copyright |
10 | # notice, this list of conditions and the following disclaimer. |
10 | # notice, this list of conditions and the following disclaimer. |
11 | # - Redistributions in binary form must reproduce the above copyright |
11 | # - Redistributions in binary form must reproduce the above copyright |
12 | # notice, this list of conditions and the following disclaimer in the |
12 | # notice, this list of conditions and the following disclaimer in the |
13 | # documentation and/or other materials provided with the distribution. |
13 | # documentation and/or other materials provided with the distribution. |
14 | # - The name of the author may not be used to endorse or promote products |
14 | # - The name of the author may not be used to endorse or promote products |
15 | # derived from this software without specific prior written permission. |
15 | # derived from this software without specific prior written permission. |
16 | # |
16 | # |
17 | # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
17 | # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
18 | # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
18 | # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
19 | # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
19 | # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
20 | # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
20 | # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
21 | # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
21 | # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
22 | # NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
22 | # NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
23 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
23 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
24 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
24 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
25 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
25 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
26 | # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 | # |
27 | # |
28 | 28 | ||
29 | ## Kernel release |
29 | ## Kernel release |
30 | # |
30 | # |
31 | 31 | ||
32 | VERSION = 0 |
32 | VERSION = 0 |
33 | PATCHLEVEL = 2 |
33 | PATCHLEVEL = 2 |
34 | SUBLEVEL = 0 |
34 | SUBLEVEL = 0 |
35 | EXTRAVERSION = 2 |
35 | EXTRAVERSION = 2 |
36 | NAME = Daylight |
36 | NAME = Daylight |
37 | ifdef EXTRAVERSION |
37 | ifdef EXTRAVERSION |
38 | RELEASE = $(VERSION).$(PATCHLEVEL).$(SUBLEVEL).$(EXTRAVERSION) |
38 | RELEASE = $(VERSION).$(PATCHLEVEL).$(SUBLEVEL).$(EXTRAVERSION) |
39 | else |
39 | else |
40 | RELEASE = $(VERSION).$(PATCHLEVEL).$(SUBLEVEL) |
40 | RELEASE = $(VERSION).$(PATCHLEVEL).$(SUBLEVEL) |
41 | endif |
41 | endif |
42 | 42 | ||
43 | ## Include configuration |
43 | ## Include configuration |
44 | # |
44 | # |
45 | 45 | ||
46 | -include Makefile.config |
46 | -include Makefile.config |
47 | 47 | ||
48 | ## Common compiler flags |
48 | ## Common compiler flags |
49 | # |
49 | # |
50 | 50 | ||
51 | DEFS = -D$(ARCH) -DARCH=\"$(ARCH)\" -DRELEASE=\"$(RELEASE)\" "-DNAME=\"$(NAME)\"" -DKERNEL |
51 | DEFS = -D$(ARCH) -DARCH=\"$(ARCH)\" -DRELEASE=\"$(RELEASE)\" "-DNAME=\"$(NAME)\"" -DKERNEL |
52 | CFLAGS = -fno-builtin -fomit-frame-pointer -Wall -Werror-implicit-function-declaration -Wmissing-prototypes -Werror -O3 -nostdlib -nostdinc -Igeneric/include/ |
52 | CFLAGS = -fno-builtin -fomit-frame-pointer -Wall -Werror-implicit-function-declaration -Wmissing-prototypes -Werror -O3 -nostdlib -nostdinc -Igeneric/include/ |
53 | LFLAGS = -M |
53 | LFLAGS = -M |
54 | AFLAGS = |
54 | AFLAGS = |
55 | 55 | ||
56 | ifdef REVISION |
56 | ifdef REVISION |
57 | DEFS += "-DREVISION=\"$(REVISION)\"" |
57 | DEFS += "-DREVISION=\"$(REVISION)\"" |
58 | endif |
58 | endif |
59 | 59 | ||
60 | ifdef TIMESTAMP |
60 | ifdef TIMESTAMP |
61 | DEFS += "-DTIMESTAMP=\"$(TIMESTAMP)\"" |
61 | DEFS += "-DTIMESTAMP=\"$(TIMESTAMP)\"" |
62 | endif |
62 | endif |
63 | 63 | ||
64 | ## Setup kernel configuration |
64 | ## Setup kernel configuration |
65 | # |
65 | # |
66 | 66 | ||
67 | -include arch/$(ARCH)/Makefile.inc |
67 | -include arch/$(ARCH)/Makefile.inc |
68 | -include genarch/Makefile.inc |
68 | -include genarch/Makefile.inc |
69 | 69 | ||
70 | ifeq ($(CONFIG_DEBUG),y) |
70 | ifeq ($(CONFIG_DEBUG),y) |
71 | DEFS += -DCONFIG_DEBUG |
71 | DEFS += -DCONFIG_DEBUG |
72 | endif |
72 | endif |
73 | ifeq ($(CONFIG_DEBUG_SPINLOCK),y) |
73 | ifeq ($(CONFIG_DEBUG_SPINLOCK),y) |
74 | DEFS += -DCONFIG_DEBUG_SPINLOCK |
74 | DEFS += -DCONFIG_DEBUG_SPINLOCK |
75 | endif |
75 | endif |
76 | ifeq ($(CONFIG_DEBUG_AS_WATCHPOINT),y) |
76 | ifeq ($(CONFIG_DEBUG_AS_WATCHPOINT),y) |
77 | DEFS += -DCONFIG_DEBUG_AS_WATCHPOINT |
77 | DEFS += -DCONFIG_DEBUG_AS_WATCHPOINT |
78 | endif |
78 | endif |
79 | ifeq ($(CONFIG_FPU_LAZY),y) |
79 | ifeq ($(CONFIG_FPU_LAZY),y) |
80 | DEFS += -DCONFIG_FPU_LAZY |
80 | DEFS += -DCONFIG_FPU_LAZY |
81 | endif |
81 | endif |
82 | ifeq ($(CONFIG_DEBUG_ALLREGS),y) |
82 | ifeq ($(CONFIG_DEBUG_ALLREGS),y) |
83 | DEFS += -DCONFIG_DEBUG_ALLREGS |
83 | DEFS += -DCONFIG_DEBUG_ALLREGS |
84 | endif |
84 | endif |
85 | ifeq ($(CONFIG_VHPT),y) |
85 | ifeq ($(CONFIG_VHPT),y) |
86 | DEFS += -DCONFIG_VHPT |
86 | DEFS += -DCONFIG_VHPT |
87 | endif |
87 | endif |
88 | ifeq ($(CONFIG_POWEROFF),y) |
88 | ifeq ($(CONFIG_POWEROFF),y) |
89 | DEFS += -DCONFIG_POWEROFF |
89 | DEFS += -DCONFIG_POWEROFF |
90 | endif |
90 | endif |
91 | ifeq ($(CONFIG_FB),y) |
91 | ifeq ($(CONFIG_FB),y) |
92 | ifeq ($(ARCH),ia32) |
92 | ifeq ($(ARCH),ia32) |
93 | DEFS += -DCONFIG_VESA_WIDTH=$(CONFIG_VESA_WIDTH) |
93 | DEFS += -DCONFIG_VESA_WIDTH=$(CONFIG_VESA_WIDTH) |
94 | DEFS += -DCONFIG_VESA_HEIGHT=$(CONFIG_VESA_HEIGHT) |
94 | DEFS += -DCONFIG_VESA_HEIGHT=$(CONFIG_VESA_HEIGHT) |
95 | DEFS += -DCONFIG_VESA_BPP=$(CONFIG_VESA_BPP) |
95 | DEFS += -DCONFIG_VESA_BPP=$(CONFIG_VESA_BPP) |
96 | endif |
96 | endif |
97 | ifeq ($(ARCH),amd64) |
97 | ifeq ($(ARCH),amd64) |
98 | DEFS += -DCONFIG_VESA_WIDTH=$(CONFIG_VESA_WIDTH) |
98 | DEFS += -DCONFIG_VESA_WIDTH=$(CONFIG_VESA_WIDTH) |
99 | DEFS += -DCONFIG_VESA_HEIGHT=$(CONFIG_VESA_HEIGHT) |
99 | DEFS += -DCONFIG_VESA_HEIGHT=$(CONFIG_VESA_HEIGHT) |
100 | DEFS += -DCONFIG_VESA_BPP=$(CONFIG_VESA_BPP) |
100 | DEFS += -DCONFIG_VESA_BPP=$(CONFIG_VESA_BPP) |
101 | endif |
101 | endif |
102 | ifeq ($(ARCH),xen32) |
102 | ifeq ($(ARCH),xen32) |
103 | DEFS += -DCONFIG_VESA_WIDTH=$(CONFIG_VESA_WIDTH) |
103 | DEFS += -DCONFIG_VESA_WIDTH=$(CONFIG_VESA_WIDTH) |
104 | DEFS += -DCONFIG_VESA_HEIGHT=$(CONFIG_VESA_HEIGHT) |
104 | DEFS += -DCONFIG_VESA_HEIGHT=$(CONFIG_VESA_HEIGHT) |
105 | DEFS += -DCONFIG_VESA_BPP=$(CONFIG_VESA_BPP) |
105 | DEFS += -DCONFIG_VESA_BPP=$(CONFIG_VESA_BPP) |
106 | endif |
106 | endif |
107 | endif |
107 | endif |
108 | 108 | ||
109 | ## Toolchain configuration |
109 | ## Toolchain configuration |
110 | # |
110 | # |
111 | 111 | ||
112 | ifeq ($(COMPILER),native) |
112 | ifeq ($(COMPILER),native) |
113 | CC = gcc |
113 | CC = gcc |
114 | AS = as |
114 | AS = as |
115 | LD = ld |
115 | LD = ld |
116 | OBJCOPY = objcopy |
116 | OBJCOPY = objcopy |
117 | OBJDUMP = objdump |
117 | OBJDUMP = objdump |
118 | else |
118 | else |
119 | CC = $(TOOLCHAIN_DIR)/$(TARGET)-gcc |
119 | CC = $(TOOLCHAIN_DIR)/$(TARGET)-gcc |
120 | AS = $(TOOLCHAIN_DIR)/$(TARGET)-as |
120 | AS = $(TOOLCHAIN_DIR)/$(TARGET)-as |
121 | LD = $(TOOLCHAIN_DIR)/$(TARGET)-ld |
121 | LD = $(TOOLCHAIN_DIR)/$(TARGET)-ld |
122 | OBJCOPY = $(TOOLCHAIN_DIR)/$(TARGET)-objcopy |
122 | OBJCOPY = $(TOOLCHAIN_DIR)/$(TARGET)-objcopy |
123 | OBJDUMP = $(TOOLCHAIN_DIR)/$(TARGET)-objdump |
123 | OBJDUMP = $(TOOLCHAIN_DIR)/$(TARGET)-objdump |
124 | endif |
124 | endif |
125 | 125 | ||
126 | ## Generic kernel sources |
126 | ## Generic kernel sources |
127 | # |
127 | # |
128 | 128 | ||
129 | GENERIC_SOURCES = \ |
129 | GENERIC_SOURCES = \ |
130 | generic/src/adt/bitmap.c \ |
130 | generic/src/adt/bitmap.c \ |
131 | generic/src/adt/btree.c \ |
131 | generic/src/adt/btree.c \ |
132 | generic/src/adt/hash_table.c \ |
132 | generic/src/adt/hash_table.c \ |
133 | generic/src/adt/list.c \ |
133 | generic/src/adt/list.c \ |
134 | generic/src/console/chardev.c \ |
134 | generic/src/console/chardev.c \ |
135 | generic/src/console/console.c \ |
135 | generic/src/console/console.c \ |
136 | generic/src/console/kconsole.c \ |
136 | generic/src/console/kconsole.c \ |
137 | generic/src/console/klog.c \ |
137 | generic/src/console/klog.c \ |
138 | generic/src/console/cmd.c \ |
138 | generic/src/console/cmd.c \ |
139 | generic/src/cpu/cpu.c \ |
139 | generic/src/cpu/cpu.c \ |
140 | generic/src/ddi/ddi.c \ |
140 | generic/src/ddi/ddi.c \ |
141 | generic/src/interrupt/interrupt.c \ |
141 | generic/src/interrupt/interrupt.c \ |
142 | generic/src/main/main.c \ |
142 | generic/src/main/main.c \ |
143 | generic/src/main/kinit.c \ |
143 | generic/src/main/kinit.c \ |
144 | generic/src/main/uinit.c \ |
144 | generic/src/main/uinit.c \ |
145 | generic/src/main/version.c \ |
145 | generic/src/main/version.c \ |
146 | generic/src/proc/scheduler.c \ |
146 | generic/src/proc/scheduler.c \ |
147 | generic/src/proc/thread.c \ |
147 | generic/src/proc/thread.c \ |
148 | generic/src/proc/task.c \ |
148 | generic/src/proc/task.c \ |
149 | generic/src/proc/the.c \ |
149 | generic/src/proc/the.c \ |
150 | generic/src/syscall/syscall.c \ |
150 | generic/src/syscall/syscall.c \ |
151 | generic/src/syscall/copy.c \ |
151 | generic/src/syscall/copy.c \ |
152 | generic/src/mm/buddy.c \ |
152 | generic/src/mm/buddy.c \ |
153 | generic/src/mm/frame.c \ |
153 | generic/src/mm/frame.c \ |
154 | generic/src/mm/page.c \ |
154 | generic/src/mm/page.c \ |
155 | generic/src/mm/tlb.c \ |
155 | generic/src/mm/tlb.c \ |
156 | generic/src/mm/as.c \ |
156 | generic/src/mm/as.c \ |
157 | generic/src/mm/backend_anon.c \ |
157 | generic/src/mm/backend_anon.c \ |
158 | generic/src/mm/backend_elf.c \ |
158 | generic/src/mm/backend_elf.c \ |
159 | generic/src/mm/backend_phys.c \ |
159 | generic/src/mm/backend_phys.c \ |
160 | generic/src/mm/slab.c \ |
160 | generic/src/mm/slab.c \ |
161 | generic/src/lib/func.c \ |
161 | generic/src/lib/func.c \ |
162 | generic/src/lib/memstr.c \ |
162 | generic/src/lib/memstr.c \ |
163 | generic/src/lib/sort.c \ |
163 | generic/src/lib/sort.c \ |
164 | generic/src/lib/elf.c \ |
164 | generic/src/lib/elf.c \ |
165 | generic/src/printf/printf_core.c \ |
165 | generic/src/printf/printf_core.c \ |
166 | generic/src/printf/printf.c \ |
166 | generic/src/printf/printf.c \ |
167 | generic/src/printf/sprintf.c \ |
167 | generic/src/printf/sprintf.c \ |
168 | generic/src/printf/snprintf.c \ |
168 | generic/src/printf/snprintf.c \ |
169 | generic/src/printf/vprintf.c \ |
169 | generic/src/printf/vprintf.c \ |
170 | generic/src/printf/vsprintf.c \ |
170 | generic/src/printf/vsprintf.c \ |
171 | generic/src/printf/vsnprintf.c \ |
171 | generic/src/printf/vsnprintf.c \ |
172 | generic/src/debug/symtab.c \ |
172 | generic/src/debug/symtab.c \ |
173 | generic/src/time/clock.c \ |
173 | generic/src/time/clock.c \ |
174 | generic/src/time/timeout.c \ |
174 | generic/src/time/timeout.c \ |
175 | generic/src/time/delay.c \ |
175 | generic/src/time/delay.c \ |
176 | generic/src/preempt/preemption.c \ |
176 | generic/src/preempt/preemption.c \ |
177 | generic/src/synch/spinlock.c \ |
177 | generic/src/synch/spinlock.c \ |
178 | generic/src/synch/condvar.c \ |
178 | generic/src/synch/condvar.c \ |
179 | generic/src/synch/rwlock.c \ |
179 | generic/src/synch/rwlock.c \ |
180 | generic/src/synch/mutex.c \ |
180 | generic/src/synch/mutex.c \ |
181 | generic/src/synch/semaphore.c \ |
181 | generic/src/synch/semaphore.c \ |
182 | generic/src/synch/waitq.c \ |
182 | generic/src/synch/waitq.c \ |
183 | generic/src/synch/futex.c \ |
183 | generic/src/synch/futex.c \ |
184 | generic/src/smp/ipi.c \ |
184 | generic/src/smp/ipi.c \ |
185 | generic/src/ipc/ipc.c \ |
185 | generic/src/ipc/ipc.c \ |
186 | generic/src/ipc/sysipc.c \ |
186 | generic/src/ipc/sysipc.c \ |
187 | generic/src/ipc/ipcrsc.c \ |
187 | generic/src/ipc/ipcrsc.c \ |
188 | generic/src/ipc/irq.c \ |
188 | generic/src/ipc/irq.c \ |
189 | generic/src/security/cap.c \ |
189 | generic/src/security/cap.c \ |
190 | generic/src/sysinfo/sysinfo.c |
190 | generic/src/sysinfo/sysinfo.c |
191 | 191 | ||
192 | ## Test sources |
192 | ## Test sources |
193 | # |
193 | # |
194 | 194 | ||
195 | ifneq ($(CONFIG_TEST),) |
195 | ifneq ($(CONFIG_TEST),) |
196 | DEFS += -DCONFIG_TEST |
196 | DEFS += -DCONFIG_TEST |
197 | GENERIC_SOURCES += test/$(CONFIG_TEST)/test.c |
197 | GENERIC_SOURCES += test/$(CONFIG_TEST)/test.c |
198 | endif |
198 | endif |
199 | 199 | ||
200 | GENERIC_OBJECTS := $(addsuffix .o,$(basename $(GENERIC_SOURCES))) |
200 | GENERIC_OBJECTS := $(addsuffix .o,$(basename $(GENERIC_SOURCES))) |
201 | ARCH_OBJECTS := $(addsuffix .o,$(basename $(ARCH_SOURCES))) |
201 | ARCH_OBJECTS := $(addsuffix .o,$(basename $(ARCH_SOURCES))) |
202 | GENARCH_OBJECTS := $(addsuffix .o,$(basename $(GENARCH_SOURCES))) |
202 | GENARCH_OBJECTS := $(addsuffix .o,$(basename $(GENARCH_SOURCES))) |
203 | 203 | ||
204 | .PHONY: all build config distclean clean archlinks depend disasm |
204 | .PHONY: all build config distclean clean archlinks depend disasm |
205 | 205 | ||
206 | all: |
206 | all: |
207 | tools/config.py default $(NARCH) |
207 | tools/config.py default $(NARCH) |
208 | ifdef NARCH |
208 | ifdef NARCH |
209 | ifneq ($(ARCH), $(NARCH)) |
209 | ifneq ($(ARCH), $(NARCH)) |
210 | $(MAKE) -C . clean |
210 | $(MAKE) -C . clean |
211 | endif |
211 | endif |
212 | endif |
212 | endif |
213 | $(MAKE) -C . build |
213 | $(MAKE) -C . build |
214 | 214 | ||
215 | build: kernel.bin disasm |
215 | build: kernel.bin disasm |
216 | 216 | ||
217 | config: |
217 | config: |
218 | -rm Makefile.depend |
218 | -rm Makefile.depend |
219 | tools/config.py |
219 | tools/config.py |
220 | 220 | ||
221 | -include Makefile.depend |
221 | -include Makefile.depend |
222 | 222 | ||
223 | distclean: clean |
223 | distclean: clean |
224 | -rm Makefile.config |
224 | -rm Makefile.config |
225 | 225 | ||
226 | clean: |
226 | clean: |
227 | -rm -f kernel.bin kernel.raw kernel.map kernel.map.pre kernel.objdump kernel.disasm generic/src/debug/real_map.bin Makefile.depend* generic/include/arch generic/include/genarch arch/$(ARCH)/_link.ld |
227 | -rm -f kernel.bin kernel.raw kernel.map kernel.map.pre kernel.objdump kernel.disasm generic/src/debug/real_map.bin Makefile.depend* generic/include/arch generic/include/genarch arch/$(ARCH)/_link.ld |
228 | find generic/src/ arch/*/src/ genarch/src/ test/ -name '*.o' -follow -exec rm \{\} \; |
228 | find generic/src/ arch/*/src/ genarch/src/ test/ -name '*.o' -follow -exec rm \{\} \; |
229 | for arch in arch/*; do \ |
229 | for arch in arch/*; do \ |
230 | [ -e $$arch/_link.ld ] && rm $$arch/_link.ld 2>/dev/null;\ |
230 | [ -e $$arch/_link.ld ] && rm $$arch/_link.ld 2>/dev/null;\ |
231 | done;exit 0 |
231 | done;exit 0 |
232 | 232 | ||
233 | archlinks: |
233 | archlinks: |
234 | ln -sfn ../../arch/$(ARCH)/include/ generic/include/arch |
234 | ln -sfn ../../arch/$(ARCH)/include/ generic/include/arch |
235 | ln -sfn ../../genarch/include/ generic/include/genarch |
235 | ln -sfn ../../genarch/include/ generic/include/genarch |
236 | 236 | ||
237 | depend: archlinks |
237 | depend: archlinks |
238 | -makedepend $(DEFS) $(CFLAGS) -f - $(ARCH_SOURCES) $(GENARCH_SOURCES) $(GENERIC_SOURCES) > Makefile.depend 2> /dev/null |
238 | -makedepend $(DEFS) $(CFLAGS) -f - $(ARCH_SOURCES) $(GENARCH_SOURCES) $(GENERIC_SOURCES) > Makefile.depend 2> /dev/null |
239 | 239 | ||
240 | arch/$(ARCH)/_link.ld: arch/$(ARCH)/_link.ld.in |
240 | arch/$(ARCH)/_link.ld: arch/$(ARCH)/_link.ld.in |
241 | $(CC) $(DEFS) $(CFLAGS) -D__ASM__ -E -x c $< | grep -v "^\#" > $@ |
241 | $(CC) $(DEFS) $(CFLAGS) -D__ASM__ -E -x c $< | grep -v "^\#" > $@ |
242 | 242 | ||
243 | generic/src/debug/real_map.bin: depend arch/$(ARCH)/_link.ld $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) |
243 | generic/src/debug/real_map.bin: depend arch/$(ARCH)/_link.ld $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) |
244 | $(OBJCOPY) -I binary -O $(BFD_NAME) -B $(BFD_ARCH) --prefix-sections=symtab Makefile generic/src/debug/empty_map.o |
244 | $(OBJCOPY) -I binary -O $(BFD_NAME) -B $(BFD_ARCH) --prefix-sections=symtab Makefile generic/src/debug/empty_map.o |
245 | $(LD) -T arch/$(ARCH)/_link.ld $(LFLAGS) $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) generic/src/debug/empty_map.o -o $@ -Map kernel.map.pre |
245 | $(LD) -T arch/$(ARCH)/_link.ld $(LFLAGS) $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) generic/src/debug/empty_map.o -o $@ -Map kernel.map.pre |
246 | $(OBJDUMP) -t $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) > kernel.objdump |
246 | $(OBJDUMP) -t $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) > kernel.objdump |
247 | tools/genmap.py kernel.map.pre kernel.objdump generic/src/debug/real_map.bin |
247 | tools/genmap.py kernel.map.pre kernel.objdump generic/src/debug/real_map.bin |
248 | # Do it once again, this time to get correct even the symbols |
248 | # Do it once again, this time to get correct even the symbols |
249 | # on architectures, that have bss after symtab |
249 | # on architectures, that have bss after symtab |
250 | $(OBJCOPY) -I binary -O $(BFD_NAME) -B $(BFD_ARCH) --prefix-sections=symtab generic/src/debug/real_map.bin generic/src/debug/sizeok_map.o |
250 | $(OBJCOPY) -I binary -O $(BFD_NAME) -B $(BFD_ARCH) --prefix-sections=symtab generic/src/debug/real_map.bin generic/src/debug/sizeok_map.o |
251 | $(LD) -T arch/$(ARCH)/_link.ld $(LFLAGS) $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) generic/src/debug/sizeok_map.o -o $@ -Map kernel.map.pre |
251 | $(LD) -T arch/$(ARCH)/_link.ld $(LFLAGS) $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) generic/src/debug/sizeok_map.o -o $@ -Map kernel.map.pre |
252 | $(OBJDUMP) -t $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) > kernel.objdump |
252 | $(OBJDUMP) -t $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) > kernel.objdump |
253 | tools/genmap.py kernel.map.pre kernel.objdump generic/src/debug/real_map.bin |
253 | tools/genmap.py kernel.map.pre kernel.objdump generic/src/debug/real_map.bin |
254 | 254 | ||
255 | generic/src/debug/real_map.o: generic/src/debug/real_map.bin |
255 | generic/src/debug/real_map.o: generic/src/debug/real_map.bin |
256 | $(OBJCOPY) -I binary -O $(BFD_NAME) -B $(BFD_ARCH) --prefix-sections=symtab $< $@ |
256 | $(OBJCOPY) -I binary -O $(BFD_NAME) -B $(BFD_ARCH) --prefix-sections=symtab $< $@ |
257 | 257 | ||
258 | kernel.raw: depend arch/$(ARCH)/_link.ld $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) generic/src/debug/real_map.o |
258 | kernel.raw: depend arch/$(ARCH)/_link.ld $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) generic/src/debug/real_map.o |
259 | $(LD) -T arch/$(ARCH)/_link.ld $(LFLAGS) $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) generic/src/debug/real_map.o -o $@ -Map kernel.map |
259 | $(LD) -T arch/$(ARCH)/_link.ld $(LFLAGS) $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) generic/src/debug/real_map.o -o $@ -Map kernel.map |
260 | 260 | ||
261 | kernel.bin: kernel.raw |
261 | kernel.bin: kernel.raw |
262 | $(OBJCOPY) -O $(BFD) kernel.raw kernel.bin |
262 | $(OBJCOPY) -O $(BFD) kernel.raw kernel.bin |
263 | 263 | ||
264 | disasm: kernel.raw |
264 | disasm: kernel.raw |
265 | $(OBJDUMP) -d kernel.raw > kernel.disasm |
265 | $(OBJDUMP) -d kernel.raw > kernel.disasm |
266 | 266 | ||
267 | %.o: %.S |
267 | %.o: %.S |
268 | $(CC) $(DEFS) $(CFLAGS) -D__ASM__ -c $< -o $@ |
268 | $(CC) $(DEFS) $(CFLAGS) -D__ASM__ -c $< -o $@ |
269 | 269 | ||
270 | %.o: %.s |
270 | %.o: %.s |
271 | $(AS) $(AFLAGS) $< -o $@ |
271 | $(AS) $(AFLAGS) $< -o $@ |
272 | 272 | ||
273 | %.o: %.c |
273 | %.o: %.c |
274 | $(CC) $(DEFS) $(CFLAGS) -c $< -o $@ |
274 | $(CC) $(DEFS) $(CFLAGS) -c $< -o $@ |
275 | 275 |