Rev 1802 | Rev 1901 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1802 | Rev 1891 | ||
---|---|---|---|
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 | 29 | ||
30 | ## Include configuration |
30 | ## Include configuration |
31 | # |
31 | # |
32 | 32 | ||
33 | -include ../version |
33 | -include ../version |
34 | -include Makefile.config |
34 | -include Makefile.config |
35 | 35 | ||
36 | ## Common compiler flags |
36 | ## Common compiler flags |
37 | # |
37 | # |
38 | 38 | ||
39 | DEFS = -D$(ARCH) -DARCH=\"$(ARCH)\" -DRELEASE=\"$(RELEASE)\" "-DNAME=\"$(NAME)\"" -DKERNEL |
39 | DEFS = -D$(ARCH) -DARCH=\"$(ARCH)\" -DRELEASE=\"$(RELEASE)\" "-DNAME=\"$(NAME)\"" -DKERNEL |
40 | CFLAGS = -fno-builtin -fomit-frame-pointer -Wall -Werror-implicit-function-declaration -Wmissing-prototypes -Werror -O3 -nostdlib -nostdinc -Igeneric/include/ |
40 | CFLAGS = -fno-builtin -fomit-frame-pointer -Wall -Werror-implicit-function-declaration -Wmissing-prototypes -Werror -O3 -nostdlib -nostdinc -Igeneric/include/ |
41 | LFLAGS = -M |
41 | LFLAGS = -M |
42 | AFLAGS = |
42 | AFLAGS = |
43 | 43 | ||
44 | ifdef REVISION |
44 | ifdef REVISION |
45 | DEFS += "-DREVISION=\"$(REVISION)\"" |
45 | DEFS += "-DREVISION=\"$(REVISION)\"" |
46 | endif |
46 | endif |
47 | 47 | ||
48 | ifdef TIMESTAMP |
48 | ifdef TIMESTAMP |
49 | DEFS += "-DTIMESTAMP=\"$(TIMESTAMP)\"" |
49 | DEFS += "-DTIMESTAMP=\"$(TIMESTAMP)\"" |
50 | endif |
50 | endif |
51 | 51 | ||
52 | ## Setup kernel configuration |
52 | ## Setup kernel configuration |
53 | # |
53 | # |
54 | 54 | ||
55 | -include arch/$(ARCH)/Makefile.inc |
55 | -include arch/$(ARCH)/Makefile.inc |
56 | -include genarch/Makefile.inc |
56 | -include genarch/Makefile.inc |
57 | 57 | ||
58 | ifeq ($(CONFIG_DEBUG),y) |
58 | ifeq ($(CONFIG_DEBUG),y) |
59 | DEFS += -DCONFIG_DEBUG |
59 | DEFS += -DCONFIG_DEBUG |
60 | endif |
60 | endif |
61 | 61 | ||
62 | ifeq ($(CONFIG_DEBUG_SPINLOCK),y) |
62 | ifeq ($(CONFIG_DEBUG_SPINLOCK),y) |
63 | DEFS += -DCONFIG_DEBUG_SPINLOCK |
63 | DEFS += -DCONFIG_DEBUG_SPINLOCK |
64 | endif |
64 | endif |
65 | 65 | ||
66 | ifeq ($(CONFIG_DEBUG_AS_WATCHPOINT),y) |
66 | ifeq ($(CONFIG_DEBUG_AS_WATCHPOINT),y) |
67 | DEFS += -DCONFIG_DEBUG_AS_WATCHPOINT |
67 | DEFS += -DCONFIG_DEBUG_AS_WATCHPOINT |
68 | endif |
68 | endif |
69 | 69 | ||
70 | ifeq ($(CONFIG_FPU_LAZY),y) |
70 | ifeq ($(CONFIG_FPU_LAZY),y) |
71 | DEFS += -DCONFIG_FPU_LAZY |
71 | DEFS += -DCONFIG_FPU_LAZY |
72 | endif |
72 | endif |
73 | 73 | ||
74 | ifeq ($(CONFIG_DEBUG_ALLREGS),y) |
74 | ifeq ($(CONFIG_DEBUG_ALLREGS),y) |
75 | DEFS += -DCONFIG_DEBUG_ALLREGS |
75 | DEFS += -DCONFIG_DEBUG_ALLREGS |
76 | endif |
76 | endif |
77 | 77 | ||
78 | ifeq ($(CONFIG_VHPT),y) |
78 | ifeq ($(CONFIG_VHPT),y) |
79 | DEFS += -DCONFIG_VHPT |
79 | DEFS += -DCONFIG_VHPT |
80 | endif |
80 | endif |
81 | 81 | ||
- | 82 | ifeq ($(CONFIG_TSB),y) |
|
- | 83 | DEFS += -DCONFIG_TSB |
|
- | 84 | endif |
|
- | 85 | ||
82 | ifeq ($(CONFIG_POWEROFF),y) |
86 | ifeq ($(CONFIG_POWEROFF),y) |
83 | DEFS += -DCONFIG_POWEROFF |
87 | DEFS += -DCONFIG_POWEROFF |
84 | endif |
88 | endif |
85 | 89 | ||
86 | ifeq ($(CONFIG_FB),y) |
90 | ifeq ($(CONFIG_FB),y) |
87 | ifeq ($(ARCH),ia32) |
91 | ifeq ($(ARCH),ia32) |
88 | DEFS += -DCONFIG_VESA_WIDTH=$(CONFIG_VESA_WIDTH) |
92 | DEFS += -DCONFIG_VESA_WIDTH=$(CONFIG_VESA_WIDTH) |
89 | DEFS += -DCONFIG_VESA_HEIGHT=$(CONFIG_VESA_HEIGHT) |
93 | DEFS += -DCONFIG_VESA_HEIGHT=$(CONFIG_VESA_HEIGHT) |
90 | DEFS += -DCONFIG_VESA_BPP=$(CONFIG_VESA_BPP) |
94 | DEFS += -DCONFIG_VESA_BPP=$(CONFIG_VESA_BPP) |
91 | endif |
95 | endif |
92 | 96 | ||
93 | ifeq ($(ARCH),amd64) |
97 | ifeq ($(ARCH),amd64) |
94 | DEFS += -DCONFIG_VESA_WIDTH=$(CONFIG_VESA_WIDTH) |
98 | DEFS += -DCONFIG_VESA_WIDTH=$(CONFIG_VESA_WIDTH) |
95 | DEFS += -DCONFIG_VESA_HEIGHT=$(CONFIG_VESA_HEIGHT) |
99 | DEFS += -DCONFIG_VESA_HEIGHT=$(CONFIG_VESA_HEIGHT) |
96 | DEFS += -DCONFIG_VESA_BPP=$(CONFIG_VESA_BPP) |
100 | DEFS += -DCONFIG_VESA_BPP=$(CONFIG_VESA_BPP) |
97 | endif |
101 | endif |
98 | 102 | ||
99 | ifeq ($(ARCH),xen32) |
103 | ifeq ($(ARCH),xen32) |
100 | DEFS += -DCONFIG_VESA_WIDTH=$(CONFIG_VESA_WIDTH) |
104 | DEFS += -DCONFIG_VESA_WIDTH=$(CONFIG_VESA_WIDTH) |
101 | DEFS += -DCONFIG_VESA_HEIGHT=$(CONFIG_VESA_HEIGHT) |
105 | DEFS += -DCONFIG_VESA_HEIGHT=$(CONFIG_VESA_HEIGHT) |
102 | DEFS += -DCONFIG_VESA_BPP=$(CONFIG_VESA_BPP) |
106 | DEFS += -DCONFIG_VESA_BPP=$(CONFIG_VESA_BPP) |
103 | endif |
107 | endif |
104 | endif |
108 | endif |
105 | 109 | ||
106 | ## Toolchain configuration |
110 | ## Toolchain configuration |
107 | # |
111 | # |
108 | 112 | ||
109 | ifeq ($(COMPILER),native) |
113 | ifeq ($(COMPILER),native) |
110 | CC = gcc |
114 | CC = gcc |
111 | AS = as |
115 | AS = as |
112 | LD = ld |
116 | LD = ld |
113 | OBJCOPY = objcopy |
117 | OBJCOPY = objcopy |
114 | OBJDUMP = objdump |
118 | OBJDUMP = objdump |
115 | else |
119 | else |
116 | CC = $(TOOLCHAIN_DIR)/$(TARGET)-gcc |
120 | CC = $(TOOLCHAIN_DIR)/$(TARGET)-gcc |
117 | AS = $(TOOLCHAIN_DIR)/$(TARGET)-as |
121 | AS = $(TOOLCHAIN_DIR)/$(TARGET)-as |
118 | LD = $(TOOLCHAIN_DIR)/$(TARGET)-ld |
122 | LD = $(TOOLCHAIN_DIR)/$(TARGET)-ld |
119 | OBJCOPY = $(TOOLCHAIN_DIR)/$(TARGET)-objcopy |
123 | OBJCOPY = $(TOOLCHAIN_DIR)/$(TARGET)-objcopy |
120 | OBJDUMP = $(TOOLCHAIN_DIR)/$(TARGET)-objdump |
124 | OBJDUMP = $(TOOLCHAIN_DIR)/$(TARGET)-objdump |
121 | endif |
125 | endif |
122 | 126 | ||
123 | ## Generic kernel sources |
127 | ## Generic kernel sources |
124 | # |
128 | # |
125 | 129 | ||
126 | GENERIC_SOURCES = \ |
130 | GENERIC_SOURCES = \ |
127 | generic/src/adt/bitmap.c \ |
131 | generic/src/adt/bitmap.c \ |
128 | generic/src/adt/btree.c \ |
132 | generic/src/adt/btree.c \ |
129 | generic/src/adt/hash_table.c \ |
133 | generic/src/adt/hash_table.c \ |
130 | generic/src/adt/list.c \ |
134 | generic/src/adt/list.c \ |
131 | generic/src/console/chardev.c \ |
135 | generic/src/console/chardev.c \ |
132 | generic/src/console/console.c \ |
136 | generic/src/console/console.c \ |
133 | generic/src/console/kconsole.c \ |
137 | generic/src/console/kconsole.c \ |
134 | generic/src/console/klog.c \ |
138 | generic/src/console/klog.c \ |
135 | generic/src/console/cmd.c \ |
139 | generic/src/console/cmd.c \ |
136 | generic/src/cpu/cpu.c \ |
140 | generic/src/cpu/cpu.c \ |
137 | generic/src/ddi/ddi.c \ |
141 | generic/src/ddi/ddi.c \ |
138 | generic/src/interrupt/interrupt.c \ |
142 | generic/src/interrupt/interrupt.c \ |
139 | generic/src/main/main.c \ |
143 | generic/src/main/main.c \ |
140 | generic/src/main/kinit.c \ |
144 | generic/src/main/kinit.c \ |
141 | generic/src/main/uinit.c \ |
145 | generic/src/main/uinit.c \ |
142 | generic/src/main/version.c \ |
146 | generic/src/main/version.c \ |
143 | generic/src/proc/scheduler.c \ |
147 | generic/src/proc/scheduler.c \ |
144 | generic/src/proc/thread.c \ |
148 | generic/src/proc/thread.c \ |
145 | generic/src/proc/task.c \ |
149 | generic/src/proc/task.c \ |
146 | generic/src/proc/the.c \ |
150 | generic/src/proc/the.c \ |
147 | generic/src/syscall/syscall.c \ |
151 | generic/src/syscall/syscall.c \ |
148 | generic/src/syscall/copy.c \ |
152 | generic/src/syscall/copy.c \ |
149 | generic/src/mm/buddy.c \ |
153 | generic/src/mm/buddy.c \ |
150 | generic/src/mm/frame.c \ |
154 | generic/src/mm/frame.c \ |
151 | generic/src/mm/page.c \ |
155 | generic/src/mm/page.c \ |
152 | generic/src/mm/tlb.c \ |
156 | generic/src/mm/tlb.c \ |
153 | generic/src/mm/as.c \ |
157 | generic/src/mm/as.c \ |
154 | generic/src/mm/backend_anon.c \ |
158 | generic/src/mm/backend_anon.c \ |
155 | generic/src/mm/backend_elf.c \ |
159 | generic/src/mm/backend_elf.c \ |
156 | generic/src/mm/backend_phys.c \ |
160 | generic/src/mm/backend_phys.c \ |
157 | generic/src/mm/slab.c \ |
161 | generic/src/mm/slab.c \ |
158 | generic/src/lib/func.c \ |
162 | generic/src/lib/func.c \ |
159 | generic/src/lib/memstr.c \ |
163 | generic/src/lib/memstr.c \ |
160 | generic/src/lib/sort.c \ |
164 | generic/src/lib/sort.c \ |
161 | generic/src/lib/elf.c \ |
165 | generic/src/lib/elf.c \ |
162 | generic/src/printf/printf_core.c \ |
166 | generic/src/printf/printf_core.c \ |
163 | generic/src/printf/printf.c \ |
167 | generic/src/printf/printf.c \ |
164 | generic/src/printf/sprintf.c \ |
168 | generic/src/printf/sprintf.c \ |
165 | generic/src/printf/snprintf.c \ |
169 | generic/src/printf/snprintf.c \ |
166 | generic/src/printf/vprintf.c \ |
170 | generic/src/printf/vprintf.c \ |
167 | generic/src/printf/vsprintf.c \ |
171 | generic/src/printf/vsprintf.c \ |
168 | generic/src/printf/vsnprintf.c \ |
172 | generic/src/printf/vsnprintf.c \ |
169 | generic/src/debug/symtab.c \ |
173 | generic/src/debug/symtab.c \ |
170 | generic/src/time/clock.c \ |
174 | generic/src/time/clock.c \ |
171 | generic/src/time/timeout.c \ |
175 | generic/src/time/timeout.c \ |
172 | generic/src/time/delay.c \ |
176 | generic/src/time/delay.c \ |
173 | generic/src/preempt/preemption.c \ |
177 | generic/src/preempt/preemption.c \ |
174 | generic/src/synch/spinlock.c \ |
178 | generic/src/synch/spinlock.c \ |
175 | generic/src/synch/condvar.c \ |
179 | generic/src/synch/condvar.c \ |
176 | generic/src/synch/rwlock.c \ |
180 | generic/src/synch/rwlock.c \ |
177 | generic/src/synch/mutex.c \ |
181 | generic/src/synch/mutex.c \ |
178 | generic/src/synch/semaphore.c \ |
182 | generic/src/synch/semaphore.c \ |
179 | generic/src/synch/waitq.c \ |
183 | generic/src/synch/waitq.c \ |
180 | generic/src/synch/futex.c \ |
184 | generic/src/synch/futex.c \ |
181 | generic/src/smp/ipi.c \ |
185 | generic/src/smp/ipi.c \ |
182 | generic/src/ipc/ipc.c \ |
186 | generic/src/ipc/ipc.c \ |
183 | generic/src/ipc/sysipc.c \ |
187 | generic/src/ipc/sysipc.c \ |
184 | generic/src/ipc/ipcrsc.c \ |
188 | generic/src/ipc/ipcrsc.c \ |
185 | generic/src/ipc/irq.c \ |
189 | generic/src/ipc/irq.c \ |
186 | generic/src/security/cap.c \ |
190 | generic/src/security/cap.c \ |
187 | generic/src/sysinfo/sysinfo.c |
191 | generic/src/sysinfo/sysinfo.c |
188 | 192 | ||
189 | ## Test sources |
193 | ## Test sources |
190 | # |
194 | # |
191 | 195 | ||
192 | ifneq ($(CONFIG_TEST),) |
196 | ifneq ($(CONFIG_TEST),) |
193 | DEFS += -DCONFIG_TEST |
197 | DEFS += -DCONFIG_TEST |
194 | GENERIC_SOURCES += test/$(CONFIG_TEST)/test.c |
198 | GENERIC_SOURCES += test/$(CONFIG_TEST)/test.c |
195 | endif |
199 | endif |
196 | 200 | ||
197 | GENERIC_OBJECTS := $(addsuffix .o,$(basename $(GENERIC_SOURCES))) |
201 | GENERIC_OBJECTS := $(addsuffix .o,$(basename $(GENERIC_SOURCES))) |
198 | ARCH_OBJECTS := $(addsuffix .o,$(basename $(ARCH_SOURCES))) |
202 | ARCH_OBJECTS := $(addsuffix .o,$(basename $(ARCH_SOURCES))) |
199 | GENARCH_OBJECTS := $(addsuffix .o,$(basename $(GENARCH_SOURCES))) |
203 | GENARCH_OBJECTS := $(addsuffix .o,$(basename $(GENARCH_SOURCES))) |
200 | 204 | ||
201 | .PHONY: all build config distclean clean archlinks depend disasm |
205 | .PHONY: all build config distclean clean archlinks depend disasm |
202 | 206 | ||
203 | all: |
207 | all: |
204 | ../tools/config.py kernel.config default $(ARCH) $(COMPILER) $(CONFIG_DEBUG) $(MACHINE) |
208 | ../tools/config.py kernel.config default $(ARCH) $(COMPILER) $(CONFIG_DEBUG) $(MACHINE) |
205 | $(MAKE) -C . build |
209 | $(MAKE) -C . build |
206 | 210 | ||
207 | build: kernel.bin disasm |
211 | build: kernel.bin disasm |
208 | 212 | ||
209 | config: |
213 | config: |
210 | -rm Makefile.depend |
214 | -rm Makefile.depend |
211 | tools/config.py kernel.config |
215 | tools/config.py kernel.config |
212 | 216 | ||
213 | -include Makefile.depend |
217 | -include Makefile.depend |
214 | 218 | ||
215 | distclean: clean |
219 | distclean: clean |
216 | -rm Makefile.config |
220 | -rm Makefile.config |
217 | 221 | ||
218 | clean: |
222 | clean: |
219 | -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 |
223 | -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 |
220 | find generic/src/ arch/*/src/ genarch/src/ test/ -name '*.o' -follow -exec rm \{\} \; |
224 | find generic/src/ arch/*/src/ genarch/src/ test/ -name '*.o' -follow -exec rm \{\} \; |
221 | for arch in arch/* ; do \ |
225 | for arch in arch/* ; do \ |
222 | [ -e $$arch/_link.ld ] && rm $$arch/_link.ld 2>/dev/null ; \ |
226 | [ -e $$arch/_link.ld ] && rm $$arch/_link.ld 2>/dev/null ; \ |
223 | done ; exit 0 |
227 | done ; exit 0 |
224 | 228 | ||
225 | archlinks: |
229 | archlinks: |
226 | ln -sfn ../../arch/$(ARCH)/include/ generic/include/arch |
230 | ln -sfn ../../arch/$(ARCH)/include/ generic/include/arch |
227 | ln -sfn ../../genarch/include/ generic/include/genarch |
231 | ln -sfn ../../genarch/include/ generic/include/genarch |
228 | 232 | ||
229 | depend: archlinks |
233 | depend: archlinks |
230 | -makedepend $(DEFS) $(CFLAGS) -f - $(ARCH_SOURCES) $(GENARCH_SOURCES) $(GENERIC_SOURCES) > Makefile.depend 2> /dev/null |
234 | -makedepend $(DEFS) $(CFLAGS) -f - $(ARCH_SOURCES) $(GENARCH_SOURCES) $(GENERIC_SOURCES) > Makefile.depend 2> /dev/null |
231 | 235 | ||
232 | arch/$(ARCH)/_link.ld: arch/$(ARCH)/_link.ld.in |
236 | arch/$(ARCH)/_link.ld: arch/$(ARCH)/_link.ld.in |
233 | $(CC) $(DEFS) $(CFLAGS) -D__ASM__ -E -x c $< | grep -v "^\#" > $@ |
237 | $(CC) $(DEFS) $(CFLAGS) -D__ASM__ -E -x c $< | grep -v "^\#" > $@ |
234 | 238 | ||
235 | generic/src/debug/real_map.bin: depend arch/$(ARCH)/_link.ld $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) |
239 | generic/src/debug/real_map.bin: depend arch/$(ARCH)/_link.ld $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) |
236 | $(OBJCOPY) -I binary -O $(BFD_NAME) -B $(BFD_ARCH) --prefix-sections=symtab Makefile generic/src/debug/empty_map.o |
240 | $(OBJCOPY) -I binary -O $(BFD_NAME) -B $(BFD_ARCH) --prefix-sections=symtab Makefile generic/src/debug/empty_map.o |
237 | $(LD) -T arch/$(ARCH)/_link.ld $(LFLAGS) $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) generic/src/debug/empty_map.o -o $@ -Map kernel.map.pre |
241 | $(LD) -T arch/$(ARCH)/_link.ld $(LFLAGS) $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) generic/src/debug/empty_map.o -o $@ -Map kernel.map.pre |
238 | $(OBJDUMP) -t $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) > kernel.objdump |
242 | $(OBJDUMP) -t $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) > kernel.objdump |
239 | tools/genmap.py kernel.map.pre kernel.objdump generic/src/debug/real_map.bin |
243 | tools/genmap.py kernel.map.pre kernel.objdump generic/src/debug/real_map.bin |
240 | # Do it once again, this time to get correct even the symbols |
244 | # Do it once again, this time to get correct even the symbols |
241 | # on architectures, that have bss after symtab |
245 | # on architectures, that have bss after symtab |
242 | $(OBJCOPY) -I binary -O $(BFD_NAME) -B $(BFD_ARCH) --prefix-sections=symtab generic/src/debug/real_map.bin generic/src/debug/sizeok_map.o |
246 | $(OBJCOPY) -I binary -O $(BFD_NAME) -B $(BFD_ARCH) --prefix-sections=symtab generic/src/debug/real_map.bin generic/src/debug/sizeok_map.o |
243 | $(LD) -T arch/$(ARCH)/_link.ld $(LFLAGS) $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) generic/src/debug/sizeok_map.o -o $@ -Map kernel.map.pre |
247 | $(LD) -T arch/$(ARCH)/_link.ld $(LFLAGS) $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) generic/src/debug/sizeok_map.o -o $@ -Map kernel.map.pre |
244 | $(OBJDUMP) -t $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) > kernel.objdump |
248 | $(OBJDUMP) -t $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) > kernel.objdump |
245 | tools/genmap.py kernel.map.pre kernel.objdump generic/src/debug/real_map.bin |
249 | tools/genmap.py kernel.map.pre kernel.objdump generic/src/debug/real_map.bin |
246 | 250 | ||
247 | generic/src/debug/real_map.o: generic/src/debug/real_map.bin |
251 | generic/src/debug/real_map.o: generic/src/debug/real_map.bin |
248 | $(OBJCOPY) -I binary -O $(BFD_NAME) -B $(BFD_ARCH) --prefix-sections=symtab $< $@ |
252 | $(OBJCOPY) -I binary -O $(BFD_NAME) -B $(BFD_ARCH) --prefix-sections=symtab $< $@ |
249 | 253 | ||
250 | kernel.raw: depend arch/$(ARCH)/_link.ld $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) generic/src/debug/real_map.o |
254 | kernel.raw: depend arch/$(ARCH)/_link.ld $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) generic/src/debug/real_map.o |
251 | $(LD) -T arch/$(ARCH)/_link.ld $(LFLAGS) $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) generic/src/debug/real_map.o -o $@ -Map kernel.map |
255 | $(LD) -T arch/$(ARCH)/_link.ld $(LFLAGS) $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) generic/src/debug/real_map.o -o $@ -Map kernel.map |
252 | 256 | ||
253 | kernel.bin: kernel.raw |
257 | kernel.bin: kernel.raw |
254 | $(OBJCOPY) -O $(BFD) kernel.raw kernel.bin |
258 | $(OBJCOPY) -O $(BFD) kernel.raw kernel.bin |
255 | 259 | ||
256 | disasm: kernel.raw |
260 | disasm: kernel.raw |
257 | $(OBJDUMP) -d kernel.raw > kernel.disasm |
261 | $(OBJDUMP) -d kernel.raw > kernel.disasm |
258 | 262 | ||
259 | %.o: %.S |
263 | %.o: %.S |
260 | $(CC) $(DEFS) $(CFLAGS) -D__ASM__ -c $< -o $@ |
264 | $(CC) $(DEFS) $(CFLAGS) -D__ASM__ -c $< -o $@ |
261 | 265 | ||
262 | %.o: %.s |
266 | %.o: %.s |
263 | $(AS) $(AFLAGS) $< -o $@ |
267 | $(AS) $(AFLAGS) $< -o $@ |
264 | 268 | ||
265 | %.o: %.c |
269 | %.o: %.c |
266 | $(CC) $(DEFS) $(CFLAGS) -c $< -o $@ |
270 | $(CC) $(DEFS) $(CFLAGS) -c $< -o $@ |
267 | 271 |