[e16e036a] | 1 | #
|
---|
[df4ed85] | 2 | # Copyright (c) 2005 Martin Decky
|
---|
[e16e036a] | 3 | # All rights reserved.
|
---|
| 4 | #
|
---|
| 5 | # Redistribution and use in source and binary forms, with or without
|
---|
| 6 | # modification, are permitted provided that the following conditions
|
---|
| 7 | # are met:
|
---|
| 8 | #
|
---|
| 9 | # - Redistributions of source code must retain the above copyright
|
---|
| 10 | # notice, this list of conditions and the following disclaimer.
|
---|
| 11 | # - Redistributions in binary form must reproduce the above copyright
|
---|
| 12 | # notice, this list of conditions and the following disclaimer in the
|
---|
| 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
|
---|
| 15 | # derived from this software without specific prior written permission.
|
---|
| 16 | #
|
---|
| 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
|
---|
| 19 | # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
---|
| 20 | # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
---|
| 21 | # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
---|
| 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
|
---|
| 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
|
---|
| 26 | # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
---|
| 27 | #
|
---|
| 28 |
|
---|
| 29 |
|
---|
[9371c30] | 30 | ## Include configuration
|
---|
[e16e036a] | 31 | #
|
---|
| 32 |
|
---|
[9a0367f] | 33 | include ../version
|
---|
| 34 | -include ../Makefile.config
|
---|
[98a4e76] | 35 | -include ../config.defs
|
---|
[e16e036a] | 36 |
|
---|
[44bec47] | 37 | INCLUDES = generic/include
|
---|
[eb1c0a3] | 38 | OPTIMIZATION = 3
|
---|
[44bec47] | 39 |
|
---|
[98a4e76] | 40 | ifndef CROSS_PREFIX
|
---|
| 41 | CROSS_PREFIX = /usr/local
|
---|
| 42 | endif
|
---|
| 43 |
|
---|
[e16e036a] | 44 | ## Common compiler flags
|
---|
| 45 | #
|
---|
| 46 |
|
---|
[98a4e76] | 47 | DEFS = -DKERNEL -DRELEASE=$(RELEASE) "-DNAME=$(NAME)"
|
---|
[52d30c4] | 48 |
|
---|
[98a4e76] | 49 | GCC_CFLAGS = -I$(INCLUDES) -O$(OPTIMIZATION) -imacros ../config.h \
|
---|
[18ad03f3] | 50 | -fno-builtin -Wall -Wextra -Wno-unused-parameter -Wmissing-prototypes -Werror \
|
---|
[6198611] | 51 | -nostdlib -nostdinc -pipe
|
---|
[44bec47] | 52 |
|
---|
[98a4e76] | 53 | ICC_CFLAGS = -I$(INCLUDES) -O$(OPTIMIZATION) -imacros ../config.h \
|
---|
[18ad03f3] | 54 | -fno-builtin -Wall -Wmissing-prototypes -Werror \
|
---|
[44bec47] | 55 | -nostdlib -nostdinc \
|
---|
| 56 | -wd170
|
---|
[52d30c4] | 57 |
|
---|
[44bec47] | 58 | SUNCC_CFLAGS = -I$(INCLUDES) -xO$(OPTIMIZATION) \
|
---|
[3ee8a075] | 59 | -xnolib -xc99=all -features=extensions \
|
---|
[52d30c4] | 60 | -erroff=E_ZERO_SIZED_STRUCT_UNION
|
---|
[92d349c8] | 61 |
|
---|
[e16e036a] | 62 | LFLAGS = -M
|
---|
[ba22dcb] | 63 | AFLAGS =
|
---|
| 64 |
|
---|
[98a4e76] | 65 | -include arch/$(KARCH)/Makefile.inc
|
---|
[839470f] | 66 | -include genarch/Makefile.inc
|
---|
[c9ed176] | 67 |
|
---|
[1314e3b] | 68 | ## The at-sign
|
---|
| 69 | #
|
---|
[bcfd586] | 70 | # The $(ATSIGN) variable holds the ASCII character representing the at-sign
|
---|
[1314e3b] | 71 | # ('@') used in various $(AS) constructs (e.g. @progbits). On architectures that
|
---|
| 72 | # don't use '@' for starting a comment, $(ATSIGN) is merely '@'. However, on
|
---|
| 73 | # those that do use it for starting a comment (e.g. arm32), $(ATSIGN) must be
|
---|
| 74 | # defined as the percentile-sign ('%') in the architecture-dependent
|
---|
| 75 | # Makefile.inc.
|
---|
| 76 | #
|
---|
| 77 | ATSIGN ?= @
|
---|
| 78 |
|
---|
| 79 | ## Cross-platform assembly to start a symtab.data section
|
---|
| 80 | #
|
---|
| 81 | SYMTAB_SECTION=".section symtab.data, \"a\", $(ATSIGN)progbits;"
|
---|
| 82 |
|
---|
[f5b4fb9] | 83 | ## Simple detection for the type of the host system
|
---|
| 84 | #
|
---|
| 85 | HOST = $(shell uname)
|
---|
| 86 |
|
---|
| 87 | ## On Solaris, some utilities have slightly different names
|
---|
| 88 | #
|
---|
| 89 | ifeq ($(HOST),SunOS)
|
---|
| 90 | BINUTILS_PREFIX = "g"
|
---|
| 91 | else
|
---|
| 92 | BINUTILS_PREFIX = ""
|
---|
| 93 | endif
|
---|
| 94 |
|
---|
[e16e036a] | 95 | ## Toolchain configuration
|
---|
| 96 | #
|
---|
| 97 |
|
---|
[c31e536] | 98 | ifeq ($(COMPILER),gcc_native)
|
---|
[e16e036a] | 99 | CC = gcc
|
---|
[4a8635b] | 100 | GCC = gcc
|
---|
[f5b4fb9] | 101 | AS = $(BINUTILS_PREFIX)as
|
---|
| 102 | LD = $(BINUTILS_PREFIX)ld
|
---|
| 103 | OBJCOPY = $(BINUTILS_PREFIX)objcopy
|
---|
| 104 | OBJDUMP = $(BINUTILS_PREFIX)objdump
|
---|
[bd1deed] | 105 | LIBDIR = /usr/lib
|
---|
[52d30c4] | 106 | CFLAGS = $(GCC_CFLAGS)
|
---|
[98a4e76] | 107 | DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS)
|
---|
[c31e536] | 108 | endif
|
---|
| 109 |
|
---|
| 110 | ifeq ($(COMPILER),icc_native)
|
---|
| 111 | CC = icc
|
---|
[4a8635b] | 112 | GCC = gcc
|
---|
[c31e536] | 113 | AS = as
|
---|
| 114 | LD = ld
|
---|
| 115 | OBJCOPY = objcopy
|
---|
| 116 | OBJDUMP = objdump
|
---|
| 117 | LIBDIR = /usr/lib
|
---|
[44bec47] | 118 | CFLAGS = $(ICC_CFLAGS)
|
---|
[98a4e76] | 119 | DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS)
|
---|
[c31e536] | 120 | endif
|
---|
| 121 |
|
---|
[1e847fb] | 122 | ifeq ($(COMPILER),suncc_native)
|
---|
| 123 | CC = suncc
|
---|
[4a8635b] | 124 | GCC = gcc
|
---|
[f5b4fb9] | 125 | AS = $(BINUTILS_PREFIX)as
|
---|
| 126 | LD = $(BINUTILS_PREFIX)ld
|
---|
| 127 | OBJCOPY = $(BINUTILS_PREFIX)objcopy
|
---|
| 128 | OBJDUMP = $(BINUTILS_PREFIX)objdump
|
---|
[1e847fb] | 129 | LIBDIR = /usr/lib
|
---|
[52d30c4] | 130 | CFLAGS = $(SUNCC_CFLAGS)
|
---|
[98a4e76] | 131 | DEFS += $(CONFIG_DEFS)
|
---|
| 132 | DEPEND_DEFS = $(DEFS)
|
---|
[1e847fb] | 133 | endif
|
---|
| 134 |
|
---|
[c31e536] | 135 | ifeq ($(COMPILER),gcc_cross)
|
---|
[bd1deed] | 136 | CC = $(TOOLCHAIN_DIR)/bin/$(TARGET)-gcc
|
---|
[4a8635b] | 137 | GCC = $(CC)
|
---|
[bd1deed] | 138 | AS = $(TOOLCHAIN_DIR)/bin/$(TARGET)-as
|
---|
| 139 | LD = $(TOOLCHAIN_DIR)/bin/$(TARGET)-ld
|
---|
| 140 | OBJCOPY = $(TOOLCHAIN_DIR)/bin/$(TARGET)-objcopy
|
---|
| 141 | OBJDUMP = $(TOOLCHAIN_DIR)/bin/$(TARGET)-objdump
|
---|
| 142 | LIBDIR = $(TOOLCHAIN_DIR)/lib
|
---|
[52d30c4] | 143 | CFLAGS = $(GCC_CFLAGS)
|
---|
[98a4e76] | 144 | DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS)
|
---|
[e16e036a] | 145 | endif
|
---|
| 146 |
|
---|
| 147 | ## Generic kernel sources
|
---|
| 148 | #
|
---|
| 149 |
|
---|
| 150 | GENERIC_SOURCES = \
|
---|
[0d65d76] | 151 | generic/src/adt/avl.c \
|
---|
[97a7eff] | 152 | generic/src/adt/bitmap.c \
|
---|
[018d957e] | 153 | generic/src/adt/btree.c \
|
---|
[c585827] | 154 | generic/src/adt/hash_table.c \
|
---|
[5c9a08b] | 155 | generic/src/adt/list.c \
|
---|
[2677758] | 156 | generic/src/console/chardev.c \
|
---|
| 157 | generic/src/console/console.c \
|
---|
[e16e036a] | 158 | generic/src/cpu/cpu.c \
|
---|
[9a8d91b] | 159 | generic/src/ddi/ddi.c \
|
---|
[7dcf22a] | 160 | generic/src/ddi/irq.c \
|
---|
| 161 | generic/src/ddi/device.c \
|
---|
[973be64e] | 162 | generic/src/interrupt/interrupt.c \
|
---|
[169c408] | 163 | generic/src/main/main.c \
|
---|
| 164 | generic/src/main/kinit.c \
|
---|
| 165 | generic/src/main/uinit.c \
|
---|
[0132630] | 166 | generic/src/main/version.c \
|
---|
[f74bbaf] | 167 | generic/src/main/shutdown.c \
|
---|
[c98e6ee] | 168 | generic/src/proc/program.c \
|
---|
[169c408] | 169 | generic/src/proc/scheduler.c \
|
---|
| 170 | generic/src/proc/thread.c \
|
---|
| 171 | generic/src/proc/task.c \
|
---|
| 172 | generic/src/proc/the.c \
|
---|
[56976a17] | 173 | generic/src/proc/tasklet.c \
|
---|
[a59e81e] | 174 | generic/src/syscall/syscall.c \
|
---|
[e3c762cd] | 175 | generic/src/syscall/copy.c \
|
---|
[169c408] | 176 | generic/src/mm/buddy.c \
|
---|
| 177 | generic/src/mm/frame.c \
|
---|
| 178 | generic/src/mm/page.c \
|
---|
| 179 | generic/src/mm/tlb.c \
|
---|
[20d50a1] | 180 | generic/src/mm/as.c \
|
---|
[0ee077ee] | 181 | generic/src/mm/backend_anon.c \
|
---|
| 182 | generic/src/mm/backend_elf.c \
|
---|
| 183 | generic/src/mm/backend_phys.c \
|
---|
[4e147a6] | 184 | generic/src/mm/slab.c \
|
---|
[169c408] | 185 | generic/src/lib/func.c \
|
---|
| 186 | generic/src/lib/memstr.c \
|
---|
| 187 | generic/src/lib/sort.c \
|
---|
[16da5f8e] | 188 | generic/src/lib/string.c \
|
---|
[de6b301] | 189 | generic/src/lib/elf.c \
|
---|
[d4b5542] | 190 | generic/src/lib/rd.c \
|
---|
[6445baf] | 191 | generic/src/printf/printf_core.c \
|
---|
| 192 | generic/src/printf/printf.c \
|
---|
| 193 | generic/src/printf/sprintf.c \
|
---|
| 194 | generic/src/printf/snprintf.c \
|
---|
| 195 | generic/src/printf/vprintf.c \
|
---|
| 196 | generic/src/printf/vsprintf.c \
|
---|
| 197 | generic/src/printf/vsnprintf.c \
|
---|
[169c408] | 198 | generic/src/debug/symtab.c \
|
---|
| 199 | generic/src/time/clock.c \
|
---|
| 200 | generic/src/time/timeout.c \
|
---|
| 201 | generic/src/time/delay.c \
|
---|
| 202 | generic/src/preempt/preemption.c \
|
---|
| 203 | generic/src/synch/spinlock.c \
|
---|
| 204 | generic/src/synch/condvar.c \
|
---|
| 205 | generic/src/synch/rwlock.c \
|
---|
| 206 | generic/src/synch/mutex.c \
|
---|
| 207 | generic/src/synch/semaphore.c \
|
---|
[c98e6ee] | 208 | generic/src/synch/smc.c \
|
---|
[169c408] | 209 | generic/src/synch/waitq.c \
|
---|
[9aa72b4] | 210 | generic/src/synch/futex.c \
|
---|
[6d9c49a] | 211 | generic/src/smp/ipi.c \
|
---|
[26678e5] | 212 | generic/src/smp/smp.c \
|
---|
[e74cb73] | 213 | generic/src/ipc/ipc.c \
|
---|
[4e49572] | 214 | generic/src/ipc/sysipc.c \
|
---|
[1077d91] | 215 | generic/src/ipc/ipcrsc.c \
|
---|
[162f919] | 216 | generic/src/ipc/irq.c \
|
---|
[2666daa] | 217 | generic/src/security/cap.c \
|
---|
| 218 | generic/src/sysinfo/sysinfo.c
|
---|
[bbf5657] | 219 |
|
---|
[4406fd65] | 220 | ## Kernel console support
|
---|
| 221 | #
|
---|
| 222 |
|
---|
| 223 | ifeq ($(CONFIG_KCONSOLE),y)
|
---|
| 224 | GENERIC_SOURCES += \
|
---|
| 225 | generic/src/console/kconsole.c \
|
---|
| 226 | generic/src/console/cmd.c
|
---|
| 227 | endif
|
---|
| 228 |
|
---|
[9a1b20c] | 229 | ## Udebug interface sources
|
---|
| 230 | #
|
---|
| 231 |
|
---|
| 232 | ifeq ($(CONFIG_UDEBUG),y)
|
---|
| 233 | GENERIC_SOURCES += \
|
---|
[e028660] | 234 | generic/src/ipc/kbox.c \
|
---|
[9a1b20c] | 235 | generic/src/udebug/udebug.c \
|
---|
| 236 | generic/src/udebug/udebug_ops.c \
|
---|
| 237 | generic/src/udebug/udebug_ipc.c
|
---|
| 238 | endif
|
---|
| 239 |
|
---|
[36a140b] | 240 | ## Test sources
|
---|
| 241 | #
|
---|
| 242 |
|
---|
[50661ab] | 243 | ifeq ($(CONFIG_TEST),y)
|
---|
[319e60e] | 244 | CFLAGS += -Itest/
|
---|
| 245 | GENERIC_SOURCES += \
|
---|
| 246 | test/test.c \
|
---|
[50661ab] | 247 | test/atomic/atomic1.c \
|
---|
| 248 | test/btree/btree1.c \
|
---|
[0d65d76] | 249 | test/avltree/avltree1.c \
|
---|
[50661ab] | 250 | test/fault/fault1.c \
|
---|
[f272cb8] | 251 | test/mm/falloc1.c \
|
---|
| 252 | test/mm/falloc2.c \
|
---|
| 253 | test/mm/mapping1.c \
|
---|
| 254 | test/mm/slab1.c \
|
---|
| 255 | test/mm/slab2.c \
|
---|
[70b6de1] | 256 | test/synch/rwlock1.c \
|
---|
| 257 | test/synch/rwlock2.c \
|
---|
| 258 | test/synch/rwlock3.c \
|
---|
| 259 | test/synch/rwlock4.c \
|
---|
| 260 | test/synch/rwlock5.c \
|
---|
| 261 | test/synch/semaphore1.c \
|
---|
| 262 | test/synch/semaphore2.c \
|
---|
| 263 | test/print/print1.c \
|
---|
| 264 | test/thread/thread1.c \
|
---|
| 265 | test/sysinfo/sysinfo1.c
|
---|
[98a4e76] | 266 |
|
---|
[17f168e] | 267 | ifeq ($(KARCH),mips32)
|
---|
| 268 | GENERIC_SOURCES += test/debug/mips1.c
|
---|
| 269 | else
|
---|
| 270 | GENERIC_SOURCES += test/debug/mips1_skip.c
|
---|
| 271 | endif
|
---|
| 272 |
|
---|
| 273 | ifeq ($(KARCH),ia64)
|
---|
| 274 | GENERIC_SOURCES += test/mm/purge1.c
|
---|
| 275 | else
|
---|
| 276 | GENERIC_SOURCES += test/mm/purge1_skip.c
|
---|
| 277 | endif
|
---|
| 278 |
|
---|
[98a4e76] | 279 | ifeq ($(CONFIG_FPU),y)
|
---|
| 280 | ifeq ($(KARCH),ia32)
|
---|
| 281 | TEST_FPU1 = y
|
---|
| 282 | TEST_SSE1 = y
|
---|
[e45a3b9] | 283 | GENERIC_SOURCES += test/fpu/fpu1_x86.c
|
---|
[98a4e76] | 284 | endif
|
---|
| 285 |
|
---|
| 286 | ifeq ($(KARCH),amd64)
|
---|
| 287 | TEST_FPU1 = y
|
---|
| 288 | TEST_SSE1 = y
|
---|
[e45a3b9] | 289 | GENERIC_SOURCES += test/fpu/fpu1_x86.c
|
---|
[98a4e76] | 290 | endif
|
---|
| 291 |
|
---|
| 292 | ifeq ($(KARCH),ia64)
|
---|
| 293 | TEST_FPU1 = y
|
---|
[e45a3b9] | 294 | GENERIC_SOURCES += test/fpu/fpu1_ia64.c
|
---|
[98a4e76] | 295 | endif
|
---|
| 296 |
|
---|
| 297 | ifeq ($(KARCH),mips32)
|
---|
| 298 | TEST_MIPS2 = y
|
---|
| 299 | endif
|
---|
| 300 | endif
|
---|
| 301 |
|
---|
[e45a3b9] | 302 | ifneq ($(TEST_FPU1),y)
|
---|
[98a4e76] | 303 | GENERIC_SOURCES += test/fpu/fpu1_skip.c
|
---|
| 304 | endif
|
---|
| 305 |
|
---|
| 306 | ifeq ($(TEST_SSE1),y)
|
---|
| 307 | GENERIC_SOURCES += test/fpu/sse1.c
|
---|
| 308 | else
|
---|
| 309 | GENERIC_SOURCES += test/fpu/sse1_skip.c
|
---|
| 310 | endif
|
---|
| 311 |
|
---|
| 312 | ifeq ($(TEST_MIPS2),y)
|
---|
| 313 | GENERIC_SOURCES += test/fpu/mips2.c
|
---|
| 314 | else
|
---|
| 315 | GENERIC_SOURCES += test/fpu/mips2_skip.c
|
---|
| 316 | endif
|
---|
| 317 |
|
---|
[36a140b] | 318 | endif
|
---|
| 319 |
|
---|
[e16e036a] | 320 | GENERIC_OBJECTS := $(addsuffix .o,$(basename $(GENERIC_SOURCES)))
|
---|
| 321 | ARCH_OBJECTS := $(addsuffix .o,$(basename $(ARCH_SOURCES)))
|
---|
| 322 | GENARCH_OBJECTS := $(addsuffix .o,$(basename $(GENARCH_SOURCES)))
|
---|
[c9ed176] | 323 |
|
---|
[9a0367f] | 324 | .PHONY: all build clean archlinks depend disasm
|
---|
[c9ed176] | 325 |
|
---|
[98a4e76] | 326 | all: ../Makefile.config ../config.h ../config.defs
|
---|
[9a0367f] | 327 | -rm Makefile.depend
|
---|
[940cac0] | 328 | $(MAKE) -C . build
|
---|
[839470f] | 329 |
|
---|
[b629483] | 330 | build: kernel.bin disasm
|
---|
[839470f] | 331 |
|
---|
[c9ed176] | 332 | -include Makefile.depend
|
---|
| 333 |
|
---|
[e16e036a] | 334 | clean:
|
---|
[98a4e76] | 335 | -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/$(KARCH)/_link.ld
|
---|
[839470f] | 336 | find generic/src/ arch/*/src/ genarch/src/ test/ -name '*.o' -follow -exec rm \{\} \;
|
---|
[41f7564] | 337 | for arch in arch/* ; do \
|
---|
| 338 | [ -e $$arch/_link.ld ] && rm $$arch/_link.ld 2>/dev/null ; \
|
---|
| 339 | done ; exit 0
|
---|
[c9ed176] | 340 |
|
---|
[839470f] | 341 | archlinks:
|
---|
[98a4e76] | 342 | ln -sfn ../../arch/$(KARCH)/include/ generic/include/arch
|
---|
[e16e036a] | 343 | ln -sfn ../../genarch/include/ generic/include/genarch
|
---|
[c9ed176] | 344 |
|
---|
[6095342] | 345 | depend: archlinks
|
---|
[98a4e76] | 346 | -makedepend -f - -- $(DEPEND_DEFS) $(CFLAGS) -- $(ARCH_SOURCES) $(GENARCH_SOURCES) $(GENERIC_SOURCES) > Makefile.depend 2> /dev/null
|
---|
[c9ed176] | 347 |
|
---|
[98a4e76] | 348 | arch/$(KARCH)/_link.ld: arch/$(KARCH)/_link.ld.in
|
---|
[4a8635b] | 349 | $(GCC) $(DEFS) $(GCC_CFLAGS) -D__ASM__ -D__LINKER__ -E -x c $< | grep -v "^\#" > $@
|
---|
[c9ed176] | 350 |
|
---|
[98a4e76] | 351 | generic/src/debug/real_map.bin: depend arch/$(KARCH)/_link.ld $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS)
|
---|
[1314e3b] | 352 | echo $(SYMTAB_SECTION) | $(AS) $(AFLAGS) -o generic/src/debug/empty_map.o
|
---|
[98a4e76] | 353 | $(LD) -T arch/$(KARCH)/_link.ld $(LFLAGS) $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) $(EXTRA_OBJECTS) generic/src/debug/empty_map.o -o $@ -Map kernel.map.pre
|
---|
[e16e036a] | 354 | $(OBJDUMP) -t $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) > kernel.objdump
|
---|
[169c408] | 355 | tools/genmap.py kernel.map.pre kernel.objdump generic/src/debug/real_map.bin
|
---|
[3550c393] | 356 | # Do it once again, this time to get correct even the symbols
|
---|
| 357 | # on architectures, that have bss after symtab
|
---|
[1314e3b] | 358 | echo $(SYMTAB_SECTION)" .incbin \"$@\"" | $(AS) $(AFLAGS) -o generic/src/debug/sizeok_map.o
|
---|
[98a4e76] | 359 | $(LD) -T arch/$(KARCH)/_link.ld $(LFLAGS) $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) $(EXTRA_OBJECTS) generic/src/debug/sizeok_map.o -o $@ -Map kernel.map.pre
|
---|
[3550c393] | 360 | $(OBJDUMP) -t $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) > kernel.objdump
|
---|
| 361 | tools/genmap.py kernel.map.pre kernel.objdump generic/src/debug/real_map.bin
|
---|
[c9ed176] | 362 |
|
---|
[169c408] | 363 | generic/src/debug/real_map.o: generic/src/debug/real_map.bin
|
---|
[1314e3b] | 364 | echo $(SYMTAB_SECTION)" .incbin \"$<\"" | $(AS) $(AFLAGS) -o $@
|
---|
[c9ed176] | 365 |
|
---|
[98a4e76] | 366 | kernel.raw: depend arch/$(KARCH)/_link.ld $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) generic/src/debug/real_map.o
|
---|
| 367 | $(LD) -T arch/$(KARCH)/_link.ld $(LFLAGS) $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) $(EXTRA_OBJECTS) generic/src/debug/real_map.o -o $@ -Map kernel.map
|
---|
[c9ed176] | 368 |
|
---|
[6e259d5] | 369 | kernel.bin: kernel.raw
|
---|
| 370 | $(OBJCOPY) -O $(BFD) kernel.raw kernel.bin
|
---|
| 371 |
|
---|
[2ccd275] | 372 | disasm: kernel.raw
|
---|
| 373 | $(OBJDUMP) -d kernel.raw > kernel.disasm
|
---|
| 374 |
|
---|
[c9ed176] | 375 | %.o: %.S
|
---|
[4a8635b] | 376 | $(GCC) $(DEFS) $(GCC_CFLAGS) -D__ASM__ -c $< -o $@
|
---|
[c9ed176] | 377 |
|
---|
| 378 | %.o: %.s
|
---|
[6bc4dbd] | 379 | $(AS) $(AFLAGS) $< -o $@
|
---|
[c9ed176] | 380 |
|
---|
[23cdc921] | 381 | #
|
---|
| 382 | # The FPU tests are the only objects for which we allow the compiler to generate
|
---|
| 383 | # FPU instructions.
|
---|
| 384 | #
|
---|
| 385 | test/fpu/%.o: test/fpu/%.c
|
---|
[bd1deed] | 386 | $(CC) $(DEFS) $(CFLAGS) $(EXTRA_FLAGS) -c $< -o $@
|
---|
[23cdc921] | 387 |
|
---|
| 388 | #
|
---|
| 389 | # Ordinary objects.
|
---|
| 390 | #
|
---|
| 391 | %.o: %.c
|
---|
| 392 | $(CC) $(DEFS) $(CFLAGS) $(EXTRA_FLAGS) $(FPU_NO_CFLAGS) -c $< -o $@
|
---|