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