| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | # $NetBSD: Makefile.kern.inc,v 1.264 2018/02/17 22:47:14 joerg Exp $ | | 1 | # $NetBSD: Makefile.kern.inc,v 1.265 2018/08/27 05:35:22 riastradh Exp $ |
2 | # | | 2 | # |
3 | # This file contains common `MI' targets and definitions and it is included | | 3 | # This file contains common `MI' targets and definitions and it is included |
4 | # at the bottom of each `MD' ${MACHINE}/conf/Makefile.${MACHINE}. | | 4 | # at the bottom of each `MD' ${MACHINE}/conf/Makefile.${MACHINE}. |
5 | # | | 5 | # |
6 | # Each target in this file should be protected with `if !target(target)' | | 6 | # Each target in this file should be protected with `if !target(target)' |
7 | # or `if !commands(target)' and each variable should only be conditionally | | 7 | # or `if !commands(target)' and each variable should only be conditionally |
8 | # assigned `VAR ?= VALUE', so that everything can be overriden. | | 8 | # assigned `VAR ?= VALUE', so that everything can be overriden. |
9 | # | | 9 | # |
10 | # DEBUG is set to -g if debugging. | | 10 | # DEBUG is set to -g if debugging. |
11 | # PROF is set to -pg if profiling. | | 11 | # PROF is set to -pg if profiling. |
12 | # | | 12 | # |
13 | # To specify debugging, add the config line: makeoptions DEBUG="-g" | | 13 | # To specify debugging, add the config line: makeoptions DEBUG="-g" |
14 | # A better way is to specify -g only for a few files. | | 14 | # A better way is to specify -g only for a few files. |
| @@ -429,26 +429,32 @@ install-kernel-${MACHINE_NAME}: | | | @@ -429,26 +429,32 @@ install-kernel-${MACHINE_NAME}: |
429 | .endfor | | 429 | .endfor |
430 | .endif | | 430 | .endif |
431 | .endif | | 431 | .endif |
432 | | | 432 | |
433 | ## | | 433 | ## |
434 | ## the kernel | | 434 | ## the kernel |
435 | ## | | 435 | ## |
436 | | | 436 | |
437 | AFLAGS+= ${AOPTS.${.IMPSRC:T}} | | 437 | AFLAGS+= ${AOPTS.${.IMPSRC:T}} |
438 | CFLAGS+= ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} | | 438 | CFLAGS+= ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} |
439 | CPPFLAGS+= ${CPPFLAGS.${.IMPSRC:T}} | | 439 | CPPFLAGS+= ${CPPFLAGS.${.IMPSRC:T}} |
440 | CWARNFLAGS+= ${CWARNFLAGS.${.IMPSRC:T}} | | 440 | CWARNFLAGS+= ${CWARNFLAGS.${.IMPSRC:T}} |
441 | | | 441 | |
| | | 442 | .for _v in CFLAGS CPPFLAGS CWARNFLAGS |
| | | 443 | .for _c in ${CSRCS} |
| | | 444 | ${_v}.${_c:T}+=${OPT.${_c:T}:@.o.@${${_v}.${.o.}}@} |
| | | 445 | .endfor |
| | | 446 | .endfor |
| | | 447 | |
442 | .MAIN: all | | 448 | .MAIN: all |
443 | all: .gdbinit | | 449 | all: .gdbinit |
444 | .for k in ${KERNELS} | | 450 | .for k in ${KERNELS} |
445 | all: .WAIT ${k} | | 451 | all: .WAIT ${k} |
446 | ${k}: ${SYSTEM_DEP:O} swap${k}.o vers.o build_kernel | | 452 | ${k}: ${SYSTEM_DEP:O} swap${k}.o vers.o build_kernel |
447 | .endfor | | 453 | .endfor |
448 | | | 454 | |
449 | .if !defined(COPY_SYMTAB) | | 455 | .if !defined(COPY_SYMTAB) |
450 | build_kernel: .USE | | 456 | build_kernel: .USE |
451 | ${SYSTEM_LD_HEAD} | | 457 | ${SYSTEM_LD_HEAD} |
452 | ${SYSTEM_LD} | | 458 | ${SYSTEM_LD} |
453 | ${SYSTEM_LD_TAIL_STAGE2} | | 459 | ${SYSTEM_LD_TAIL_STAGE2} |
454 | .else | | 460 | .else |