From 3803c55856eddb446b0f2ee62fcd3a3838170959 Mon Sep 17 00:00:00 2001 From: Ben Gras Date: Fri, 4 May 2012 18:45:54 +0200 Subject: [PATCH] kernel: neater arch-dependent split in Makefiles . files in kernel/ references in kernel/Makefile, but in kernel/arch/i386/ in kernel/arch/i386/Makefile.inc --- kernel/Makefile | 41 ++++++++----------------------- kernel/arch/i386/Makefile.inc | 45 ++++++++++++++++++----------------- 2 files changed, 33 insertions(+), 53 deletions(-) diff --git a/kernel/Makefile b/kernel/Makefile index 8b54d2c56..8cc59213d 100644 --- a/kernel/Makefile +++ b/kernel/Makefile @@ -3,15 +3,8 @@ PROG= kernel -# first-stage, arch-dependent startup code -SRCS= mpx.S -SRCS+= start.c table.c main.c proc.c \ - system.c clock.c utility.c interrupt.c \ - cpulocals.c - -.ifdef CONFIG_SMP -SRCS += smp.c -.endif +SRCS= clock.c cpulocals.c interrupt.c main.c proc.c start.c system.c \ + table.c utility.c DPADD+= ${LIBTIMERS} ${LIBSYS} ${LIBEXEC} LDADD+= -ltimers -lsys -lexec @@ -38,19 +31,13 @@ MAN= .include "system/Makefile.inc" .include "arch/${ARCH}/Makefile.inc" -.if ${USE_WATCHDOG} != "no" -SRCS+= watchdog.c arch_watchdog.c -CPPFLAGS+= -DUSE_WATCHDOG -.endif - -.if ${USE_ACPI} != "no" -SRCS+= acpi.c -CPPFLAGS+= -DUSE_ACPI +.ifdef CONFIG_SMP +SRCS+= smp.c .endif -.if ${USE_APIC} != "no" -SRCS+= apic.c apic_asm.S -CPPFLAGS+= -DUSE_APIC +.if ${USE_WATCHDOG} != "no" +SRCS+= watchdog.c +CPPFLAGS+= -DUSE_WATCHDOG .endif .if ${USE_MCONTEXT} != "no" @@ -58,16 +45,15 @@ SRCS+= do_mcontext.c CPPFLAGS+= -DUSE_MCONTEXT .endif -.if ${USE_DEBUGREG} != "no" -SRCS+= breakpoints.c debugreg.S -.endif - # Extra debugging routines .if ${USE_SYSDEBUG} != "no" SRCS+= debug.c CPPFLAGS+= -DUSE_SYSDEBUG .endif +# These come last, so the profiling buffer is at the end of the data segment +SRCS+= profile.c do_sprofile.c + .if ${USE_LIVEUPDATE} != "no" CPPFLAGS+= -DUSE_UPDATE .endif @@ -80,13 +66,6 @@ CPPFLAGS+= -DUSE_STATECTL CPPFLAGS+= -DUSE_TRACE .endif -.if ${USE_BOOTPARAM} != "no" -CPPFLAGS+= -DUSE_BOOTPARAM -.endif - -# These come last, so the profiling buffer is at the end of the data segment -SRCS+= profile.c do_sprofile.c - .include debug.d: extracted-errno.h extracted-mfield.h extracted-mtype.h diff --git a/kernel/arch/i386/Makefile.inc b/kernel/arch/i386/Makefile.inc index 2e13ff885..a53824aab 100644 --- a/kernel/arch/i386/Makefile.inc +++ b/kernel/arch/i386/Makefile.inc @@ -4,28 +4,29 @@ HERE=${.CURDIR}/arch/${ARCH} .PATH: ${HERE} -SRCS+= arch_do_vmctl.c \ - arch_clock.c \ - do_iopenable.c \ - do_readbios.c \ - do_sdevio.c \ - exception.c \ - i8259.c \ - io_inb.S \ - io_inl.S \ - io_intr.S \ - io_inw.S \ - io_outb.S \ - io_outl.S \ - io_outw.S \ - klib.S \ - klib16.S \ - multiboot.S \ - memory.c \ - oxpcie.c \ - protect.c \ - arch_system.c \ - pre_init.c +SRCS+= arch_clock.c arch_do_vmctl.c arch_system.c \ + do_iopenable.c do_readbios.c do_sdevio.c exception.c i8259.c io_inb.S \ + io_inl.S io_intr.S io_inw.S io_outb.S io_outl.S io_outw.S klib.S klib16.S memory.c mpx.S multiboot.S \ + oxpcie.c pre_init.c protect.c + +.if ${USE_ACPI} != "no" +SRCS+= acpi.c +CPPFLAGS+= -DUSE_ACPI +.endif + +.if ${USE_APIC} != "no" +SRCS+= apic.c apic_asm.S +CPPFLAGS+= -DUSE_APIC +.endif + +.if ${USE_DEBUGREG} != "no" +SRCS+= breakpoints.c debugreg.S +.endif + +.if ${USE_WATCHDOG} != "no" +SRCS+= arch_watchdog.c +CPPFLAGS+= -DUSE_WATCHDOG +.endif apic_asm.d klib.d mpx.d: procoffsets.h -- 2.44.0