| [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 |
|
|---|
| [4e9aaf5] | 29 | ## Configuration
|
|---|
| 30 | #
|
|---|
| 31 |
|
|---|
| 32 | ROOT_PATH = ..
|
|---|
| 33 |
|
|---|
| 34 | VERSION_DEF = $(ROOT_PATH)/version
|
|---|
| 35 |
|
|---|
| 36 | COMMON_MAKEFILE = $(ROOT_PATH)/Makefile.common
|
|---|
| 37 | COMMON_HEADER = $(ROOT_PATH)/common.h
|
|---|
| [6ecf5b8] | 38 | COMMON_HEADER_ARCH = arch/$(KARCH)/include/arch/common.h
|
|---|
| [4e9aaf5] | 39 |
|
|---|
| 40 | CONFIG_MAKEFILE = $(ROOT_PATH)/Makefile.config
|
|---|
| 41 | CONFIG_HEADER = $(ROOT_PATH)/config.h
|
|---|
| 42 |
|
|---|
| 43 | -include $(VERSION_DEF)
|
|---|
| 44 | -include $(COMMON_MAKEFILE)
|
|---|
| 45 | -include $(CONFIG_MAKEFILE)
|
|---|
| 46 |
|
|---|
| 47 | ## Common names
|
|---|
| 48 | #
|
|---|
| 49 |
|
|---|
| [d2f75eb] | 50 | AUTOCHECK = $(realpath $(ROOT_PATH)/tools/autocheck.awk)
|
|---|
| [cfdeedc] | 51 | KERNEL = kernel.elf
|
|---|
| [4e9aaf5] | 52 | MAP = kernel.map
|
|---|
| 53 | JOB = kernel.job
|
|---|
| 54 | MAP_PREV = $(MAP).prev
|
|---|
| 55 | DISASM = kernel.disasm
|
|---|
| 56 | DUMP = kernel.dump
|
|---|
| 57 | REAL_MAP = generic/src/debug/real_map
|
|---|
| 58 |
|
|---|
| 59 | GENMAP = tools/genmap.py
|
|---|
| 60 |
|
|---|
| 61 | LINK = arch/$(KARCH)/_link.ld
|
|---|
| 62 | EMPTY_MAP = generic/src/debug/empty_map.o
|
|---|
| 63 | SIZEOK_MAP = generic/src/debug/sizeok_map.o
|
|---|
| 64 |
|
|---|
| [7f881cd8] | 65 | ifeq ($(PRECHECK),y)
|
|---|
| 66 | JOBFILE = $(ROOT_PATH)/tools/jobfile.py
|
|---|
| [95d45482] | 67 | # NOTE: You must not change the order of arguments.
|
|---|
| [7f881cd8] | 68 | CC_JOB = $(JOBFILE) $(JOB) $(CC) $< -o $@
|
|---|
| 69 | else
|
|---|
| 70 | CC_JOB = $(CC) $< -o $@
|
|---|
| 71 | endif
|
|---|
| 72 |
|
|---|
| [4761f54] | 73 | .PHONY: all clean autogen_clean depend
|
|---|
| [d2f75eb] | 74 | .DELETE_ON_ERROR:
|
|---|
| [e16e036a] | 75 |
|
|---|
| [cfdeedc] | 76 | all: $(VERSION_DEF) $(COMMON_MAKEFILE) $(COMMON_HEADER) $(CONFIG_MAKEFILE) $(CONFIG_HEADER) $(KERNEL) $(DISASM)
|
|---|
| [c9ed176] | 77 |
|
|---|
| [b8fac76] | 78 | clean: autogen_clean
|
|---|
| [cfdeedc] | 79 | rm -f $(KERNEL) $(MAP) $(JOB) $(MAP_PREV) $(DISASM) $(DUMP) $(REAL_MAP).* arch/*/_link.ld arch/*/include/arch/common.h
|
|---|
| [b8fac76] | 80 | find generic/src/ arch/*/src/ genarch/src/ test/ -name '*.o' -follow -exec rm '{}' \;
|
|---|
| [4761f54] | 81 | find generic/src/ arch/*/src/ genarch/src/ test/ -name '*.d' -follow -exec rm '{}' \;
|
|---|
| [4e9aaf5] | 82 |
|
|---|
| 83 | ## Common compiler flags
|
|---|
| 84 | #
|
|---|
| 85 |
|
|---|
| [e344422] | 86 | INCLUDES = generic/include genarch/include arch/$(KARCH)/include ../abi/arch/$(KARCH)/include ../abi/include
|
|---|
| [6ecf5b8] | 87 | INCLUDES_FLAGS = $(addprefix -I,$(INCLUDES))
|
|---|
| [1cb092d] | 88 |
|
|---|
| [bc56f30] | 89 | DEFS = -D_HELENOS_SOURCE -DKERNEL -DRELEASE=$(RELEASE) "-DCOPYRIGHT=$(COPYRIGHT)" "-DNAME=$(NAME)" -D__$(BITS)_BITS__ -D__$(ENDIANESS)__
|
|---|
| [4e9aaf5] | 90 |
|
|---|
| [a0a273e] | 91 | COMMON_CFLAGS = $(INCLUDES_FLAGS) -O$(OPTIMIZATION) -imacros $(CONFIG_HEADER) \
|
|---|
| [7328ff4] | 92 | -ffreestanding -nostdlib \
|
|---|
| [dd162f6] | 93 | -fexec-charset=UTF-8 -finput-charset=UTF-8 -fno-common \
|
|---|
| [874ed210] | 94 | -fdebug-prefix-map=$(realpath $(ROOT_PATH))=. \
|
|---|
| 95 | -Wa,--fatal-warnings
|
|---|
| [a0a273e] | 96 |
|
|---|
| [b60615bd] | 97 | GCC_CFLAGS = -std=gnu11 -Wall -Wextra -Wno-unused-parameter \
|
|---|
| [a0a273e] | 98 | -Wmissing-prototypes -Werror-implicit-function-declaration \
|
|---|
| [c92dfed] | 99 | -Wwrite-strings -pipe -Wno-cast-function-type
|
|---|
| [a0a273e] | 100 |
|
|---|
| [b60615bd] | 101 | CLANG_CFLAGS = -std=gnu11 -Wall -Wextra -Wno-unused-parameter \
|
|---|
| [a41cda7] | 102 | -Wno-missing-field-initializers -Wno-unused-command-line-argument \
|
|---|
| [a0a273e] | 103 | -Wmissing-prototypes -Werror-implicit-function-declaration \
|
|---|
| [874ed210] | 104 | -Wwrite-strings -pipe -fno-stack-protector -fno-PIC \
|
|---|
| 105 | -mllvm -asm-macro-max-nesting-depth=1000
|
|---|
| [4e9aaf5] | 106 |
|
|---|
| [e805e2f] | 107 | ifeq ($(CONFIG_DEBUG),y)
|
|---|
| [a0a273e] | 108 | COMMON_CFLAGS += -Werror
|
|---|
| [e805e2f] | 109 | endif
|
|---|
| 110 |
|
|---|
| [2f7d77c6] | 111 | ifeq ($(CONFIG_UBSAN_KERNEL),y)
|
|---|
| 112 | COMMON_CFLAGS += -fsanitize=undefined
|
|---|
| 113 | endif
|
|---|
| 114 |
|
|---|
| [cf84f1bf] | 115 | ifeq ($(CONFIG_LTO),y)
|
|---|
| [a0a273e] | 116 | COMMON_CFLAGS += -flto
|
|---|
| [cf84f1bf] | 117 | endif
|
|---|
| 118 |
|
|---|
| [9ded977] | 119 | ifeq ($(CONFIG_LINE_DEBUG),y)
|
|---|
| [a0a273e] | 120 | COMMON_CFLAGS += -g
|
|---|
| [9ded977] | 121 | endif
|
|---|
| 122 |
|
|---|
| [009c485] | 123 | LDFLAGS += -Wl,-n -T $(LINK) -Wl,-M,--fatal-warnings,--warn-common
|
|---|
| [510bc07] | 124 |
|
|---|
| [315130c] | 125 | ifeq ($(CONFIG_STRIP_BINARIES),y)
|
|---|
| [009c485] | 126 | LDFLAGS += -s
|
|---|
| [315130c] | 127 | endif
|
|---|
| 128 |
|
|---|
| [4e9aaf5] | 129 | -include arch/$(KARCH)/Makefile.inc
|
|---|
| 130 | -include genarch/Makefile.inc
|
|---|
| 131 |
|
|---|
| 132 | ## The at-sign
|
|---|
| 133 | #
|
|---|
| 134 | # The $(ATSIGN) variable holds the ASCII character representing the at-sign
|
|---|
| 135 | # ('@') used in various $(AS) constructs (e.g. @progbits). On architectures that
|
|---|
| 136 | # don't use '@' for starting a comment, $(ATSIGN) is merely '@'. However, on
|
|---|
| 137 | # those that do use it for starting a comment (e.g. arm32), $(ATSIGN) must be
|
|---|
| 138 | # defined as the percentile-sign ('%') in the architecture-dependent
|
|---|
| 139 | # Makefile.inc.
|
|---|
| 140 | #
|
|---|
| 141 |
|
|---|
| 142 | ATSIGN ?= @
|
|---|
| 143 |
|
|---|
| 144 | ## Cross-platform assembly to start a symtab.data section
|
|---|
| 145 | #
|
|---|
| 146 |
|
|---|
| [3ec2acc] | 147 | SYMTAB_SECTION = .section symtab.data, \"a\", $(ATSIGN)progbits;
|
|---|
| [4e9aaf5] | 148 |
|
|---|
| 149 | ## Compilation options
|
|---|
| 150 | #
|
|---|
| 151 |
|
|---|
| 152 | ifeq ($(COMPILER),clang)
|
|---|
| [a0a273e] | 153 | CFLAGS = $(COMMON_CFLAGS) $(CLANG_CFLAGS)
|
|---|
| [4761f54] | 154 | else
|
|---|
| 155 | CFLAGS = $(COMMON_CFLAGS) $(GCC_CFLAGS)
|
|---|
| [4e9aaf5] | 156 | endif
|
|---|
| 157 |
|
|---|
| [4761f54] | 158 | INSTRUMENTATION = -finstrument-functions
|
|---|
| [cf84f1bf] | 159 |
|
|---|
| [4e9aaf5] | 160 | ## Generic kernel sources
|
|---|
| 161 | #
|
|---|
| 162 |
|
|---|
| 163 | GENERIC_SOURCES = \
|
|---|
| 164 | generic/src/adt/bitmap.c \
|
|---|
| 165 | generic/src/adt/hash_table.c \
|
|---|
| 166 | generic/src/adt/list.c \
|
|---|
| [208db5a] | 167 | generic/src/adt/odict.c \
|
|---|
| [4e9aaf5] | 168 | generic/src/console/chardev.c \
|
|---|
| 169 | generic/src/console/console.c \
|
|---|
| [f0d7bd9] | 170 | generic/src/console/prompt.c \
|
|---|
| [4e9aaf5] | 171 | generic/src/cpu/cpu.c \
|
|---|
| [22b5924] | 172 | generic/src/cpu/cpu_mask.c \
|
|---|
| [4e9aaf5] | 173 | generic/src/ddi/ddi.c \
|
|---|
| 174 | generic/src/ddi/irq.c \
|
|---|
| 175 | generic/src/debug/symtab.c \
|
|---|
| 176 | generic/src/debug/stacktrace.c \
|
|---|
| [06737a0] | 177 | generic/src/debug/panic.c \
|
|---|
| [263bda2] | 178 | generic/src/debug/debug.c \
|
|---|
| [4e9aaf5] | 179 | generic/src/interrupt/interrupt.c \
|
|---|
| [91db0280] | 180 | generic/src/log/log.c \
|
|---|
| [4e9aaf5] | 181 | generic/src/main/main.c \
|
|---|
| 182 | generic/src/main/kinit.c \
|
|---|
| 183 | generic/src/main/uinit.c \
|
|---|
| 184 | generic/src/main/version.c \
|
|---|
| 185 | generic/src/main/shutdown.c \
|
|---|
| [1892d2c] | 186 | generic/src/proc/current.c \
|
|---|
| [4e9aaf5] | 187 | generic/src/proc/program.c \
|
|---|
| 188 | generic/src/proc/scheduler.c \
|
|---|
| 189 | generic/src/proc/thread.c \
|
|---|
| 190 | generic/src/proc/task.c \
|
|---|
| 191 | generic/src/syscall/syscall.c \
|
|---|
| 192 | generic/src/syscall/copy.c \
|
|---|
| [622f409] | 193 | generic/src/mm/km.c \
|
|---|
| [630a8ef] | 194 | generic/src/mm/reserve.c \
|
|---|
| [4e9aaf5] | 195 | generic/src/mm/frame.c \
|
|---|
| 196 | generic/src/mm/page.c \
|
|---|
| 197 | generic/src/mm/tlb.c \
|
|---|
| 198 | generic/src/mm/as.c \
|
|---|
| [b60615bd] | 199 | generic/src/mm/malloc.c \
|
|---|
| [4e9aaf5] | 200 | generic/src/mm/backend_anon.c \
|
|---|
| 201 | generic/src/mm/backend_elf.c \
|
|---|
| 202 | generic/src/mm/backend_phys.c \
|
|---|
| [75b139f] | 203 | generic/src/mm/backend_user.c \
|
|---|
| [4e9aaf5] | 204 | generic/src/mm/slab.c \
|
|---|
| [b2e121a] | 205 | generic/src/lib/halt.c \
|
|---|
| [44a7ee5] | 206 | generic/src/lib/mem.c \
|
|---|
| [3abfe9a8] | 207 | generic/src/lib/memfnc.c \
|
|---|
| [f2460a50] | 208 | generic/src/lib/gsort.c \
|
|---|
| [19f857a] | 209 | generic/src/lib/str.c \
|
|---|
| [42e91ae] | 210 | generic/src/lib/strtol.c \
|
|---|
| [62ca560] | 211 | generic/src/lib/str_error.c \
|
|---|
| [4e9aaf5] | 212 | generic/src/lib/elf.c \
|
|---|
| [9fe7d6c] | 213 | generic/src/lib/ra.c \
|
|---|
| [4e9aaf5] | 214 | generic/src/lib/rd.c \
|
|---|
| [2f7d77c6] | 215 | generic/src/lib/ubsan.c \
|
|---|
| [4e9aaf5] | 216 | generic/src/printf/printf_core.c \
|
|---|
| 217 | generic/src/printf/printf.c \
|
|---|
| 218 | generic/src/printf/snprintf.c \
|
|---|
| 219 | generic/src/printf/vprintf.c \
|
|---|
| 220 | generic/src/printf/vsnprintf.c \
|
|---|
| 221 | generic/src/time/clock.c \
|
|---|
| 222 | generic/src/time/timeout.c \
|
|---|
| 223 | generic/src/time/delay.c \
|
|---|
| 224 | generic/src/preempt/preemption.c \
|
|---|
| 225 | generic/src/synch/spinlock.c \
|
|---|
| 226 | generic/src/synch/condvar.c \
|
|---|
| 227 | generic/src/synch/mutex.c \
|
|---|
| 228 | generic/src/synch/semaphore.c \
|
|---|
| 229 | generic/src/synch/smc.c \
|
|---|
| 230 | generic/src/synch/waitq.c \
|
|---|
| [d314571] | 231 | generic/src/synch/syswaitq.c \
|
|---|
| [4e9aaf5] | 232 | generic/src/smp/ipi.c \
|
|---|
| 233 | generic/src/smp/smp.c \
|
|---|
| 234 | generic/src/ipc/ipc.c \
|
|---|
| 235 | generic/src/ipc/sysipc.c \
|
|---|
| [f0defd2] | 236 | generic/src/ipc/sysipc_ops.c \
|
|---|
| 237 | generic/src/ipc/ops/conctmeto.c \
|
|---|
| 238 | generic/src/ipc/ops/concttome.c \
|
|---|
| 239 | generic/src/ipc/ops/dataread.c \
|
|---|
| 240 | generic/src/ipc/ops/datawrite.c \
|
|---|
| 241 | generic/src/ipc/ops/debug.c \
|
|---|
| [072607b] | 242 | generic/src/ipc/ops/pagein.c \
|
|---|
| [f0defd2] | 243 | generic/src/ipc/ops/sharein.c \
|
|---|
| 244 | generic/src/ipc/ops/shareout.c \
|
|---|
| 245 | generic/src/ipc/ops/stchngath.c \
|
|---|
| [4e9aaf5] | 246 | generic/src/ipc/ipcrsc.c \
|
|---|
| 247 | generic/src/ipc/irq.c \
|
|---|
| 248 | generic/src/ipc/event.c \
|
|---|
| [3f74275] | 249 | generic/src/cap/cap.c \
|
|---|
| [719a208] | 250 | generic/src/security/perm.c \
|
|---|
| [18b5402c] | 251 | generic/src/sysinfo/sysinfo.c \
|
|---|
| [9dae191e] | 252 | generic/src/sysinfo/stats.c
|
|---|
| [4e9aaf5] | 253 |
|
|---|
| 254 | ## Kernel console support
|
|---|
| 255 | #
|
|---|
| 256 |
|
|---|
| 257 | ifeq ($(CONFIG_KCONSOLE),y)
|
|---|
| 258 | GENERIC_SOURCES += \
|
|---|
| 259 | generic/src/console/kconsole.c \
|
|---|
| 260 | generic/src/console/cmd.c
|
|---|
| 261 | endif
|
|---|
| 262 |
|
|---|
| 263 | ## Udebug interface sources
|
|---|
| 264 | #
|
|---|
| 265 |
|
|---|
| 266 | ifeq ($(CONFIG_UDEBUG),y)
|
|---|
| 267 | GENERIC_SOURCES += \
|
|---|
| 268 | generic/src/ipc/kbox.c \
|
|---|
| 269 | generic/src/udebug/udebug.c \
|
|---|
| 270 | generic/src/udebug/udebug_ops.c \
|
|---|
| 271 | generic/src/udebug/udebug_ipc.c
|
|---|
| 272 | endif
|
|---|
| 273 |
|
|---|
| 274 | ## Test sources
|
|---|
| 275 | #
|
|---|
| 276 |
|
|---|
| 277 | ifeq ($(CONFIG_TEST),y)
|
|---|
| 278 | CFLAGS += -Itest/
|
|---|
| 279 | GENERIC_SOURCES += \
|
|---|
| 280 | test/test.c \
|
|---|
| 281 | test/atomic/atomic1.c \
|
|---|
| 282 | test/fault/fault1.c \
|
|---|
| 283 | test/mm/falloc1.c \
|
|---|
| 284 | test/mm/falloc2.c \
|
|---|
| 285 | test/mm/mapping1.c \
|
|---|
| 286 | test/mm/slab1.c \
|
|---|
| 287 | test/mm/slab2.c \
|
|---|
| 288 | test/synch/semaphore1.c \
|
|---|
| 289 | test/synch/semaphore2.c \
|
|---|
| 290 | test/print/print1.c \
|
|---|
| 291 | test/print/print2.c \
|
|---|
| 292 | test/print/print3.c \
|
|---|
| 293 | test/print/print4.c \
|
|---|
| [855e0d8] | 294 | test/print/print5.c \
|
|---|
| [d19b3fc] | 295 | test/thread/thread1.c
|
|---|
| [f1380b7] | 296 |
|
|---|
| [4e9aaf5] | 297 | ifeq ($(KARCH),mips32)
|
|---|
| 298 | GENERIC_SOURCES += test/debug/mips1.c
|
|---|
| 299 | else
|
|---|
| 300 | GENERIC_SOURCES += test/debug/mips1_skip.c
|
|---|
| 301 | endif
|
|---|
| [f1380b7] | 302 |
|
|---|
| [4e9aaf5] | 303 | ifeq ($(KARCH),ia64)
|
|---|
| 304 | GENERIC_SOURCES += test/mm/purge1.c
|
|---|
| 305 | else
|
|---|
| 306 | GENERIC_SOURCES += test/mm/purge1_skip.c
|
|---|
| 307 | endif
|
|---|
| [f1380b7] | 308 |
|
|---|
| [4e9aaf5] | 309 | endif
|
|---|
| 310 |
|
|---|
| [263bda2] | 311 | ## Sources where instrumentation is enabled
|
|---|
| 312 | #
|
|---|
| 313 |
|
|---|
| [da52547] | 314 | ifeq ($(CONFIG_TRACE),y)
|
|---|
| [7a0359b] | 315 | INSTRUMENTED_SOURCES = \
|
|---|
| 316 | generic/src/cpu/cpu.c \
|
|---|
| 317 | generic/src/ddi/ddi.c \
|
|---|
| 318 | generic/src/interrupt/interrupt.c \
|
|---|
| 319 | generic/src/main/main.c \
|
|---|
| 320 | generic/src/main/kinit.c \
|
|---|
| 321 | generic/src/proc/the.c \
|
|---|
| 322 | generic/src/mm/frame.c \
|
|---|
| 323 | generic/src/mm/page.c \
|
|---|
| 324 | generic/src/mm/tlb.c \
|
|---|
| 325 | generic/src/mm/as.c \
|
|---|
| 326 | generic/src/mm/slab.c \
|
|---|
| 327 | generic/src/sysinfo/sysinfo.c \
|
|---|
| 328 | generic/src/console/kconsole.c
|
|---|
| 329 | else
|
|---|
| 330 | INSTRUMENTED_SOURCES =
|
|---|
| [263bda2] | 331 | endif
|
|---|
| 332 |
|
|---|
| [d2f75eb] | 333 | ARCH_SOURCES += $(ARCH_AUTOCHECK_HEADERS:%.h=%.check.c)
|
|---|
| 334 | GENARCH_SOURCES += $(GENARCH_AUTOCHECK_HEADERS:%.h=%.check.c)
|
|---|
| 335 |
|
|---|
| [4e9aaf5] | 336 | GENERIC_OBJECTS := $(addsuffix .o,$(basename $(GENERIC_SOURCES)))
|
|---|
| 337 | ARCH_OBJECTS := $(addsuffix .o,$(basename $(ARCH_SOURCES)))
|
|---|
| 338 | GENARCH_OBJECTS := $(addsuffix .o,$(basename $(GENARCH_SOURCES)))
|
|---|
| 339 |
|
|---|
| [4761f54] | 340 | GENERIC_DEPENDS := $(addsuffix .d,$(basename $(GENERIC_SOURCES)))
|
|---|
| 341 | ARCH_DEPENDS := $(addsuffix .d,$(basename $(ARCH_SOURCES)))
|
|---|
| 342 | GENARCH_DEPENDS := $(addsuffix .d,$(basename $(GENARCH_SOURCES)))
|
|---|
| 343 |
|
|---|
| 344 | -include $(GENERIC_DEPENDS)
|
|---|
| 345 | -include $(ARCH_DEPENDS)
|
|---|
| 346 | -include $(GENARCH_DEPENDS)
|
|---|
| 347 |
|
|---|
| [4e9aaf5] | 348 | ifeq ($(CONFIG_SYMTAB),y)
|
|---|
| 349 | SYMTAB_OBJECTS := generic/src/debug/real_map.o
|
|---|
| 350 | else
|
|---|
| 351 | SYMTAB_OBJECTS :=
|
|---|
| 352 | endif
|
|---|
| 353 |
|
|---|
| [cfdeedc] | 354 | $(DISASM): $(KERNEL)
|
|---|
| [9ded977] | 355 | ifeq ($(CONFIG_LINE_DEBUG),y)
|
|---|
| 356 | $(OBJDUMP) -d -S $< > $@
|
|---|
| 357 | else
|
|---|
| [4e9aaf5] | 358 | $(OBJDUMP) -d $< > $@
|
|---|
| [9ded977] | 359 | endif
|
|---|
| [4e9aaf5] | 360 |
|
|---|
| [cfdeedc] | 361 | $(KERNEL): $(LINK) $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) $(SYMTAB_OBJECTS)
|
|---|
| [009c485] | 362 | $(CC) $(DEFS) $(CFLAGS) $(LDFLAGS) -Wl,-Map,$(MAP) -o $@ $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) $(EXTRA_OBJECTS) $(SYMTAB_OBJECTS)
|
|---|
| [4e9aaf5] | 363 |
|
|---|
| [d2f75eb] | 364 | $(LINK): $(LINK).in
|
|---|
| [53ad43c] | 365 | $(CC) $(DEFS) $(CFLAGS) -D__ASSEMBLER__ -D__LINKER__ -E -x c $< | grep -v "^\#" > $@
|
|---|
| [4e9aaf5] | 366 |
|
|---|
| [d2f75eb] | 367 | %.check.c: %.h $(AUTOCHECK)
|
|---|
| 368 | cd $(<D) && $(AUTOCHECK) $(<F) > $(@F)
|
|---|
| [b8fac76] | 369 |
|
|---|
| [d2f75eb] | 370 | %.o: %.S
|
|---|
| [874ed210] | 371 | $(CC_JOB) -c -MD -MP $(DEFS) $(CFLAGS)
|
|---|
| [4e9aaf5] | 372 |
|
|---|
| [d2f75eb] | 373 | %.o: %.s
|
|---|
| [874ed210] | 374 | $(CC_JOB) -c -MD -MP $(DEFS) $(CFLAGS)
|
|---|
| [4e9aaf5] | 375 |
|
|---|
| [d2f75eb] | 376 | %.o: %.c
|
|---|
| [c631734] | 377 | $(CC_JOB) -c -MD -MP $(DEFS) $(CFLAGS) $(EXTRA_FLAGS) $(FPU_NO_CFLAGS) $(if $(findstring $<,$(INSTRUMENTED_SOURCES)),$(INSTRUMENTATION))
|
|---|
| [4e9aaf5] | 378 |
|
|---|
| 379 | $(REAL_MAP).o: $(REAL_MAP).bin
|
|---|
| [874ed210] | 380 | echo "$(AS_PROLOG)""$(SYMTAB_SECTION)"" .incbin \"$<\"" | $(CC) $(CFLAGS) -x assembler -c -o $@ -
|
|---|
| [4e9aaf5] | 381 |
|
|---|
| 382 | $(REAL_MAP).bin: $(LINK) $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS)
|
|---|
| [874ed210] | 383 | echo "$(AS_PROLOG)""$(SYMTAB_SECTION)" | $(CC) $(CFLAGS) -x assembler -c -o $(EMPTY_MAP) -
|
|---|
| [009c485] | 384 | $(CC) $(DEFS) $(CFLAGS) $(LDFLAGS) -Wl,-Map,$(MAP_PREV) -o $@ $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) $(EXTRA_OBJECTS) $(EMPTY_MAP)
|
|---|
| [4e9aaf5] | 385 | $(OBJDUMP) -t $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) > $(DUMP)
|
|---|
| 386 | $(GENMAP) $(MAP_PREV) $(DUMP) $@
|
|---|
| [f1380b7] | 387 |
|
|---|
| [4e9aaf5] | 388 | # Do it once again, this time to get correct even the symbols
|
|---|
| 389 | # on architectures that have bss after symtab
|
|---|
| [f1380b7] | 390 |
|
|---|
| [874ed210] | 391 | echo "$(AS_PROLOG)""$(SYMTAB_SECTION)"" .incbin \"$@\"" | $(CC) $(CFLAGS) -x assembler -c -o $(SIZEOK_MAP) -
|
|---|
| [009c485] | 392 | $(CC) $(DEFS) $(CFLAGS) $(LDFLAGS) -Wl,-Map,$(MAP_PREV) -o $@ $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) $(EXTRA_OBJECTS) $(SIZEOK_MAP)
|
|---|
| [4e9aaf5] | 393 | $(OBJDUMP) -t $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) > $(DUMP)
|
|---|
| 394 | $(GENMAP) $(MAP_PREV) $(DUMP) $@
|
|---|