1 # $DragonFly: src/sys/conf/kern.pre.mk,v 1.1 2006/07/02 00:55:08 corecode Exp $
3 # This Makefile covers the top part of the MI kernel build instructions
6 # Can be overridden by makeoptions or /etc/make.conf
9 # build this target if none is specified on the command line
18 .if
!defined
(NO_CPU_COPTFLAGS
)
19 COPTFLAGS
+= ${_CPUCFLAGS}
21 # don't use -I- so we can use proper source-relative locality for local
23 INCLUDES
= -nostdinc
-I.
-I
$S
24 # This hack is to allow kernel compiles to succeed on machines w/out srcdist
25 .if exists
($S/..
/include)
26 INCLUDES
+= -I
$S/..
/include
28 INCLUDES
+= -I
/usr
/include
31 # This hack lets us use the Intel ACPICA code without spamming a new
32 # include path into 100+ source files.
33 .
include "$S/conf/acpi.mk"
34 INCLUDES
+= -I
${.OBJDIR
} -I
"$S/${OSACPI_MI_DIR}" -I
"$S/${ACPICA_DIR}/include"
36 # This hack lets us use the ipfilter code without spamming a new
37 # include path into 100+ source files.
38 INCLUDES
+= -I
$S/contrib
/ipfilter
40 COPTS
= ${INCLUDES} ${IDENT} -D_KERNEL
-include opt_global.h
41 CFLAGS
= ${COPTFLAGS} ${CWARNFLAGS} ${DEBUG} ${COPTS}
43 # XXX LOCORE means "don't declare C stuff" not "for locore.s".
44 ASM_CFLAGS
= -x assembler-with-cpp
-DLOCORE
${CFLAGS}
48 CFLAGS
+= -falign-functions
=16
50 IDENT
+= -DGPROF4
-DGUPROF
51 PROF
+= -mprofiler-epilogue
55 # Put configuration-specific C flags last (except for ${PROF}) so that they
56 # can override the others.
57 CFLAGS
+= ${CONF_CFLAGS}
59 NORMAL_C
= ${CC} -c
${CFLAGS} ${PROF} ${.IMPSRC
}
60 NORMAL_C_C
= ${CC} -c
${CFLAGS} ${PROF} ${.IMPSRC
}
61 NORMAL_S
= ${CC} -c
${ASM_CFLAGS} ${.IMPSRC
}
62 PROFILE_C
= ${CC} -c
${CFLAGS} ${.IMPSRC
}
64 NORMAL_M
= awk
-f
$S/tools
/makeobjops.awk
-- -c
$<; \
65 ${CC} -c
${CFLAGS} ${PROF} ${.PREFIX
}.c
67 GEN_CFILES
= $S/$M/$M/genassym.c
68 SYSTEM_CFILES
= ioconf.c config.c
69 SYSTEM_SFILES
= $S/$M/$M/locore.s
70 SYSTEM_DEP
= Makefile
${SYSTEM_OBJS}
71 SYSTEM_OBJS
= locore.o
${OBJS} ioconf.o config.o hack.So
72 SYSTEM_LD
= @
${LD} -Bdynamic
-T
$S/conf
/ldscript.
$M \
73 -export-dynamic
-dynamic-linker
/red
/herring \
74 -o
${.TARGET
} -X
${SYSTEM_OBJS} vers.o
75 SYSTEM_LD_TAIL
= @
${OBJCOPY} --strip-symbol gcc2_compiled.
${.TARGET
} ; \
76 ${SIZE} ${.TARGET
} ; chmod
755 ${.TARGET
}
77 SYSTEM_DEP
+= $S/conf
/ldscript.
$M
80 # Normalize output files to make it absolutely crystal clear to
81 # anyone examining the build directory.
84 FULLKERNEL
= ${KERNEL}.debug
85 .if defined
(INSTALLSTRIPPED
)
86 SELECTEDKERNEL
= ${KERNEL}.stripped
88 SELECTEDKERNEL
= ${KERNEL}.debug
91 FULLKERNEL
= ${KERNEL}.nodebug
92 SELECTEDKERNEL
= ${KERNEL}.stripped
96 MKMODULESENV
= MAKEOBJDIRPREFIX
=${.OBJDIR
} BUILDING_WITH_KERNEL
=${.OBJDIR
}
97 .if defined
(MODULES_OVERRIDE
)
98 MKMODULESENV
+= MODULES_OVERRIDE
="${MODULES_OVERRIDE}"
101 MKMODULESENV
+= DEBUG
="${DEBUG}" DEBUG_FLAGS
="${DEBUG}"
103 .if defined
(INSTALLSTRIPPED
) || defined
(INSTALLSTRIPPEDMODULES
)
104 MKMODULESENV
+= INSTALLSTRIPPEDMODULES
=1