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