1# $FreeBSD$
2#
3LIB=			i386
4INTERNALLIB=
5
6SRCS=	biosacpi.c bioscd.c biosdisk.c biosmem.c biospnp.c \
7	biospci.c biossmap.c bootinfo.c bootinfo32.c bootinfo64.c \
8	comconsole.c devicename.c elf32_freebsd.c \
9	elf64_freebsd.c \
10	i386_copy.c i386_module.c nullconsole.c pxe.c pxetramp.s \
11	smbios.c time.c vidconsole.c amd64_tramp.S spinconsole.c
12.PATH:	${.CURDIR}/../../zfs
13SRCS+=	devicename_stubs.c
14
15# Enable PXE TFTP or NFS support, not both.
16.if defined(LOADER_TFTP_SUPPORT)
17CFLAGS+=	-DLOADER_TFTP_SUPPORT
18.else
19CFLAGS+=	-DLOADER_NFS_SUPPORT
20.endif
21
22BOOT_COMCONSOLE_PORT?= 0x3f8
23CFLAGS+=	-DCOMPORT=${BOOT_COMCONSOLE_PORT}
24
25BOOT_COMCONSOLE_SPEED?= 9600
26CFLAGS+=	-DCOMSPEED=${BOOT_COMCONSOLE_SPEED}
27
28.ifdef(BOOT_BIOSDISK_DEBUG)
29# Make the disk code more talkative
30CFLAGS+= -DDISK_DEBUG
31.endif
32
33.if !defined(BOOT_HIDE_SERIAL_NUMBERS)
34# Export serial numbers, UUID, and asset tag from loader.
35CFLAGS+= -DSMBIOS_SERIAL_NUMBERS
36.if defined(BOOT_LITTLE_ENDIAN_UUID)
37# Use little-endian UUID format as defined in SMBIOS 2.6.
38CFLAGS+= -DSMBIOS_LITTLE_ENDIAN_UUID
39.endif
40.endif
41
42# Include simple terminal emulation (cons25-compatible)
43CFLAGS+= -DTERM_EMU
44
45# XXX: make alloca() useable
46CFLAGS+= -Dalloca=__builtin_alloca
47
48CFLAGS+=	-I${.CURDIR}/../../common -I${.CURDIR}/../common \
49		-I${.CURDIR}/../btx/lib \
50		-I${.CURDIR}/../../../contrib/dev/acpica/include \
51		-I${.CURDIR}/../../.. -I.
52# the location of libstand
53CFLAGS+=	-I${.CURDIR}/../../../../lib/libstand/
54
55.if ${MACHINE_CPUARCH} == "amd64"
56CLEANFILES+=	machine
57machine:
58	ln -sf ${.CURDIR}/../../../i386/include machine
59.endif
60
61.include <bsd.lib.mk>
62
63# XXX: clang integrated-as doesn't grok .codeNN directives yet
64CFLAGS.amd64_tramp.S=	${CLANG_NO_IAS}
65CFLAGS+=		${CFLAGS.${.IMPSRC:T}}
66
67.if ${MACHINE_CPUARCH} == "amd64"
68beforedepend ${OBJS}: machine
69.endif
70